From 886c537f2fa225eecc5a68670688e390445a3936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 25 May 2009 09:55:23 +0200 Subject: Fixed broken system clip handling in GL2 paint engine. Override systemStateChanged() to get the system clip updates. Reviewed-by: Trond --- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 11 +++++++++++ src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h | 2 -- 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 -- cgit v0.12