Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Unified Diff: src/gpu/gl/GrGLCaps.cpp

Issue 15994006: Use GL_ALPHA instead of GL_RED to create texture in mesa if no GL_ARB_texture_rg extension (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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");
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698