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

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

Issue 16955005: Add MESA detection to GrContextInfo and use to decide whether to use GL_ALPHA or GL_RED. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix comment type 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 | src/gpu/gl/GrGLContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLCaps.cpp
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index fd74d50d715b1a28c20b0fc4e5ae1616418d0aaf..1770d05c3ab332d3ee32688f10d123fca18d9356 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -164,10 +164,15 @@ void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
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) {
- fTextureRedSupport = version >= GR_GL_VER(3,0) ||
- ctxInfo.hasExtension("GL_ARB_texture_rg");
+ if (ctxInfo.isMesa()) {
+ 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 | src/gpu/gl/GrGLContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698