aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@digia.com>2013-11-14 11:43:02 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-18 15:53:57 +0100
commit2991947c31b4abd9b1be099d27ecba58b4a2b5ea (patch)
tree7edb418acd94d4a55effd27f2360b898a24cfa60
parent95d35ab188665281f54095e52948c9aad08e364d (diff)
Make use of GL_APPLE_texture_format_BGRA8888.
Texture uploads on iOS is extremly slow without it. Change-Id: Icccd542b8122c7bfa0e839c25e988d107bc17d2a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
-rw-r--r--src/quick/scenegraph/util/qsgatlastexture.cpp5
-rw-r--r--src/quick/scenegraph/util/qsgtexture.cpp5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/quick/scenegraph/util/qsgatlastexture.cpp b/src/quick/scenegraph/util/qsgatlastexture.cpp
index 2bc106a025..8678d106ff 100644
--- a/src/quick/scenegraph/util/qsgatlastexture.cpp
+++ b/src/quick/scenegraph/util/qsgatlastexture.cpp
@@ -149,6 +149,11 @@ Atlas::Atlas(const QSize &size)
|| strstr(ext, "GL_EXT_texture_format_BGRA8888")
|| strstr(ext, "GL_IMG_texture_format_BGRA8888")) {
m_internalFormat = m_externalFormat = GL_BGRA;
+#ifdef Q_OS_IOS
+ } else if (strstr(ext, "GL_APPLE_texture_format_BGRA8888")) {
+ m_internalFormat = GL_RGBA;
+ m_externalFormat = GL_BGRA;
+#endif
} else {
m_internalFormat = m_externalFormat = GL_RGBA;
}
diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp
index ddee887bd1..abf3002803 100644
--- a/src/quick/scenegraph/util/qsgtexture.cpp
+++ b/src/quick/scenegraph/util/qsgtexture.cpp
@@ -692,6 +692,11 @@ void QSGPlainTexture::bind()
|| context->hasExtension(QByteArrayLiteral("GL_IMG_texture_format_BGRA8888"))) {
externalFormat = GL_BGRA;
internalFormat = GL_BGRA;
+#ifdef Q_OS_IOS
+ } else if (strstr(extensions, "GL_APPLE_texture_format_BGRA8888")) {
+ externalFormat = GL_BGRA;
+ internalFormat = GL_RGBA;
+#endif
} else {
qsg_swizzleBGRAToRGBA(&tmp);
}