summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-05-18 16:42:30 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-05-18 16:42:30 (GMT)
commit73dd402265ebc07e8c86e42321e881a903ec316e (patch)
treec523692ba188a00303e6bf5df3fa7985d2fa8c43 /src
parent8cdc4d5be0ce935cc58618b5aef4a078b7706edf (diff)
parent17e1bca1ce366395f8331e16aa96b7176ca1abac (diff)
downloadQt-73dd402265ebc07e8c86e42321e881a903ec316e.zip
Qt-73dd402265ebc07e8c86e42321e881a903ec316e.tar.gz
Qt-73dd402265ebc07e8c86e42321e881a903ec316e.tar.bz2
Integrate merge-request #381 into branch 'master'
Zack Rusin (1): Optimize rendering in the GL engine Repository: git://gitorious.org/~zack/qt/zacks-clone.git Branch: graphics (17e1bca1ce366395f8331e16aa96b7176ca1abac) Request-url: http://qt.gitorious.org/qt/qt/merge_requests/381 Reviewed-by: Samuel Rødal <sroedal@trolltech.com>
Diffstat (limited to 'src')
-rw-r--r--src/opengl/qpaintengine_opengl.cpp22
1 files changed, 3 insertions, 19 deletions
diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp
index aee351d..4259a5c 100644
--- a/src/opengl/qpaintengine_opengl.cpp
+++ b/src/opengl/qpaintengine_opengl.cpp
@@ -2233,7 +2233,7 @@ void QOpenGLPaintEnginePrivate::fillVertexArray(Qt::FillRule fillRule)
// Enable color writes.
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
- glStencilMask(0);
+ glStencilMask(stencilMask);
setGradientOps(cbrush, QRectF(QPointF(min_x, min_y), QSizeF(max_x - min_x, max_y - min_y)));
@@ -2245,12 +2245,14 @@ void QOpenGLPaintEnginePrivate::fillVertexArray(Qt::FillRule fillRule)
// Enable stencil func.
glStencilFunc(GL_NOTEQUAL, 0, stencilMask);
+ glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
composite(rect);
} else {
DEBUG_ONCE qDebug() << "QOpenGLPaintEnginePrivate: Drawing polygon using stencil method (no fragment programs)";
// Enable stencil func.
glStencilFunc(GL_NOTEQUAL, 0, stencilMask);
+ glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
#ifndef QT_OPENGL_ES
glBegin(GL_QUADS);
glVertex2f(min_x, min_y);
@@ -2261,24 +2263,6 @@ void QOpenGLPaintEnginePrivate::fillVertexArray(Qt::FillRule fillRule)
#endif
}
- glStencilMask(~0);
- glStencilFunc(GL_ALWAYS, 0, 0);
- glStencilOp(GL_ZERO, GL_ZERO, GL_ZERO);
-
- // clear all stencil values to 0
- glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
-
-#ifndef QT_OPENGL_ES
- glBegin(GL_QUADS);
- glVertex2f(min_x, min_y);
- glVertex2f(max_x, min_y);
- glVertex2f(max_x, max_y);
- glVertex2f(min_x, max_y);
- glEnd();
-#endif
-
- glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
-
// Disable stencil writes.
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
glStencilMask(0);