diff options
Diffstat (limited to 'src/gui/opengl/qopengltexturecache.cpp')
-rw-r--r-- | src/gui/opengl/qopengltexturecache.cpp | 16 |
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; } |