summaryrefslogtreecommitdiffstats
path: root/src/opengl/qwindowsurface_gl.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-05-13 08:01:40 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-05-13 08:24:39 (GMT)
commit98bb706b76936dfc88e8d38db39518a3cdf74b30 (patch)
tree12b404957a6a2b6a4d87cbfa7f7ddcd14e34e223 /src/opengl/qwindowsurface_gl.cpp
parent3822cd597fc481acb2a4de324c005c23ce8e78cd (diff)
downloadQt-98bb706b76936dfc88e8d38db39518a3cdf74b30.zip
Qt-98bb706b76936dfc88e8d38db39518a3cdf74b30.tar.gz
Qt-98bb706b76936dfc88e8d38db39518a3cdf74b30.tar.bz2
Enabled compilation of both GL and GL2 paint engine.
Compile both GL and GL2 paint engine on desktop, and choose between them at run-time based on GL version flags. Reviewed-by: Tom
Diffstat (limited to 'src/opengl/qwindowsurface_gl.cpp')
-rw-r--r--src/opengl/qwindowsurface_gl.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index 576da12..2f111f4 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -69,9 +69,10 @@
#include <private/qglpixelbuffer_p.h>
#include <private/qgraphicssystem_gl_p.h>
-#if 1 || defined(QT_OPENGL_ES_2)
+
#include <private/qpaintengineex_opengl2_p.h>
-#else
+
+#ifndef QT_OPENGL_ES_2
#include <private/qpaintengine_opengl_p.h>
#endif
@@ -292,17 +293,20 @@ void QGLWindowSurface::hijackWindow(QWidget *widget)
qDebug() << "hijackWindow() context created for" << widget << d_ptr->contexts.size();
}
-#if 1 || defined(QT_OPENGL_ES_2)
-Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_gl_window_surface_paintengine)
-#else
-Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_gl_window_surface_paintengine)
+Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_gl_window_surface_2_engine)
+
+#ifndef QT_OPENGL_ES_2
+Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_gl_window_surface_engine)
#endif
/*! \reimp */
QPaintEngine *QGLWindowSurface::paintEngine() const
{
#if !defined(QT_OPENGL_ES_2)
- return qt_gl_window_surface_paintengine();
+ if (qt_gl_preferGL2Engine())
+ return qt_gl_window_surface_2_engine();
+ else
+ return qt_gl_window_surface_engine();
#else
return 0;
#endif