diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-08-16 12:53:04 +0200 |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2011-08-16 15:44:26 +0200 |
commit | 0d5170256c1658b0f6e0d3f6c736de01655b29d8 (patch) | |
tree | 79f6252ffbda9eeb1ce54fc9987618fdc7e58be2 /src/opengl/qglframebufferobject.cpp | |
parent | 06f6b71ba43e8302d61d2c3cb7118d9dbf7a3c98 (diff) |
Get rid of OpenGL 1.x engine and platform code from QtOpenGL.
Change-Id: I646b8e26d5e7214432a044866764d57cc11b2390
Reviewed-on: http://codereview.qt.nokia.com/3006
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'src/opengl/qglframebufferobject.cpp')
-rw-r--r-- | src/opengl/qglframebufferobject.cpp | 110 |
1 files changed, 3 insertions, 107 deletions
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 8068410dc1..f35f6e513d 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -45,13 +45,7 @@ #include <qdebug.h> #include <private/qgl_p.h> #include <private/qfont_p.h> -#if !defined(QT_OPENGL_ES_1) #include <private/qpaintengineex_opengl2_p.h> -#endif - -#ifndef QT_OPENGL_ES_2 -#include <private/qpaintengine_opengl_p.h> -#endif #include <qglframebufferobject.h> #include <qlibrary.h> @@ -306,22 +300,6 @@ GLenum QGLFramebufferObjectFormat::internalTextureFormat() const return d->internal_format; } -#ifdef Q_MAC_COMPAT_GL_FUNCTIONS -/*! \internal */ -void QGLFramebufferObjectFormat::setTextureTarget(QMacCompatGLenum target) -{ - detach(); - d->target = target; -} - -/*! \internal */ -void QGLFramebufferObjectFormat::setInternalTextureFormat(QMacCompatGLenum internalTextureFormat) -{ - detach(); - d->internal_format = internalTextureFormat; -} -#endif - /*! Returns true if all the options of this framebuffer object format are the same as \a other; otherwise returns false. @@ -720,8 +698,7 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz, As of Qt 4.8, it's possible to draw into a QGLFramebufferObject using a QPainter in a separate thread. Note that OpenGL 2.0 or - OpenGL ES 2.0 is required for this to work. Also, under X11, it's - necessary to set the Qt::AA_X11InitThreads application attribute. + OpenGL ES 2.0 is required for this to work. \sa {Framebuffer Object Example} */ @@ -780,16 +757,6 @@ QGLFramebufferObject::QGLFramebufferObject(const QSize &size, GLenum target) d->init(this, size, NoAttachment, target, DEFAULT_FORMAT); } -#ifdef Q_MAC_COMPAT_GL_FUNCTIONS -/*! \internal */ -QGLFramebufferObject::QGLFramebufferObject(const QSize &size, QMacCompatGLenum target) - : d_ptr(new QGLFramebufferObjectPrivate) -{ - Q_D(QGLFramebufferObject); - d->init(this, size, NoAttachment, target, DEFAULT_FORMAT); -} -#endif - /*! \overload Constructs an OpenGL framebuffer object and binds a 2D GL texture @@ -832,16 +799,6 @@ QGLFramebufferObject::QGLFramebufferObject(int width, int height, const QGLFrame format.internalTextureFormat(), format.samples(), format.mipmap()); } -#ifdef Q_MAC_COMPAT_GL_FUNCTIONS -/*! \internal */ -QGLFramebufferObject::QGLFramebufferObject(int width, int height, QMacCompatGLenum target) - : d_ptr(new QGLFramebufferObjectPrivate) -{ - Q_D(QGLFramebufferObject); - d->init(this, QSize(width, height), NoAttachment, target, DEFAULT_FORMAT); -} -#endif - /*! \overload Constructs an OpenGL framebuffer object and binds a texture to the @@ -863,17 +820,6 @@ QGLFramebufferObject::QGLFramebufferObject(int width, int height, Attachment att d->init(this, QSize(width, height), attachment, target, internal_format); } -#ifdef Q_MAC_COMPAT_GL_FUNCTIONS -/*! \internal */ -QGLFramebufferObject::QGLFramebufferObject(int width, int height, Attachment attachment, - QMacCompatGLenum target, QMacCompatGLenum internal_format) - : d_ptr(new QGLFramebufferObjectPrivate) -{ - Q_D(QGLFramebufferObject); - d->init(this, QSize(width, height), attachment, target, internal_format); -} -#endif - /*! \overload Constructs an OpenGL framebuffer object and binds a texture to the @@ -895,17 +841,6 @@ QGLFramebufferObject::QGLFramebufferObject(const QSize &size, Attachment attachm d->init(this, size, attachment, target, internal_format); } -#ifdef Q_MAC_COMPAT_GL_FUNCTIONS -/*! \internal */ -QGLFramebufferObject::QGLFramebufferObject(const QSize &size, Attachment attachment, - QMacCompatGLenum target, QMacCompatGLenum internal_format) - : d_ptr(new QGLFramebufferObjectPrivate) -{ - Q_D(QGLFramebufferObject); - d->init(this, size, attachment, target, internal_format); -} -#endif - /*! \fn QGLFramebufferObject::~QGLFramebufferObject() @@ -1092,13 +1027,7 @@ QImage QGLFramebufferObject::toImage() const return image; } -#if !defined(QT_OPENGL_ES_1) Q_GLOBAL_STATIC(QGLEngineThreadStorage<QGL2PaintEngineEx>, qt_buffer_2_engine) -#endif - -#ifndef QT_OPENGL_ES_2 -Q_GLOBAL_STATIC(QGLEngineThreadStorage<QOpenGLPaintEngine>, qt_buffer_engine) -#endif /*! \reimp */ QPaintEngine *QGLFramebufferObject::paintEngine() const @@ -1107,29 +1036,12 @@ QPaintEngine *QGLFramebufferObject::paintEngine() const if (d->engine) return d->engine; -#if !defined(QT_OPENGL_ES_1) -#if !defined (QT_OPENGL_ES_2) - if (qt_gl_preferGL2Engine()) { -#endif - QPaintEngine *engine = qt_buffer_2_engine()->engine(); - if (engine->isActive() && engine->paintDevice() != this) { - d->engine = new QGL2PaintEngineEx; - return d->engine; - } - return engine; -#if !defined (QT_OPENGL_ES_2) - } -#endif -#endif - -#if !defined(QT_OPENGL_ES_2) - QPaintEngine *engine = qt_buffer_engine()->engine(); + QPaintEngine *engine = qt_buffer_2_engine()->engine(); if (engine->isActive() && engine->paintDevice() != this) { - d->engine = new QOpenGLPaintEngine; + d->engine = new QGL2PaintEngineEx; return d->engine; } return engine; -#endif } /*! @@ -1189,14 +1101,6 @@ void QGLFramebufferObject::drawTexture(const QRectF &target, GLuint textureId, G const_cast<QGLContext *>(QGLContext::currentContext())->drawTexture(target, textureId, textureTarget); } -#ifdef Q_MAC_COMPAT_GL_FUNCTIONS -/*! \internal */ -void QGLFramebufferObject::drawTexture(const QRectF &target, QMacCompatGLuint textureId, QMacCompatGLenum textureTarget) -{ - const_cast<QGLContext *>(QGLContext::currentContext())->drawTexture(target, textureId, textureTarget); -} -#endif - /*! \since 4.4 @@ -1212,14 +1116,6 @@ void QGLFramebufferObject::drawTexture(const QPointF &point, GLuint textureId, G const_cast<QGLContext *>(QGLContext::currentContext())->drawTexture(point, textureId, textureTarget); } -#ifdef Q_MAC_COMPAT_GL_FUNCTIONS -/*! \internal */ -void QGLFramebufferObject::drawTexture(const QPointF &point, QMacCompatGLuint textureId, QMacCompatGLenum textureTarget) -{ - const_cast<QGLContext *>(QGLContext::currentContext())->drawTexture(point, textureId, textureTarget); -} -#endif - /*! \reimp */ int QGLFramebufferObject::metric(PaintDeviceMetric metric) const { |