summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-09-28 08:31:46 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-10-07 02:58:49 (GMT)
commitb4d751f565e84227a16021fcbc4fc7c700293662 (patch)
tree83f12f27110b27bba4bae88fbc12cd182cdc3be3
parente1dfa019ca04c00a6567b8038c25556235540d9d (diff)
downloadQt-b4d751f565e84227a16021fcbc4fc7c700293662.zip
Qt-b4d751f565e84227a16021fcbc4fc7c700293662.tar.gz
Qt-b4d751f565e84227a16021fcbc4fc7c700293662.tar.bz2
Moved GL 2 clip clearing code into a common function.
(cherry picked from commit 6d17e09c274803d324e8a8db579aaafaefaab33f)
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp28
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h1
2 files changed, 15 insertions, 14 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index b7f9e2c..13f0079 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1699,25 +1699,30 @@ void QGL2PaintEngineEx::clipEnabledChanged()
}
}
+void QGL2PaintEngineExPrivate::clearClip(uint value)
+{
+ glDepthMask(true);
+ glClearDepth(rawDepth(value));
+ glClear(GL_DEPTH_BUFFER_BIT);
+ glDepthMask(false);
+
+ q->state()->needsClipBufferClear = false;
+}
+
void QGL2PaintEngineExPrivate::writeClip(const QVectorPath &path, uint value)
{
transferMode(BrushDrawingMode);
if (matrixDirty)
updateMatrix();
- if (q->state()->needsClipBufferClear) {
- glDepthMask(true);
- glClearDepth(rawDepth(1));
- glClear(GL_DEPTH_BUFFER_BIT);
- q->state()->needsClipBufferClear = false;
- }
-
- glDepthMask(false);
+ if (q->state()->needsClipBufferClear)
+ clearClip(1);
if (path.isEmpty())
return;
glDisable(GL_BLEND);
+ glDepthMask(false);
vertexCoordinateArray.clear();
vertexCoordinateArray.addPath(path, inverseScale);
@@ -1890,12 +1895,7 @@ void QGL2PaintEngineExPrivate::systemStateChanged()
return;
}
#endif
- q->state()->needsClipBufferClear = false;
-
- glDepthMask(true);
-
- glClearDepth(0);
- glClear(GL_DEPTH_BUFFER_BIT);
+ clearClip(0);
QPainterPath path;
path.addRegion(systemClip);
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index fc61905..dd5f4fc 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -240,6 +240,7 @@ public:
QGLEngineShaderManager* shaderManager;
+ void clearClip(uint value);
void writeClip(const QVectorPath &path, uint value);
void updateClipScissorTest();
void setScissor(const QRect &rect);