Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1209)

Side by Side Diff: src/gpu/gl/GrGLUtil.cpp

Issue 1512903005: Add Apple renderer strings to PowerVR detection (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698