From 47d6e83659f23de6bf4d0a37cb30c325dcacefc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 11 Sep 2009 10:53:39 +0200 Subject: Fixed clipping bugs in GL2 graphics system with oxygen style. QGL2PaintEngineEx::clip() needs to call ensureActive() to make sure the engine is active and synced before doing any clipping operations. We also need to set needsSync to false before entering setState() since otherwise we end up in an infinite loop in the case where replayClipOperations() again calls QGL2PaintEngineEx::clip(). Reviewed-by: Tom --- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 4427ee9..e32bbbd 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1405,8 +1405,8 @@ void QGL2PaintEngineEx::ensureActive() glViewport(0, 0, d->width, d->height); glDepthMask(false); glDepthFunc(GL_LESS); - setState(state()); d->needsSync = false; + setState(state()); } } @@ -1519,6 +1519,8 @@ void QGL2PaintEngineEx::clip(const QVectorPath &path, Qt::ClipOperation op) // qDebug("QGL2PaintEngineEx::clip()"); Q_D(QGL2PaintEngineEx); + ensureActive(); + if (op == Qt::ReplaceClip && !d->hasClipOperations()) op = Qt::IntersectClip; -- cgit v0.12