Fix compilation on OSX 10.6
authorSean Harmer <sean.harmer@kdab.com>
Mon, 20 Aug 2012 20:09:48 +0000 (21:09 +0100)
committerQt by Nokia <qt-info@nokia.com>
Tue, 21 Aug 2012 15:30:07 +0000 (17:30 +0200)
OS X 10.6 does not support the GL_ARB_framebuffer_sRGB extension.

Change-Id: Ifea8eaf3ffca6242d908538afeb983131a113c73
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
src/quick/scenegraph/qsgdefaultglyphnode_p.cpp

index 6616173..27339ab 100644 (file)
@@ -128,7 +128,7 @@ void QSGTextMaskMaterialData::activate()
     QSGMaterialShader::activate();
     glBlendFunc(GL_CONSTANT_COLOR, GL_ONE_MINUS_SRC_COLOR);
 
-#if !defined(QT_OPENGL_ES_2)
+#if !defined(QT_OPENGL_ES_2) && defined(GL_ARB_framebuffer_sRGB)
     // 0.25 was found to be acceptable error margin by experimentation. On Mac, the gamma is 2.0,
     // but using sRGB looks okay.
     if (qAbs(fontSmoothingGamma() - 2.2) < 0.25)
@@ -141,7 +141,7 @@ void QSGTextMaskMaterialData::deactivate()
     QSGMaterialShader::deactivate();
     glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
 
-#if !defined(QT_OPENGL_ES_2)
+#if !defined(QT_OPENGL_ES_2) && defined(GL_ARB_framebuffer_sRGB)
     if (qAbs(fontSmoothingGamma() - 2.2) < 0.25)
         glDisable(GL_FRAMEBUFFER_SRGB);
 #endif