summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopenglfunctions.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2014-08-04 11:47:11 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2014-10-27 11:54:39 +0100
commit5adbb9cc576546c42249099e549f1947cca54610 (patch)
tree0454a5e9ff21651fe4bc1fac6ab7424914d53a3e /src/gui/opengl/qopenglfunctions.cpp
parentda72e5538ebcc7e6008d0c4b3538d2a994f02a7e (diff)
Support Alpha8 and Grayscale8 natively in the OpenGL paint engine
Adds special shaders for the Alpha8 and Grayscale8 formats so that they do not need to rely on the support of GL_ALPHA and GL_LUMINANCE that has been removed from core in recent OpenGL versions. Change-Id: Ie370379b458abf2a50e252bc5099aefc1b11fb1d Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/gui/opengl/qopenglfunctions.cpp')
-rw-r--r--src/gui/opengl/qopenglfunctions.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp
index 44b56699df..67b978a570 100644
--- a/src/gui/opengl/qopenglfunctions.cpp
+++ b/src/gui/opengl/qopenglfunctions.cpp
@@ -173,6 +173,7 @@ QT_BEGIN_NAMESPACE
\value NPOTTextures Non power of two textures are available.
\value NPOTTextureRepeat Non power of two textures can use GL_REPEAT as wrap parameter.
\value FixedFunctionPipeline The fixed function pipeline is available.
+ \value TextureRGFormats The GL_RED and GL_RG texture formats are available.
*/
// Hidden private fields for additional extension data.
@@ -284,10 +285,12 @@ static int qt_gl_resolve_features()
if (extensions.match("GL_OES_texture_npot"))
features |= QOpenGLFunctions::NPOTTextures |
QOpenGLFunctions::NPOTTextureRepeat;
+ if (ctx->format().majorVersion() >= 3 || extensions.match("GL_EXT_texture_rg"))
+ features |= QOpenGLFunctions::TextureRGFormats;
return features;
} else {
// OpenGL
- int features = 0;
+ int features = QOpenGLFunctions::TextureRGFormats;
QSurfaceFormat format = QOpenGLContext::currentContext()->format();
QOpenGLExtensionMatcher extensions;