summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-10-15 04:34:46 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-10-15 05:52:59 (GMT)
commitf4ad1cc44e3a25d0089d39cdf16820d9fbb2e050 (patch)
tree1d28d064b23b6591a32cb55dcf55e229e77f0a72 /src/opengl
parente49d92f620313c0921ece291548a8a9c6a809586 (diff)
downloadQt-f4ad1cc44e3a25d0089d39cdf16820d9fbb2e050.zip
Qt-f4ad1cc44e3a25d0089d39cdf16820d9fbb2e050.tar.gz
Qt-f4ad1cc44e3a25d0089d39cdf16820d9fbb2e050.tar.bz2
Centralize all GL paint engine creations into qt_qgl_paint_engine()
The qt_qgl_paint_engine() function was being used by QWS, but there's no reason why it can't be used by other platforms too. This should also fix ES 2.0 paint engine support under QWS, which was stubbed out. Reviewed-by: Sarah Smith Reviewed-by: Gunnar
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qgl.cpp22
-rw-r--r--src/opengl/qgl_p.h4
-rw-r--r--src/opengl/qglpaintdevice_qws.cpp4
-rw-r--r--src/opengl/qwindowsurface_gl.cpp12
4 files changed, 10 insertions, 32 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 8aef8b4..5e00b11 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -4735,16 +4735,19 @@ Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_gl_2_engine)
Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_gl_engine)
#endif
-#ifdef Q_WS_QWS
Q_OPENGL_EXPORT QPaintEngine* qt_qgl_paint_engine()
{
-#if !defined(QT_OPENGL_ES_2)
+#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL)
return qt_gl_engine();
+#elif defined(QT_OPENGL_ES_2)
+ return qt_gl_2_engine();
#else
- return 0; // XXX
+ if (qt_gl_preferGL2Engine())
+ return qt_gl_2_engine();
+ else
+ return qt_gl_engine();
#endif
}
-#endif
/*!
\internal
@@ -4754,16 +4757,7 @@ Q_OPENGL_EXPORT QPaintEngine* qt_qgl_paint_engine()
*/
QPaintEngine *QGLWidget::paintEngine() const
{
-#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL)
- return qt_gl_engine();
-#elif defined(QT_OPENGL_ES_2)
- return qt_gl_2_engine();
-#else
- if (qt_gl_preferGL2Engine())
- return qt_gl_2_engine();
- else
- return qt_gl_engine();
-#endif
+ return qt_qgl_paint_engine();
}
#ifdef QT3_SUPPORT
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index 8d4f673..129e7f7 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -505,9 +505,7 @@ private:
};
-#ifdef Q_WS_QWS
-extern QPaintEngine* qt_qgl_paint_engine();
-#endif
+extern Q_OPENGL_EXPORT QPaintEngine* qt_qgl_paint_engine();
bool qt_gl_preferGL2Engine();
diff --git a/src/opengl/qglpaintdevice_qws.cpp b/src/opengl/qglpaintdevice_qws.cpp
index 600efa6..8c2f27d 100644
--- a/src/opengl/qglpaintdevice_qws.cpp
+++ b/src/opengl/qglpaintdevice_qws.cpp
@@ -72,11 +72,7 @@ QWSGLPaintDevice::~QWSGLPaintDevice()
QPaintEngine* QWSGLPaintDevice::paintEngine() const
{
-#if !defined(QT_OPENGL_ES_2)
return qt_qgl_paint_engine();
-#else
- return 0; // XXX
-#endif
}
int QWSGLPaintDevice::metric(PaintDeviceMetric m) const
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index 7f8577a..b341243 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -283,19 +283,9 @@ int QGLWindowSurfaceGLPaintDevice::metric(PaintDeviceMetric m) const
return d->q_ptr->window()->metric(m);
}
-Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_gl_window_surface_2_engine)
-
-#if !defined (QT_OPENGL_ES_2)
-Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_gl_window_surface_engine)
-#endif
-
QPaintEngine *QGLWindowSurfaceGLPaintDevice::paintEngine() const
{
-#if !defined(QT_OPENGL_ES_2)
- if (!qt_gl_preferGL2Engine())
- return qt_gl_window_surface_engine();
-#endif
- return qt_gl_window_surface_2_engine();
+ return qt_qgl_paint_engine();
}
QGLWindowSurface::QGLWindowSurface(QWidget *window)