aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLUtil.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-03-23 14:55:21 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-23 14:55:21 -0700
commit6383ac0208a77d2f0f8855b2547d3dfda960da76 (patch)
tree21410d599d3f4179710a05634ec83848fe83ac23 /src/gpu/gl/GrGLUtil.cpp
parent9c79d7ec4ee43e256f0e34cabcfdce0fea444b64 (diff)
Make GrGLGetDriverInfo work for null strings.
The media unit tests in Chromium use a test context that returns nullptr for its vendor/renderer strings. TBR=robertphillips@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1831633002 Review URL: https://codereview.chromium.org/1831633002
Diffstat (limited to 'src/gpu/gl/GrGLUtil.cpp')
-rw-r--r--src/gpu/gl/GrGLUtil.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLUtil.cpp b/src/gpu/gl/GrGLUtil.cpp
index b5e5855401..c766f13c56 100644
--- a/src/gpu/gl/GrGLUtil.cpp
+++ b/src/gpu/gl/GrGLUtil.cpp
@@ -102,6 +102,14 @@ void GrGLGetDriverInfo(GrGLStandard standard,
*outDriver = kUnknown_GrGLDriver;
*outVersion = GR_GL_DRIVER_UNKNOWN_VER;
+ // These null checks are for test GL contexts that return nullptr in their
+ // glGetString implementation.
+ if (!rendererString) {
+ rendererString = "";
+ }
+ if (!versionString) {
+ versionString = "";
+ }
if (0 == strcmp(rendererString, "Chromium")) {
*outDriver = kChromium_GrGLDriver;