Add MESA detection to GrContextInfo and use to decide whether to use GL_ALPHA or GL_RED.
Based on yunchao.he@intel.com's original change here: https://codereview.chromium.org/15994006/
R=yunchao.he@intel.com, robertphillips@google.com
Author: bsalomon@google.com
Review URL: https://chromiumcodereview.appspot.com/16955005
git-svn-id: http://skia.googlecode.com/svn/trunk@9608 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGLContext.cpp b/src/gpu/gl/GrGLContext.cpp
index d384b4e..1d0a01f 100644
--- a/src/gpu/gl/GrGLContext.cpp
+++ b/src/gpu/gl/GrGLContext.cpp
@@ -14,6 +14,7 @@
fGLSLGeneration = ctxInfo.fGLSLGeneration;
fVendor = ctxInfo.fVendor;
fExtensions = ctxInfo.fExtensions;
+ fIsMesa = ctxInfo.fIsMesa;
*fGLCaps = *ctxInfo.fGLCaps.get();
return *this;
}
@@ -36,6 +37,9 @@
fGLSLGeneration = GrGetGLSLGeneration(fBindingInUse, interface);
fVendor = GrGLGetVendor(interface);
+
+ fIsMesa = GrGLIsMesaFromVersionString(ver);
+
fGLCaps->init(*this, interface);
return true;
}
@@ -52,6 +56,7 @@
fGLVersion = GR_GL_VER(0, 0);
fGLSLGeneration = static_cast<GrGLSLGeneration>(0);
fVendor = kOther_GrGLVendor;
+ fIsMesa = false;
fExtensions.reset();
fGLCaps->reset();
}