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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 if (kNVIDIA_GrGLVendor == vendor) { | 120 if (kNVIDIA_GrGLVendor == vendor) { |
121 *outDriver = kNVIDIA_GrGLDriver; | 121 *outDriver = kNVIDIA_GrGLDriver; |
122 int n = sscanf(versionString, "%d.%d.%d NVIDIA %d.%d", | 122 int n = sscanf(versionString, "%d.%d.%d NVIDIA %d.%d", |
123 &major, &minor, &rev, &driverMajor, &driverMinor); | 123 &major, &minor, &rev, &driverMajor, &driverMinor); |
124 // Some older NVIDIA drivers don't report the driver version. | 124 // Some older NVIDIA drivers don't report the driver version. |
125 if (5 == n) { | 125 if (5 == n) { |
126 *outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor); | 126 *outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor); |
127 } | 127 } |
128 return; | 128 return; |
129 } | 129 } |
130 | |
131 int n = sscanf(versionString, "%d.%d Mesa %d.%d", | 130 int n = sscanf(versionString, "%d.%d Mesa %d.%d", |
132 &major, &minor, &driverMajor, &driverMinor); | 131 &major, &minor, &driverMajor, &driverMinor); |
133 if (4 == n) { | 132 if (4 == n) { |
134 *outDriver = kMesa_GrGLDriver; | 133 *outDriver = kMesa_GrGLDriver; |
135 *outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor); | 134 *outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor); |
136 return; | 135 return; |
137 } | 136 } |
138 } | 137 } |
139 else { | 138 else { |
140 if (kNVIDIA_GrGLVendor == vendor) { | 139 if (kNVIDIA_GrGLVendor == vendor) { |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 if (1 == n) { | 296 if (1 == n) { |
298 if (adrenoNumber >= 300) { | 297 if (adrenoNumber >= 300) { |
299 if (adrenoNumber < 400) { | 298 if (adrenoNumber < 400) { |
300 return kAdreno3xx_GrGLRenderer; | 299 return kAdreno3xx_GrGLRenderer; |
301 } | 300 } |
302 if (adrenoNumber < 500) { | 301 if (adrenoNumber < 500) { |
303 return kAdreno4xx_GrGLRenderer; | 302 return kAdreno4xx_GrGLRenderer; |
304 } | 303 } |
305 } | 304 } |
306 } | 305 } |
| 306 if (strcmp("Mesa Offscreen", rendererString)) { |
| 307 return kOSMesa_GrGLRenderer; |
| 308 } |
307 } | 309 } |
308 return kOther_GrGLRenderer; | 310 return kOther_GrGLRenderer; |
309 } | 311 } |
310 | 312 |
311 GrGLVersion GrGLGetVersion(const GrGLInterface* gl) { | 313 GrGLVersion GrGLGetVersion(const GrGLInterface* gl) { |
312 const GrGLubyte* v; | 314 const GrGLubyte* v; |
313 GR_GL_CALL_RET(gl, v, GetString(GR_GL_VERSION)); | 315 GR_GL_CALL_RET(gl, v, GetString(GR_GL_VERSION)); |
314 return GrGLGetVersionFromString((const char*) v); | 316 return GrGLGetVersionFromString((const char*) v); |
315 } | 317 } |
316 | 318 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 GR_STATIC_ASSERT(2 == kGreater_StencilFunc); | 351 GR_STATIC_ASSERT(2 == kGreater_StencilFunc); |
350 GR_STATIC_ASSERT(3 == kGEqual_StencilFunc); | 352 GR_STATIC_ASSERT(3 == kGEqual_StencilFunc); |
351 GR_STATIC_ASSERT(4 == kLess_StencilFunc); | 353 GR_STATIC_ASSERT(4 == kLess_StencilFunc); |
352 GR_STATIC_ASSERT(5 == kLEqual_StencilFunc); | 354 GR_STATIC_ASSERT(5 == kLEqual_StencilFunc); |
353 GR_STATIC_ASSERT(6 == kEqual_StencilFunc); | 355 GR_STATIC_ASSERT(6 == kEqual_StencilFunc); |
354 GR_STATIC_ASSERT(7 == kNotEqual_StencilFunc); | 356 GR_STATIC_ASSERT(7 == kNotEqual_StencilFunc); |
355 SkASSERT((unsigned) basicFunc < kBasicStencilFuncCnt); | 357 SkASSERT((unsigned) basicFunc < kBasicStencilFuncCnt); |
356 | 358 |
357 return gTable[basicFunc]; | 359 return gTable[basicFunc]; |
358 } | 360 } |
OLD | NEW |