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

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

Issue 1831633002: Make GrGLGetDriverInfo work for null strings. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: add comment Created 4 years, 9 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/GrGLUtil.cpp
diff --git a/src/gpu/gl/GrGLUtil.cpp b/src/gpu/gl/GrGLUtil.cpp
index b5e58554018c0560fa9fe176eb296c06f8e7bfb6..c766f13c564fe8482b589152d18e399c0548cc8a 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;
« 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