From ede3791df8330ed8daae6667d025ad40219a9f5f Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 18 Jul 2018 14:49:15 +0200 Subject: Move texture uploading out of QOpenGLTextureCache This way the logic can be reused elsewhere. At the same time a standard OpenGL ES/3 way of handling BGRA is added, so we don't depend on extensions, and handling of NPOT and max size which QSGTexture will need. Change-Id: I475bc7127f44be3964fdb482c9e86a20db1fbca5 Reviewed-by: Laszlo Agocs --- src/gui/opengl/qopenglpaintengine.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/gui/opengl/qopenglpaintengine.cpp') diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp index e390183893..5902713faa 100644 --- a/src/gui/opengl/qopenglpaintengine.cpp +++ b/src/gui/opengl/qopenglpaintengine.cpp @@ -263,7 +263,7 @@ GLuint QOpenGL2PaintEngineExPrivate::bindTexture(const QGradient &gradient) struct ImageWithBindOptions { const QImage ℑ - QOpenGLTextureCache::BindOptions options; + QOpenGLTextureUploader::BindOptions options; }; template<> @@ -1554,7 +1554,7 @@ void QOpenGL2PaintEngineEx::drawImage(const QRectF& dest, const QImage& image, c ensureActive(); d->transferMode(ImageDrawingMode); - QOpenGLTextureCache::BindOptions bindOption = QOpenGLTextureCache::PremultipliedAlphaBindOption; + QOpenGLTextureUploader::BindOptions bindOption = QOpenGLTextureUploader::PremultipliedAlphaBindOption; // Use specialized bind for formats we have specialized shaders for. switch (image.format()) { case QImage::Format_RGBA8888: @@ -1565,14 +1565,14 @@ void QOpenGL2PaintEngineEx::drawImage(const QRectF& dest, const QImage& image, c case QImage::Format_Alpha8: if (ctx->functions()->hasOpenGLFeature(QOpenGLFunctions::TextureRGFormats)) { d->shaderManager->setSrcPixelType(QOpenGLEngineShaderManager::AlphaImageSrc); - bindOption = QOpenGLTextureCache::UseRedFor8BitBindOption; + bindOption = QOpenGLTextureUploader::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; + bindOption = QOpenGLTextureUploader::UseRedFor8BitBindOption; } else d->shaderManager->setSrcPixelType(QOpenGLEngineShaderManager::ImageSrc); break; -- cgit v1.2.3