diff options
Diffstat (limited to 'src/gui/opengl/qopenglpaintengine.cpp')
| -rw-r--r-- | src/gui/opengl/qopenglpaintengine.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp index 834aed91421..bfc08a53321 100644 --- a/src/gui/opengl/qopenglpaintengine.cpp +++ b/src/gui/opengl/qopenglpaintengine.cpp @@ -1423,6 +1423,20 @@ void QOpenGL2PaintEngineEx::drawImage(const QRectF& dest, const QImage& image, c d->shaderManager->setSrcPixelType(QOpenGLEngineShaderManager::NonPremultipliedImageSrc); bindOption = 0; break; + case QImage::Format_Alpha8: + if (ctx->functions()->hasOpenGLFeature(QOpenGLFunctions::TextureRGFormats)) { + d->shaderManager->setSrcPixelType(QOpenGLEngineShaderManager::AlphaImageSrc); + bindOption = QOpenGLTextureCache::UseRedFor8BitBindOption; + } else + d->shaderManager->setSrcPixelType(QOpenGLEngineShaderManager::ImageSrc); + break; + case QImage::Format_Grayscale8: + if (ctx->functions()->hasOpenGLFeature(QOpenGLFunctions::TextureRGFormats)) { + d->shaderManager->setSrcPixelType(QOpenGLEngineShaderManager::GrayscaleImageSrc); + bindOption = QOpenGLTextureCache::UseRedFor8BitBindOption; + } else + d->shaderManager->setSrcPixelType(QOpenGLEngineShaderManager::ImageSrc); + break; default: d->shaderManager->setSrcPixelType(QOpenGLEngineShaderManager::ImageSrc); break; |
