From ca57370d923cbda2f14380382d887ad5e003a040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 15 Jun 2009 10:47:51 +0200 Subject: Re-enabled GL pixmap backend and window surface to work without GL2. GL window surface and GL pixmap backend should work with old GL engine as well, though not supported to the same degree. Reviewed-by: Trond --- src/opengl/qgraphicssystem_gl.cpp | 1 + src/opengl/qpixmapdata_gl.cpp | 3 ++- src/opengl/qwindowsurface_gl.cpp | 12 ++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/opengl/qgraphicssystem_gl.cpp b/src/opengl/qgraphicssystem_gl.cpp index ce8ad7a..a75f3a5 100644 --- a/src/opengl/qgraphicssystem_gl.cpp +++ b/src/opengl/qgraphicssystem_gl.cpp @@ -44,6 +44,7 @@ #include "private/qpixmap_raster_p.h" #include "private/qpixmapdata_gl_p.h" #include "private/qwindowsurface_gl_p.h" +#include "private/qgl_p.h" #include QT_BEGIN_NAMESPACE diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp index 48feb82..e641d2c 100644 --- a/src/opengl/qpixmapdata_gl.cpp +++ b/src/opengl/qpixmapdata_gl.cpp @@ -398,7 +398,8 @@ static TextureBuffer createTextureBuffer(const QSize &size, QGL2PaintEngineEx *e bool QGLPixmapData::useFramebufferObjects() { return QGLFramebufferObject::hasOpenGLFramebufferObjects() - && QGLFramebufferObject::hasOpenGLFramebufferBlit(); + && QGLFramebufferObject::hasOpenGLFramebufferBlit() + && qt_gl_preferGL2Engine(); } QPaintEngine* QGLPixmapData::paintEngine() const diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index 01974a2..cdfaa3c 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -72,6 +72,10 @@ #include +#ifndef QT_OPENGL_ES_2 +#include +#endif + #ifndef GLX_ARB_multisample #define GLX_SAMPLE_BUFFERS_ARB 100000 #define GLX_SAMPLES_ARB 100001 @@ -315,9 +319,17 @@ void QGLWindowSurface::hijackWindow(QWidget *widget) 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 + /*! \reimp */ QPaintEngine *QGLWindowSurface::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(); } -- cgit v0.12