diff options
author | Tom Cooksey <thomas.cooksey@nokia.com> | 2010-01-03 14:35:53 (GMT) |
---|---|---|
committer | Tom Cooksey <thomas.cooksey@nokia.com> | 2010-01-04 09:25:51 (GMT) |
commit | 1e7922262c29ba29a70226cf8894645f46df3ca2 (patch) | |
tree | 1a977f1b82fc68320830042eb4f518c741355215 /src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h | |
parent | cdebdfc7964df6b19f8bd520335a8645c1a125e6 (diff) | |
download | Qt-1e7922262c29ba29a70226cf8894645f46df3ca2.zip Qt-1e7922262c29ba29a70226cf8894645f46df3ca2.tar.gz Qt-1e7922262c29ba29a70226cf8894645f46df3ca2.tar.bz2 |
Introduce new "snapToPixelGrid" flag to GL2 engine for drawText
When we're rendering text, the glyphs need to be aligned to the
pixel grid otherwise we get strange artifacts. Normally text is
drawn at integer coordinates, however it is still possible to
have a transform which translates by a non-integer offset. This
patch adds a flag to the engine which can be used to snap any
translate to the pixel grid.
Task-number: QTBUG-7094
Reviewed-By: Kim
Diffstat (limited to 'src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h')
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index 9a5c447..7d5cb52 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -167,6 +167,7 @@ public: width(0), height(0), ctx(0), useSystemClip(true), + snapToPixelGrid(false), addOffset(false), inverseScale(1) { } @@ -260,6 +261,7 @@ public: GLfloat staticVertexCoordinateArray[8]; GLfloat staticTextureCoordinateArray[8]; + bool snapToPixelGrid; bool addOffset; // When enabled, adds a 0.49,0.49 offset to matrix in updateMatrix GLfloat pmvMatrix[3][3]; GLfloat inverseScale; |