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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
254 if (0 == strcmp(rendererString, "NVIDIA Tegra 3")) { | 254 if (0 == strcmp(rendererString, "NVIDIA Tegra 3")) { |
255 return kTegra3_GrGLRenderer; | 255 return kTegra3_GrGLRenderer; |
256 } else if (0 == strcmp(rendererString, "NVIDIA Tegra")) { | 256 } else if (0 == strcmp(rendererString, "NVIDIA Tegra")) { |
257 return kTegra2_GrGLRenderer; | 257 return kTegra2_GrGLRenderer; |
258 } | 258 } |
259 int lastDigit; | 259 int lastDigit; |
260 int n = sscanf(rendererString, "PowerVR SGX 54%d", &lastDigit); | 260 int n = sscanf(rendererString, "PowerVR SGX 54%d", &lastDigit); |
261 if (1 == n && lastDigit >= 0 && lastDigit <= 9) { | 261 if (1 == n && lastDigit >= 0 && lastDigit <= 9) { |
262 return kPowerVR54x_GrGLRenderer; | 262 return kPowerVR54x_GrGLRenderer; |
263 } | 263 } |
264 // certain iOS devices also use PowerVR54x GPUs | |
265 static const char kAppleA4Str[] = "Apple A4"; | |
bsalomon
2015/12/10 16:45:28
I think these report PowerVR, but can't hurt
| |
266 static const char kAppleA5Str[] = "Apple A5"; | |
267 static const char kAppleA6Str[] = "Apple A6"; | |
268 if (0 == strncmp(rendererString, kAppleA4Str, | |
269 SK_ARRAY_COUNT(kAppleA4Str)-1) || | |
270 0 == strncmp(rendererString, kAppleA5Str, | |
271 SK_ARRAY_COUNT(kAppleA5Str)-1) || | |
272 0 == strncmp(rendererString, kAppleA6Str, | |
273 SK_ARRAY_COUNT(kAppleA6Str)-1)) { | |
274 return kPowerVR54x_GrGLRenderer; | |
275 } | |
264 static const char kPowerVRRogueStr[] = "PowerVR Rogue"; | 276 static const char kPowerVRRogueStr[] = "PowerVR Rogue"; |
277 static const char kAppleA7Str[] = "Apple A7"; | |
278 static const char kAppleA8Str[] = "Apple A8"; | |
265 if (0 == strncmp(rendererString, kPowerVRRogueStr, | 279 if (0 == strncmp(rendererString, kPowerVRRogueStr, |
266 SK_ARRAY_COUNT(kPowerVRRogueStr)-1)) { | 280 SK_ARRAY_COUNT(kPowerVRRogueStr)-1) || |
281 0 == strncmp(rendererString, kAppleA7Str, | |
282 SK_ARRAY_COUNT(kAppleA7Str)-1) || | |
283 0 == strncmp(rendererString, kAppleA8Str, | |
284 SK_ARRAY_COUNT(kAppleA8Str)-1)) { | |
267 return kPowerVRRogue_GrGLRenderer; | 285 return kPowerVRRogue_GrGLRenderer; |
268 } | 286 } |
269 int adrenoNumber; | 287 int adrenoNumber; |
270 n = sscanf(rendererString, "Adreno (TM) %d", &adrenoNumber); | 288 n = sscanf(rendererString, "Adreno (TM) %d", &adrenoNumber); |
271 if (1 == n) { | 289 if (1 == n) { |
272 if (adrenoNumber >= 300) { | 290 if (adrenoNumber >= 300) { |
273 if (adrenoNumber < 400) { | 291 if (adrenoNumber < 400) { |
274 return kAdreno3xx_GrGLRenderer; | 292 return kAdreno3xx_GrGLRenderer; |
275 } | 293 } |
276 if (adrenoNumber < 500) { | 294 if (adrenoNumber < 500) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
323 GR_STATIC_ASSERT(2 == kGreater_StencilFunc); | 341 GR_STATIC_ASSERT(2 == kGreater_StencilFunc); |
324 GR_STATIC_ASSERT(3 == kGEqual_StencilFunc); | 342 GR_STATIC_ASSERT(3 == kGEqual_StencilFunc); |
325 GR_STATIC_ASSERT(4 == kLess_StencilFunc); | 343 GR_STATIC_ASSERT(4 == kLess_StencilFunc); |
326 GR_STATIC_ASSERT(5 == kLEqual_StencilFunc); | 344 GR_STATIC_ASSERT(5 == kLEqual_StencilFunc); |
327 GR_STATIC_ASSERT(6 == kEqual_StencilFunc); | 345 GR_STATIC_ASSERT(6 == kEqual_StencilFunc); |
328 GR_STATIC_ASSERT(7 == kNotEqual_StencilFunc); | 346 GR_STATIC_ASSERT(7 == kNotEqual_StencilFunc); |
329 SkASSERT((unsigned) basicFunc < kBasicStencilFuncCount); | 347 SkASSERT((unsigned) basicFunc < kBasicStencilFuncCount); |
330 | 348 |
331 return gTable[basicFunc]; | 349 return gTable[basicFunc]; |
332 } | 350 } |
OLD | NEW |