summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-05-25 07:55:23 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-05-25 08:43:50 (GMT)
commit886c537f2fa225eecc5a68670688e390445a3936 (patch)
treebe8daba259e00409bcdf8a3e8843d7e8d10458ad
parent943b709a71b1ffc9abdf459269c79dd1b731d781 (diff)
downloadQt-886c537f2fa225eecc5a68670688e390445a3936.zip
Qt-886c537f2fa225eecc5a68670688e390445a3936.tar.gz
Qt-886c537f2fa225eecc5a68670688e390445a3936.tar.bz2
Fixed broken system clip handling in GL2 paint engine.
Override systemStateChanged() to get the system clip updates. Reviewed-by: Trond
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp11
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h2
2 files changed, 11 insertions, 2 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index caf744a..f174306 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -173,6 +173,7 @@ public:
// Clipping & state stuff stolen from QOpenGLPaintEngine:
void updateDepthClip();
+ void systemStateChanged();
uint use_system_clip : 1;
QPaintEngine *last_engine;
@@ -1302,6 +1303,16 @@ void QGL2PaintEngineEx::updateClipRegion(const QRegion &clipRegion, Qt::ClipOper
d->updateDepthClip();
}
+void QGL2PaintEngineExPrivate::systemStateChanged()
+{
+ Q_Q(QGL2PaintEngineEx);
+ use_system_clip = !systemClip.isEmpty();
+
+ if (q->painter()->hasClipping())
+ q->updateClipRegion(q->painter()->clipRegion(), Qt::ReplaceClip);
+ else
+ q->updateClipRegion(QRegion(), Qt::NoClip);
+}
void QGL2PaintEngineExPrivate::updateDepthClip()
{
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index 76a4fe0..ccf89f0 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -119,6 +119,4 @@ private:
Q_DISABLE_COPY(QGL2PaintEngineEx)
};
-
-
#endif