diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-08-22 10:49:28 +0200 |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-08-29 10:25:24 +0200 |
commit | 6e28e8441b698c3397c2c78125c877f2e9867cb1 (patch) | |
tree | 1e3ad0e43cb775854835817cd04bdc8b5e047e15 /src/opengl/qgl.cpp | |
parent | aaa4a26f82f99fa8724841eba91bad029306e0ce (diff) |
Copy core GL functionality to QtGui with QGL -> QOpenGL naming.
Change-Id: Ibc989afa4a30dd184d41d1a1cd89f97196e48855
Reviewed-on: http://codereview.qt.nokia.com/3710
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Diffstat (limited to 'src/opengl/qgl.cpp')
-rw-r--r-- | src/opengl/qgl.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index f51882841b..a78c602701 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -55,7 +55,7 @@ #include "gl2paintengineex/qpaintengineex_opengl2_p.h" -#include <QtGui/QPlatformGLContext> +#include <QtGui/QPlatformOpenGLContext> #include <qglpixelbuffer.h> #include <qglframebufferobject.h> @@ -1501,11 +1501,15 @@ const QGLContext *qt_gl_transfer_context(const QGLContext *ctx) QGLContextPrivate::QGLContextPrivate(QGLContext *context) : internal_context(false) , q_ptr(context) + , texture_destroyer(0) , functions(0) { group = new QGLContextGroup(context); - texture_destroyer = new QGLTextureDestroyer; - texture_destroyer->moveToThread(qApp->thread()); + + if (qApp) { + texture_destroyer = new QGLTextureDestroyer; + texture_destroyer->moveToThread(qApp->thread()); + } } QGLContextPrivate::~QGLContextPrivate() @@ -1605,7 +1609,7 @@ static void convertFromGLImage(QImage &img, int w, int h, bool alpha_format, boo img = img.mirrored(); } -Q_OPENGL_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha) +QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha) { QImage img(size, (alpha_format && include_alpha) ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32); @@ -3076,8 +3080,8 @@ void QGLContext::setInitialized(bool on) const QGLContext* QGLContext::currentContext() { - if (const QGuiGLContext *threadContext = QGuiGLContext::currentContext()) { - return QGLContext::fromGuiGLContext(const_cast<QGuiGLContext *>(threadContext)); + if (const QOpenGLContext *threadContext = QOpenGLContext::currentContext()) { + return QGLContext::fromOpenGLContext(const_cast<QOpenGLContext *>(threadContext)); } return 0; } @@ -4664,7 +4668,7 @@ void QGLWidget::drawTexture(const QPointF &point, GLuint textureId, GLenum textu Q_GLOBAL_STATIC(QGLEngineThreadStorage<QGL2PaintEngineEx>, qt_gl_2_engine) -Q_OPENGL_EXPORT QPaintEngine* qt_qgl_paint_engine() +QPaintEngine* qt_qgl_paint_engine() { return qt_gl_2_engine()->engine(); } @@ -4934,12 +4938,12 @@ void QGLWidgetPrivate::initContext(QGLContext *context, const QGLWidget* shareWi Q_GLOBAL_STATIC(QString, qt_gl_lib_name) -Q_OPENGL_EXPORT void qt_set_gl_library_name(const QString& name) +void qt_set_gl_library_name(const QString& name) { qt_gl_lib_name()->operator=(name); } -Q_OPENGL_EXPORT const QString qt_gl_library_name() +const QString qt_gl_library_name() { if (qt_gl_lib_name()->isNull()) { # if defined(QT_OPENGL_ES_2) |