diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-06-15 08:47:51 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-06-15 10:02:32 (GMT) |
commit | ca57370d923cbda2f14380382d887ad5e003a040 (patch) | |
tree | 13e2f239c8235a3cfc1b690432f28076c2b061b5 /src/opengl | |
parent | d5750bbf85a234692261df24e99a1c4f427bf287 (diff) | |
download | Qt-ca57370d923cbda2f14380382d887ad5e003a040.zip Qt-ca57370d923cbda2f14380382d887ad5e003a040.tar.gz Qt-ca57370d923cbda2f14380382d887ad5e003a040.tar.bz2 |
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
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/qgraphicssystem_gl.cpp | 1 | ||||
-rw-r--r-- | src/opengl/qpixmapdata_gl.cpp | 3 | ||||
-rw-r--r-- | src/opengl/qwindowsurface_gl.cpp | 12 |
3 files changed, 15 insertions, 1 deletions
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 <private/qwindowsurface_raster_p.h> 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 <private/qpaintengineex_opengl2_p.h> +#ifndef QT_OPENGL_ES_2 +#include <private/qpaintengine_opengl_p.h> +#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(); } |