diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2010-12-14 11:03:23 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2010-12-14 11:12:45 (GMT) |
commit | 67b24ac50637ecda00990b239fc5ed0b73e54d75 (patch) | |
tree | bc07672d94a51275e521c4242f0ab2994388d0db /src/opengl | |
parent | d6dace9bebd8a8ad8caaecb69dd24dd1ddf96f4a (diff) | |
download | Qt-67b24ac50637ecda00990b239fc5ed0b73e54d75.zip Qt-67b24ac50637ecda00990b239fc5ed0b73e54d75.tar.gz Qt-67b24ac50637ecda00990b239fc5ed0b73e54d75.tar.bz2 |
Fixed stroke / fill inconsistencies in GL 2 paint engine.
Get rid of the aliased coordinate delta, like we already did in the
raster paint engine.
Task-number: QTBUG-16043
Reviewed-by: Gunnar Sletta
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 40 | ||||
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h | 2 |
2 files changed, 0 insertions, 42 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index bb7c804..cdd785a 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -381,12 +381,6 @@ void QGL2PaintEngineExPrivate::updateMatrix() dx = ceilf(dx - 0.5f); dy = ceilf(dy - 0.5f); } -#ifndef Q_OS_SYMBIAN - if (addOffset) { - dx += 0.49f; - dy += 0.49f; - } -#endif pmvMatrix[0][0] = (wfactor * transform.m11()) - transform.m13(); pmvMatrix[1][0] = (wfactor * transform.m21()) - transform.m23(); pmvMatrix[2][0] = (wfactor * dx) - transform.m33(); @@ -488,11 +482,6 @@ void QGL2PaintEngineExPrivate::drawTexture(const QGLRect& dest, const QGLRect& s currentBrush = noBrush; shaderManager->setSrcPixelType(pattern ? QGLEngineShaderManager::PatternSrc : QGLEngineShaderManager::ImageSrc); - if (addOffset) { - addOffset = false; - matrixDirty = true; - } - if (snapToPixelGrid) { snapToPixelGrid = false; matrixDirty = true; @@ -675,16 +664,6 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) { transferMode(BrushDrawingMode); - const QOpenGL2PaintEngineState *s = q->state(); - const bool newAddOffset = !(s->renderHints & QPainter::Antialiasing) && - (qbrush_style(currentBrush) == Qt::SolidPattern) && - !multisamplingAlwaysEnabled; - - if (addOffset != newAddOffset) { - addOffset = newAddOffset; - matrixDirty = true; - } - if (snapToPixelGrid) { snapToPixelGrid = false; matrixDirty = true; @@ -1203,12 +1182,6 @@ void QGL2PaintEngineEx::stroke(const QVectorPath &path, const QPen &pen) void QGL2PaintEngineExPrivate::stroke(const QVectorPath &path, const QPen &pen) { const QOpenGL2PaintEngineState *s = q->state(); - const bool newAddOffset = !(s->renderHints & QPainter::Antialiasing) && !multisamplingAlwaysEnabled; - if (addOffset != newAddOffset) { - addOffset = newAddOffset; - matrixDirty = true; - } - if (snapToPixelGrid) { snapToPixelGrid = false; matrixDirty = true; @@ -1638,10 +1611,6 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, (GLfloat*)vertexCoordinates->data()); setVertexAttributePointer(QT_TEXTURE_COORDS_ATTR, (GLfloat*)textureCoordinates->data()); - if (addOffset) { - addOffset = false; - matrixDirty = true; - } if (!snapToPixelGrid) { snapToPixelGrid = true; matrixDirty = true; @@ -1786,11 +1755,6 @@ void QGL2PaintEngineExPrivate::drawPixmapFragments(const QPainter::PixmapFragmen textureCoordinateArray.clear(); opacityArray.reset(); - if (addOffset) { - addOffset = false; - matrixDirty = true; - } - if (snapToPixelGrid) { snapToPixelGrid = false; matrixDirty = true; @@ -2087,10 +2051,6 @@ void QGL2PaintEngineExPrivate::writeClip(const QVectorPath &path, uint value) { transferMode(BrushDrawingMode); - if (addOffset) { - addOffset = false; - matrixDirty = true; - } if (snapToPixelGrid) { snapToPixelGrid = false; matrixDirty = true; diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index b255e75..88172fb 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -181,7 +181,6 @@ public: elementIndicesVBOId(0), opacityArray(0), snapToPixelGrid(false), - addOffset(false), nativePaintingActive(false), inverseScale(1), lastMaskTextureUsed(0) @@ -283,7 +282,6 @@ public: GLfloat staticTextureCoordinateArray[8]; bool snapToPixelGrid; - bool addOffset; // When enabled, adds a 0.49,0.49 offset to matrix in updateMatrix bool nativePaintingActive; GLfloat pmvMatrix[3][3]; GLfloat inverseScale; |