summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-09-16 11:46:41 +1000
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-09-16 13:05:02 +1000
commit10e1d939d6bf08249304cb2c555be2f74c3a0f02 (patch)
treebfda461b0e49c138bc408aa0c799f15ce5907513 /src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
parenta4571547a38d68d6778bf0ebfa4dc26cc3d865a3 (diff)
Reduce overhead of paint engine-specific pixmap filters
Engine-specific pixmap filters were being created, used, and destroyed every time draw() was called on QPixmapColorizeFilter, QPixmapBlurFilter, and so on. This had a heavy performance penalty and made it difficult for the GL paint engine to cache shaders from one request to the next. A generic filter can request an engine-specific filter that matches its parameters. The engine can either create a new one or return a previously allocated filter object. Ownership of engine-specific pixmap filter objects is moved to the paint engine itself. Reviewed-by: Andrew den Exter Reviewed-by: Michael Brasser Reviewed-by: Michael Goddard Reviewed-by: Sarah Smith
Diffstat (limited to 'src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index 34f4eb8b32..a44be909ee 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -59,6 +59,7 @@
#include <private/qglengineshadermanager_p.h>
#include <private/qgl2pexvertexarray_p.h>
#include <private/qglpaintdevice_p.h>
+#include <private/qglpixmapfilter_p.h>
enum EngineMode {
ImageDrawingMode,
@@ -140,7 +141,7 @@ public:
const QGLContext* context();
- QPixmapFilter *createPixmapFilter(int type) const;
+ QPixmapFilter *pixmapFilter(int type, const QPixmapFilter *prototype);
void setRenderTextActive(bool);
@@ -264,6 +265,10 @@ public:
bool inRenderText;
float textureInvertedY;
+
+ QScopedPointer<QPixmapFilter> convolutionFilter;
+ QScopedPointer<QPixmapFilter> colorizeFilter;
+ QScopedPointer<QPixmapFilter> blurFilter;
};
QT_END_NAMESPACE