summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpaintengine.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-05-29 12:00:45 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-05-29 14:10:24 (GMT)
commit07fbbf76bef1845bb6c490b15a0b7caabf23d888 (patch)
tree34adda17d7bc6ce199fa62de032c44dd14e962e9 /src/gui/painting/qpaintengine.cpp
parenta322d3faacdb8e5a8649b478b3eaa8aa03d789d6 (diff)
downloadQt-07fbbf76bef1845bb6c490b15a0b7caabf23d888.zip
Qt-07fbbf76bef1845bb6c490b15a0b7caabf23d888.tar.gz
Qt-07fbbf76bef1845bb6c490b15a0b7caabf23d888.tar.bz2
Made GL2 engine default for QGLWidget, and added GL2 sync() function
To allow mixing QPainter and raw OpenGL commands we need to have some way for the user to say that's he's about to use raw OpenGL so that we are free to do buffering optimizations in the paint engines and use either GL1 or GL2 paint engine. As there's already a syncState() function in QPaintEngine we've reused this and added QPaintEngineEx::sync() which takes care of syncing/flushing the paint engine. Reviewed-by: Trond
Diffstat (limited to 'src/gui/painting/qpaintengine.cpp')
-rw-r--r--src/gui/painting/qpaintengine.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/painting/qpaintengine.cpp b/src/gui/painting/qpaintengine.cpp
index 7de1ec4..9859425 100644
--- a/src/gui/painting/qpaintengine.cpp
+++ b/src/gui/painting/qpaintengine.cpp
@@ -49,6 +49,7 @@
#include <private/qtextengine_p.h>
#include <qvarlengtharray.h>
#include <private/qfontengine_p.h>
+#include <private/qpaintengineex_p.h>
QT_BEGIN_NAMESPACE
@@ -302,6 +303,9 @@ void QPaintEngine::syncState()
{
Q_ASSERT(state);
updateState(*state);
+
+ if (isExtended())
+ static_cast<QPaintEngineEx *>(this)->sync();
}
static QPaintEngine *qt_polygon_recursion = 0;