diff options
author | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2014-12-02 20:16:23 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2014-12-11 06:14:28 +0100 |
commit | 47326b9c5c38fea39f8539f50f32667d2c391b70 (patch) | |
tree | 166131a53f82827bb9c90916b95559ab7552399c /src/gui/opengl/qopenglpaintengine_p.h | |
parent | e9222e199d587f48bd1d0e597aa295ebbe0531e3 (diff) |
GL2PaintEngine: centralize logic for updating/preparing textures
Rewrite of updateTextureFilter to include activating and binding as well,
so that we can maintain a single view of which texture was the last one
to be used from within the engine itself.
The behavior should be the same as before.
Change-Id: I41781d00458b0176c614266f4360db3c68b120a1
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src/gui/opengl/qopenglpaintengine_p.h')
-rw-r--r-- | src/gui/opengl/qopenglpaintengine_p.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/opengl/qopenglpaintengine_p.h b/src/gui/opengl/qopenglpaintengine_p.h index a5f3cc2894..209cd3d7b5 100644 --- a/src/gui/opengl/qopenglpaintengine_p.h +++ b/src/gui/opengl/qopenglpaintengine_p.h @@ -193,7 +193,12 @@ 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 resetGLState(); |