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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 } | 141 } |
142 | 142 |
143 int n = sscanf(versionString, "OpenGL ES %d.%d Mesa %d.%d", | 143 int n = sscanf(versionString, "OpenGL ES %d.%d Mesa %d.%d", |
144 &major, &minor, &driverMajor, &driverMinor); | 144 &major, &minor, &driverMajor, &driverMinor); |
145 if (4 == n) { | 145 if (4 == n) { |
146 *outDriver = kMesa_GrGLDriver; | 146 *outDriver = kMesa_GrGLDriver; |
147 *outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor); | 147 *outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor); |
148 return; | 148 return; |
149 } | 149 } |
150 } | 150 } |
| 151 |
| 152 if (kIntel_GrGLVendor == vendor) { |
| 153 // We presume we're on the Intel driver since it hasn't identified itsel
f as Mesa. |
| 154 *outDriver = kIntel_GrGLDriver; |
| 155 } |
151 } | 156 } |
152 | 157 |
153 GrGLVersion GrGLGetVersionFromString(const char* versionString) { | 158 GrGLVersion GrGLGetVersionFromString(const char* versionString) { |
154 if (NULL == versionString) { | 159 if (NULL == versionString) { |
155 SkDebugf("NULL GL version string."); | 160 SkDebugf("NULL GL version string."); |
156 return GR_GL_INVALID_VER; | 161 return GR_GL_INVALID_VER; |
157 } | 162 } |
158 | 163 |
159 int major, minor; | 164 int major, minor; |
160 | 165 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 GR_STATIC_ASSERT(2 == kGreater_StencilFunc); | 357 GR_STATIC_ASSERT(2 == kGreater_StencilFunc); |
353 GR_STATIC_ASSERT(3 == kGEqual_StencilFunc); | 358 GR_STATIC_ASSERT(3 == kGEqual_StencilFunc); |
354 GR_STATIC_ASSERT(4 == kLess_StencilFunc); | 359 GR_STATIC_ASSERT(4 == kLess_StencilFunc); |
355 GR_STATIC_ASSERT(5 == kLEqual_StencilFunc); | 360 GR_STATIC_ASSERT(5 == kLEqual_StencilFunc); |
356 GR_STATIC_ASSERT(6 == kEqual_StencilFunc); | 361 GR_STATIC_ASSERT(6 == kEqual_StencilFunc); |
357 GR_STATIC_ASSERT(7 == kNotEqual_StencilFunc); | 362 GR_STATIC_ASSERT(7 == kNotEqual_StencilFunc); |
358 SkASSERT((unsigned) basicFunc < kBasicStencilFuncCount); | 363 SkASSERT((unsigned) basicFunc < kBasicStencilFuncCount); |
359 | 364 |
360 return gTable[basicFunc]; | 365 return gTable[basicFunc]; |
361 } | 366 } |
OLD | NEW |