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>
This commit is contained in:
Gunnar Sletta 2013-11-14 11:43:02 +01:00 committed by The Qt Project
parent 95d35ab188
commit 2991947c31
2 changed files with 10 additions and 0 deletions

View File

@ -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;
}

View File

@ -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);
}