diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2014-12-18 12:12:58 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2014-12-18 12:12:58 +0100 |
commit | e281537f2049af0b96fd87158f2b7212afe8ab5f (patch) | |
tree | 7f9e3b14a2456cc779aa165457192094507dd257 /src/gui/opengl/qopenglpaintengine_p.h | |
parent | e0a8b5ce88bc50440dcec2fe3a86d83e2a7dc7b0 (diff) | |
parent | 84569773db68408704193268bc42a200bb25a924 (diff) |
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
src/corelib/global/qglobal.h
src/platformsupport/platformcompositor/qopenglcompositor.cpp
src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp
tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
Change-Id: I5422868500be695584a496dbbbc719d146bc572d
Diffstat (limited to 'src/gui/opengl/qopenglpaintengine_p.h')
-rw-r--r-- | src/gui/opengl/qopenglpaintengine_p.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/gui/opengl/qopenglpaintengine_p.h b/src/gui/opengl/qopenglpaintengine_p.h index 85ecd82b6f..e8557e61cd 100644 --- a/src/gui/opengl/qopenglpaintengine_p.h +++ b/src/gui/opengl/qopenglpaintengine_p.h @@ -69,6 +69,8 @@ enum EngineMode { QT_BEGIN_NAMESPACE #define GL_STENCIL_HIGH_BIT GLuint(0x80) +#define QT_UNKNOWN_TEXTURE_UNIT GLuint(-1) +#define QT_DEFAULT_TEXTURE_UNIT GLuint(0) #define QT_BRUSH_TEXTURE_UNIT GLuint(0) #define QT_IMAGE_TEXTURE_UNIT GLuint(0) //Can be the same as brush texture unit #define QT_MASK_TEXTURE_UNIT GLuint(1) @@ -184,7 +186,7 @@ public: snapToPixelGrid(false), nativePaintingActive(false), inverseScale(1), - lastMaskTextureUsed(0) + lastTextureUnitUsed(QT_UNKNOWN_TEXTURE_UNIT) { } ~QOpenGL2PaintEngineExPrivate(); @@ -193,7 +195,13 @@ public: void updateBrushUniforms(); void updateMatrix(); void updateCompositionMode(); - void updateTextureFilter(GLenum wrapMode, bool smoothPixmapTransform, GLuint id = GLuint(-1)); + + enum TextureUpdateMode { UpdateIfNeeded, ForceUpdate }; + template<typename T> + void updateTexture(GLenum textureUnit, const T &texture, GLenum wrapMode, GLenum filterMode, TextureUpdateMode updateMode = UpdateIfNeeded); + template<typename T> + GLuint bindTexture(const T &texture); + void activateTextureUnit(GLenum textureUnit); void resetGLState(); @@ -295,8 +303,8 @@ public: GLfloat pmvMatrix[3][3]; GLfloat inverseScale; + GLenum lastTextureUnitUsed; GLuint lastTextureUsed; - GLuint lastMaskTextureUsed; bool needsSync; bool multisamplingAlwaysEnabled; |