Index: src/gpu/gl/GrGLCaps.cpp |
=================================================================== |
--- src/gpu/gl/GrGLCaps.cpp (revision 9423) |
+++ src/gpu/gl/GrGLCaps.cpp (working copy) |
@@ -161,10 +161,18 @@ |
ctxInfo.hasExtension("GL_ARB_texture_storage") || |
ctxInfo.hasExtension("GL_EXT_texture_storage"); |
- // ARB_texture_rg is part of OpenGL 3.0 |
+ // ARB_texture_rg is part of OpenGL 3.0, but mesa doesn't support it if |
+ // it doesn't have ARB_texture_rg extension. |
if (kDesktop_GrGLBinding == binding) { |
+ const GrGLubyte* verUByte; |
+ GR_GL_CALL_RET(gli, verUByte, GetString(GR_GL_VERSION)); |
+ const char* ver = reinterpret_cast<const char*>(verUByte); |
+ if (NULL != strstr(ver, "Mesa")) { |
+ fTextureRedSupport = ctxInfo.hasExtension("GL_ARB_texture_rg"); |
+ } else { |
fTextureRedSupport = version >= GR_GL_VER(3,0) || |
ctxInfo.hasExtension("GL_ARB_texture_rg"); |
+ } |
} else { |
fTextureRedSupport = ctxInfo.hasExtension("GL_EXT_texture_rg"); |
} |