diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-07-03 13:36:01 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-07-04 16:09:27 +0200 |
commit | 8a031696a154fe115983372022c142db0e877962 (patch) | |
tree | cbbe6ea6536b061a5645a64d2427941afe5ae64a /src/gui/opengl/qopenglpaintengine_p.h | |
parent | 0eefa785a0d8bfe96403f9c13e80544cf8bb8eb3 (diff) |
Make QOpenGLTextureCache::bindTexture upload efficiently
Currently QOpenGLTextureCache::bindTexture always convert any uploaded
image to RGBA8888 before uploading. This is quite inefficient when
OpenGL natively supports uploading formats in the original format.
This patch adds support for uploading a few native QImage formats. This
also get the performance of QOpenGLTextureCache::bindTexture on par with
QGLContext::bindTexture.
The texture brush used by QOpenGLPaintEngine is also converted to QImage,
since bindTexture will convert it to QImage anyway, and going over QPixmap
may cause an unnecessary conversion.
[ChangeLog][QtGui][QOpenGLTextureCache] Support uploading common QImage
formats directly to OpenGL when supported.
Change-Id: I828a763126441a98e4547c32ef52dddf7c129a32
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/gui/opengl/qopenglpaintengine_p.h')
-rw-r--r-- | src/gui/opengl/qopenglpaintengine_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/opengl/qopenglpaintengine_p.h b/src/gui/opengl/qopenglpaintengine_p.h index 4f0e2e52a4..89eb7e87b2 100644 --- a/src/gui/opengl/qopenglpaintengine_p.h +++ b/src/gui/opengl/qopenglpaintengine_p.h @@ -288,7 +288,7 @@ public: QBrush currentBrush; // May not be the state's brush! const QBrush noBrush; - QPixmap currentBrushPixmap; + QImage currentBrushImage; QOpenGL2PEXVertexArray vertexCoordinateArray; QOpenGL2PEXVertexArray textureCoordinateArray; |