| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |