diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-05-13 08:01:40 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-05-13 08:24:39 (GMT) |
commit | 98bb706b76936dfc88e8d38db39518a3cdf74b30 (patch) | |
tree | 12b404957a6a2b6a4d87cbfa7f7ddcd14e34e223 /src/opengl/qglpixelbuffer.cpp | |
parent | 3822cd597fc481acb2a4de324c005c23ce8e78cd (diff) | |
download | Qt-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/qglpixelbuffer.cpp')
-rw-r--r-- | src/opengl/qglpixelbuffer.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/opengl/qglpixelbuffer.cpp b/src/opengl/qglpixelbuffer.cpp index 6a207c8..cb24177 100644 --- a/src/opengl/qglpixelbuffer.cpp +++ b/src/opengl/qglpixelbuffer.cpp @@ -81,15 +81,15 @@ #include <private/qglpixelbuffer_p.h> #include <qimage.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 QT_BEGIN_NAMESPACE -#if 0 && !defined(QT_OPENGL_ES_2) +#if !defined(QT_OPENGL_ES_2) extern void qgl_cleanup_glyph_cache(QGLContext *); #else void qgl_cleanup_glyph_cache(QGLContext *) {} @@ -365,17 +365,20 @@ bool QGLPixelBuffer::isValid() const return !d->invalid; } -#if 1 || defined(QT_OPENGL_ES_2) -Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_buffer_paintengine) -#else -Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_buffer_paintengine) +Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_buffer_2_engine) + +#ifndef QT_OPENGL_ES_2 +Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_buffer_engine) #endif /*! \reimp */ QPaintEngine *QGLPixelBuffer::paintEngine() const { #if !defined(QT_OPENGL_ES_2) - return qt_buffer_paintengine(); + if (qt_gl_preferGL2Engine()) + return qt_buffer_2_engine(); + else + return qt_buffer_engine(); #else return 0; #endif |