Fail to create GrContext when we get a NULL for a GL/GLSL version string
BUG=368107
R=jvanverth@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/254083002
git-svn-id: http://skia.googlecode.com/svn/trunk@14452 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGLContext.cpp b/src/gpu/gl/GrGLContext.cpp
index 54deb32..5bc5b6f 100644
--- a/src/gpu/gl/GrGLContext.cpp
+++ b/src/gpu/gl/GrGLContext.cpp
@@ -37,8 +37,13 @@
if (interface->validate()) {
fGLVersion = GrGLGetVersionFromString(ver);
+ if (GR_GL_INVALID_VER == fGLVersion) {
+ return false;
+ }
- fGLSLGeneration = GrGetGLSLGeneration(interface);
+ if (!GrGetGLSLGeneration(interface, &fGLSLGeneration)) {
+ return false;
+ }
fVendor = GrGLGetVendor(interface);
@@ -51,9 +56,7 @@
// This must occur before caps init.
fInterface.reset(SkRef(interface));
- fGLCaps->init(*this, interface);
-
- return true;
+ return fGLCaps->init(*this, interface);
}
}
return false;