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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 int lastDigit; | 207 int lastDigit; |
208 int n = sscanf(rendererString, "PowerVR SGX 54%d", &lastDigit); | 208 int n = sscanf(rendererString, "PowerVR SGX 54%d", &lastDigit); |
209 if (1 == n && lastDigit >= 0 && lastDigit <= 9) { | 209 if (1 == n && lastDigit >= 0 && lastDigit <= 9) { |
210 return kPowerVR54x_GrGLRenderer; | 210 return kPowerVR54x_GrGLRenderer; |
211 } | 211 } |
212 static const char kPowerVRRogueStr[] = "PowerVR Rogue"; | 212 static const char kPowerVRRogueStr[] = "PowerVR Rogue"; |
213 if (0 == strncmp(rendererString, kPowerVRRogueStr, | 213 if (0 == strncmp(rendererString, kPowerVRRogueStr, |
214 SK_ARRAY_COUNT(kPowerVRRogueStr)-1)) { | 214 SK_ARRAY_COUNT(kPowerVRRogueStr)-1)) { |
215 return kPowerVRRogue_GrGLRenderer; | 215 return kPowerVRRogue_GrGLRenderer; |
216 } | 216 } |
| 217 int adrenoNumber; |
| 218 n = sscanf(rendererString, "Adreno (TM) %d", &adrenoNumber); |
| 219 if (1 == n) { |
| 220 if (adrenoNumber >= 300) { |
| 221 if (adrenoNumber < 400) { |
| 222 return kAdreno3xx_GrGLRenderer; |
| 223 } |
| 224 if (adrenoNumber < 500) { |
| 225 return kAdreno4xx_GrGLRenderer; |
| 226 } |
| 227 } |
| 228 } |
217 } | 229 } |
218 return kOther_GrGLRenderer; | 230 return kOther_GrGLRenderer; |
219 } | 231 } |
220 | 232 |
221 GrGLVersion GrGLGetVersion(const GrGLInterface* gl) { | 233 GrGLVersion GrGLGetVersion(const GrGLInterface* gl) { |
222 const GrGLubyte* v; | 234 const GrGLubyte* v; |
223 GR_GL_CALL_RET(gl, v, GetString(GR_GL_VERSION)); | 235 GR_GL_CALL_RET(gl, v, GetString(GR_GL_VERSION)); |
224 return GrGLGetVersionFromString((const char*) v); | 236 return GrGLGetVersionFromString((const char*) v); |
225 } | 237 } |
226 | 238 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 GR_STATIC_ASSERT(2 == kGreater_StencilFunc); | 314 GR_STATIC_ASSERT(2 == kGreater_StencilFunc); |
303 GR_STATIC_ASSERT(3 == kGEqual_StencilFunc); | 315 GR_STATIC_ASSERT(3 == kGEqual_StencilFunc); |
304 GR_STATIC_ASSERT(4 == kLess_StencilFunc); | 316 GR_STATIC_ASSERT(4 == kLess_StencilFunc); |
305 GR_STATIC_ASSERT(5 == kLEqual_StencilFunc); | 317 GR_STATIC_ASSERT(5 == kLEqual_StencilFunc); |
306 GR_STATIC_ASSERT(6 == kEqual_StencilFunc); | 318 GR_STATIC_ASSERT(6 == kEqual_StencilFunc); |
307 GR_STATIC_ASSERT(7 == kNotEqual_StencilFunc); | 319 GR_STATIC_ASSERT(7 == kNotEqual_StencilFunc); |
308 SkASSERT((unsigned) basicFunc < kBasicStencilFuncCount); | 320 SkASSERT((unsigned) basicFunc < kBasicStencilFuncCount); |
309 | 321 |
310 return gTable[basicFunc]; | 322 return gTable[basicFunc]; |
311 } | 323 } |
OLD | NEW |