diff options
author | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-12-28 09:31:22 (GMT) |
---|---|---|
committer | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-12-28 10:48:51 (GMT) |
commit | 9709b10d691857209a684495799d163098bb44eb (patch) | |
tree | 3b13bbcc3c7e1030604d6aab0867baa2a068afb4 /src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h | |
parent | f9ceaa5cee03c642665514c1da08a43de5c3a56f (diff) | |
download | Qt-9709b10d691857209a684495799d163098bb44eb.zip Qt-9709b10d691857209a684495799d163098bb44eb.tar.gz Qt-9709b10d691857209a684495799d163098bb44eb.tar.bz2 |
Move the 0.5 offset we add for aliased rendering to updateMatrix()
The old code set and unset a temporary matrix for every draw command
when doing aliased rendering. Instead, we just use a flag to indicate
that updateMatrix() should add the offset. This means the offset is
added only once. When doing lots of small rendering operations on a
(non-multisampled) QGLWidget, this gives up to 72% performance boost
on the SGX.
Reviewed-By: Kim
Diffstat (limited to 'src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h')
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index 8de4a82..4ace030 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -171,6 +171,7 @@ public: q(q_ptr), width(0), height(0), ctx(0), + addOffset(false), inverseScale(1), shaderManager(0), inRenderText(false) @@ -246,8 +247,6 @@ public: QBrush currentBrush; // May not be the state's brush! const QBrush noBrush; - GLfloat inverseScale; - QGL2PEXVertexArray vertexCoordinateArray; QGL2PEXVertexArray textureCoordinateArray; QDataBuffer<GLfloat> opacityArray; @@ -255,7 +254,9 @@ public: GLfloat staticVertexCoordinateArray[8]; GLfloat staticTextureCoordinateArray[8]; + bool addOffset; // When enabled, adds a 0.49,0.49 offset to matrix in updateMatrix GLfloat pmvMatrix[3][3]; + GLfloat inverseScale; QGLEngineShaderManager* shaderManager; |