summaryrefslogtreecommitdiffstats
path: root/src/opengl/qpixmapdata_x11gl_egl.cpp
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-02-01 01:41:07 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-02-01 01:41:07 (GMT)
commit7e85c6dc7ba0aaa6dfcad40dc0e9df0e2adb3741 (patch)
tree07e839b8dd88c381471b96917ef5aafa484233b1 /src/opengl/qpixmapdata_x11gl_egl.cpp
parent6e8feab83fa9303b1345f4a27478ba3ee0316e86 (diff)
parent5cf8677758e6fbfa5bf360c73519c14630db808c (diff)
downloadQt-7e85c6dc7ba0aaa6dfcad40dc0e9df0e2adb3741.zip
Qt-7e85c6dc7ba0aaa6dfcad40dc0e9df0e2adb3741.tar.gz
Qt-7e85c6dc7ba0aaa6dfcad40dc0e9df0e2adb3741.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Conflicts: src/declarative/util/qmlpixmapcache.cpp
Diffstat (limited to 'src/opengl/qpixmapdata_x11gl_egl.cpp')
-rw-r--r--src/opengl/qpixmapdata_x11gl_egl.cpp51
1 files changed, 45 insertions, 6 deletions
diff --git a/src/opengl/qpixmapdata_x11gl_egl.cpp b/src/opengl/qpixmapdata_x11gl_egl.cpp
index a5e0239..55aa1d0 100644
--- a/src/opengl/qpixmapdata_x11gl_egl.cpp
+++ b/src/opengl/qpixmapdata_x11gl_egl.cpp
@@ -39,10 +39,19 @@
**
****************************************************************************/
+#include <QDebug>
+
#include <private/qgl_p.h>
#include <private/qegl_p.h>
#include <private/qeglproperties_p.h>
+
+#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
#include <private/qpaintengineex_opengl2_p.h>
+#endif
+
+#ifndef QT_OPENGL_ES_2
+#include <private/qpaintengine_opengl_p.h>
+#endif
#include "qpixmapdata_x11gl_p.h"
@@ -187,7 +196,14 @@ QX11GLPixmapData::~QX11GLPixmapData()
{
}
-static QGL2PaintEngineEx* qt_gl2_engine_for_pixmaps = 0;
+#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
+Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_gl_pixmap_2_engine)
+#endif
+
+#ifndef QT_OPENGL_ES_2
+Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_gl_pixmap_engine)
+#endif
+
QPaintEngine* QX11GLPixmapData::paintEngine() const
{
@@ -202,18 +218,41 @@ QPaintEngine* QX11GLPixmapData::paintEngine() const
: qPixmapRGBSharedEglContext);
}
- if (!qt_gl2_engine_for_pixmaps)
- qt_gl2_engine_for_pixmaps = new QGL2PaintEngineEx();
+ QPaintEngine* engine;
+
+#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL)
+ engine = qt_gl_pixmap_engine();
+#elif defined(QT_OPENGL_ES_2)
+ engine = qt_gl_pixmap_2_engine();
+#else
+ if (qt_gl_preferGL2Engine())
+ engine = qt_gl_pixmap_2_engine();
+ else
+ engine = qt_gl_pixmap_engine();
+#endif
+
+
// Support multiple painters on multiple pixmaps simultaniously
- if (qt_gl2_engine_for_pixmaps->isActive()) {
+ if (engine->isActive()) {
qWarning("Pixmap paint engine already active");
- QPaintEngine* engine = new QGL2PaintEngineEx();
+
+#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL)
+ engine = new QOpenGLPaintEngine;
+#elif defined(QT_OPENGL_ES_2)
+ engine = new QGL2PaintEngineEx;
+#else
+ if (qt_gl_preferGL2Engine())
+ engine = new QGL2PaintEngineEx;
+ else
+ engine = new QOpenGLPaintEngine;
+#endif
+
engine->setAutoDestruct(true);
return engine;
}
- return qt_gl2_engine_for_pixmaps;
+ return engine;
}
void QX11GLPixmapData::beginPaint()