summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopengltexturecache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/opengl/qopengltexturecache.cpp')
-rw-r--r--src/gui/opengl/qopengltexturecache.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gui/opengl/qopengltexturecache.cpp b/src/gui/opengl/qopengltexturecache.cpp
index 055974d5a4..f60d273361 100644
--- a/src/gui/opengl/qopengltexturecache.cpp
+++ b/src/gui/opengl/qopengltexturecache.cpp
@@ -281,6 +281,22 @@ GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, qint64 key, con
pixelType = GL_UNSIGNED_BYTE;
targetFormat = image.format();
break;
+ case QImage::Format_Alpha8:
+ if (context->isOpenGLES() || context->format().profile() != QSurfaceFormat::CoreProfile) {
+ externalFormat = internalFormat = GL_ALPHA;
+ pixelType = GL_UNSIGNED_BYTE;
+ targetFormat = image.format();
+ }
+ // ### add support for core profiles.
+ break;
+ case QImage::Format_Grayscale8:
+ if (context->isOpenGLES() || context->format().profile() != QSurfaceFormat::CoreProfile) {
+ externalFormat = internalFormat = GL_LUMINANCE;
+ pixelType = GL_UNSIGNED_BYTE;
+ targetFormat = image.format();
+ }
+ // ### add support for core profiles.
+ break;
default:
break;
}