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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #include "GrGLUtil.h" 9 #include "GrGLUtil.h"
10 #include "SkMatrix.h" 10 #include "SkMatrix.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 void GrGLGetDriverInfo(GrGLStandard standard, 95 void GrGLGetDriverInfo(GrGLStandard standard,
96 GrGLVendor vendor, 96 GrGLVendor vendor,
97 const char* rendererString, 97 const char* rendererString,
98 const char* versionString, 98 const char* versionString,
99 GrGLDriver* outDriver, 99 GrGLDriver* outDriver,
100 GrGLDriverVersion* outVersion) { 100 GrGLDriverVersion* outVersion) {
101 int major, minor, rev, driverMajor, driverMinor; 101 int major, minor, rev, driverMajor, driverMinor;
102 102
103 *outDriver = kUnknown_GrGLDriver; 103 *outDriver = kUnknown_GrGLDriver;
104 *outVersion = GR_GL_DRIVER_UNKNOWN_VER; 104 *outVersion = GR_GL_DRIVER_UNKNOWN_VER;
105 // These null checks are for test GL contexts that return nullptr in their
106 // glGetString implementation.
107 if (!rendererString) {
108 rendererString = "";
109 }
110 if (!versionString) {
111 versionString = "";
112 }
105 113
106 if (0 == strcmp(rendererString, "Chromium")) { 114 if (0 == strcmp(rendererString, "Chromium")) {
107 *outDriver = kChromium_GrGLDriver; 115 *outDriver = kChromium_GrGLDriver;
108 return; 116 return;
109 } 117 }
110 118
111 if (standard == kGL_GrGLStandard) { 119 if (standard == kGL_GrGLStandard) {
112 if (kNVIDIA_GrGLVendor == vendor) { 120 if (kNVIDIA_GrGLVendor == vendor) {
113 *outDriver = kNVIDIA_GrGLDriver; 121 *outDriver = kNVIDIA_GrGLDriver;
114 int n = sscanf(versionString, "%d.%d.%d NVIDIA %d.%d", 122 int n = sscanf(versionString, "%d.%d.%d NVIDIA %d.%d",
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 GR_STATIC_ASSERT(2 == kGreater_StencilFunc); 349 GR_STATIC_ASSERT(2 == kGreater_StencilFunc);
342 GR_STATIC_ASSERT(3 == kGEqual_StencilFunc); 350 GR_STATIC_ASSERT(3 == kGEqual_StencilFunc);
343 GR_STATIC_ASSERT(4 == kLess_StencilFunc); 351 GR_STATIC_ASSERT(4 == kLess_StencilFunc);
344 GR_STATIC_ASSERT(5 == kLEqual_StencilFunc); 352 GR_STATIC_ASSERT(5 == kLEqual_StencilFunc);
345 GR_STATIC_ASSERT(6 == kEqual_StencilFunc); 353 GR_STATIC_ASSERT(6 == kEqual_StencilFunc);
346 GR_STATIC_ASSERT(7 == kNotEqual_StencilFunc); 354 GR_STATIC_ASSERT(7 == kNotEqual_StencilFunc);
347 SkASSERT((unsigned) basicFunc < kBasicStencilFuncCount); 355 SkASSERT((unsigned) basicFunc < kBasicStencilFuncCount);
348 356
349 return gTable[basicFunc]; 357 return gTable[basicFunc];
350 } 358 }
OLDNEW
« 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