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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 return; | 140 return; |
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 if (0 == strncmp("ANGLE", rendererString, 5)) { |
| 151 *outDriver = kANGLE_GrGLDriver; |
| 152 n = sscanf(versionString, "OpenGL ES %d.%d (ANGLE %d.%d", &major, &m
inor, &driverMajor, |
| 153 &driverMin
or); |
| 154 if (4 == n) { |
| 155 *outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor); |
| 156 } |
| 157 return; |
| 158 } |
150 } | 159 } |
151 | 160 |
152 if (kIntel_GrGLVendor == vendor) { | 161 if (kIntel_GrGLVendor == vendor) { |
153 // We presume we're on the Intel driver since it hasn't identified itsel
f as Mesa. | 162 // We presume we're on the Intel driver since it hasn't identified itsel
f as Mesa. |
154 *outDriver = kIntel_GrGLDriver; | 163 *outDriver = kIntel_GrGLDriver; |
155 } | 164 } |
156 } | 165 } |
157 | 166 |
158 GrGLVersion GrGLGetVersionFromString(const char* versionString) { | 167 GrGLVersion GrGLGetVersionFromString(const char* versionString) { |
159 if (NULL == versionString) { | 168 if (NULL == versionString) { |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 GR_STATIC_ASSERT(2 == kGreater_StencilFunc); | 366 GR_STATIC_ASSERT(2 == kGreater_StencilFunc); |
358 GR_STATIC_ASSERT(3 == kGEqual_StencilFunc); | 367 GR_STATIC_ASSERT(3 == kGEqual_StencilFunc); |
359 GR_STATIC_ASSERT(4 == kLess_StencilFunc); | 368 GR_STATIC_ASSERT(4 == kLess_StencilFunc); |
360 GR_STATIC_ASSERT(5 == kLEqual_StencilFunc); | 369 GR_STATIC_ASSERT(5 == kLEqual_StencilFunc); |
361 GR_STATIC_ASSERT(6 == kEqual_StencilFunc); | 370 GR_STATIC_ASSERT(6 == kEqual_StencilFunc); |
362 GR_STATIC_ASSERT(7 == kNotEqual_StencilFunc); | 371 GR_STATIC_ASSERT(7 == kNotEqual_StencilFunc); |
363 SkASSERT((unsigned) basicFunc < kBasicStencilFuncCount); | 372 SkASSERT((unsigned) basicFunc < kBasicStencilFuncCount); |
364 | 373 |
365 return gTable[basicFunc]; | 374 return gTable[basicFunc]; |
366 } | 375 } |
OLD | NEW |