aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/util/qsgtexture.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-02-03 17:36:55 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-18 21:00:00 +0100
commita2e92f6dee12320a58a4bcc95c14649b27804427 (patch)
tree3198365f9f7ca75cc3c4bd23340bb5fe15ee63a5 /src/quick/scenegraph/util/qsgtexture.cpp
parent337524714cad51934879d817564c5d58e6dbd0c0 (diff)
Dynamic GL in Quick
The counterpart to I716fdebb. Implements the dynamic path in scenegraph. Task-number: QTBUG-36483 Change-Id: I2dc613ba84560b7b8e36d3cd1da61c050ab08db0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/quick/scenegraph/util/qsgtexture.cpp')
-rw-r--r--src/quick/scenegraph/util/qsgtexture.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp
index 3bbcb0c112..d9e29f6ec0 100644
--- a/src/quick/scenegraph/util/qsgtexture.cpp
+++ b/src/quick/scenegraph/util/qsgtexture.cpp
@@ -39,8 +39,6 @@
**
****************************************************************************/
-#define GL_GLEXT_PROTOTYPES
-
#include "qsgtexture_p.h"
#include <qopenglfunctions.h>
#include <QtQuick/private/qsgcontext_p.h>
@@ -83,7 +81,7 @@ static QElapsedTimer qsg_renderer_timer;
QT_BEGIN_NAMESPACE
-#if !defined(QT_NO_DEBUG) && defined(QT_OPENGL_ES_2)
+#ifndef QT_NO_DEBUG
inline static bool isPowerOfTwo(int x)
{
// Assumption: x >= 1
@@ -514,7 +512,7 @@ void QSGTexture::updateBindOptions(bool force)
}
if (force || d->wrapChanged) {
-#if !defined(QT_NO_DEBUG) && defined(QT_OPENGL_ES_2)
+#ifndef QT_NO_DEBUG
if (d->horizontalWrap == Repeat || d->verticalWrap == Repeat) {
bool npotSupported = QOpenGLFunctions(QOpenGLContext::currentContext()).hasOpenGLFeature(QOpenGLFunctions::NPOTTextures);
QSize size = textureSize();
@@ -686,7 +684,10 @@ void QSGPlainTexture::bind()
externalFormat = GL_BGRA;
#ifdef QT_OPENGL_ES
internalFormat = GL_BGRA;
-#endif
+#else
+ if (context->isES())
+ internalFormat = GL_BGRA;
+#endif // QT_OPENGL_ES
} else if (!wrongfullyReportsBgra8888Support
&& (context->hasExtension(QByteArrayLiteral("GL_EXT_texture_format_BGRA8888"))
|| context->hasExtension(QByteArrayLiteral("GL_IMG_texture_format_BGRA8888")))) {