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

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

Issue 1947373003: Fix unit test crash caused by OSMesa not supporting rendering to GL_ALPHA8 (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months 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 | « src/gpu/gl/GrGLUtil.h ('k') | 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 if (kNVIDIA_GrGLVendor == vendor) { 120 if (kNVIDIA_GrGLVendor == vendor) {
121 *outDriver = kNVIDIA_GrGLDriver; 121 *outDriver = kNVIDIA_GrGLDriver;
122 int n = sscanf(versionString, "%d.%d.%d NVIDIA %d.%d", 122 int n = sscanf(versionString, "%d.%d.%d NVIDIA %d.%d",
123 &major, &minor, &rev, &driverMajor, &driverMinor); 123 &major, &minor, &rev, &driverMajor, &driverMinor);
124 // Some older NVIDIA drivers don't report the driver version. 124 // Some older NVIDIA drivers don't report the driver version.
125 if (5 == n) { 125 if (5 == n) {
126 *outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor); 126 *outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor);
127 } 127 }
128 return; 128 return;
129 } 129 }
130
131 int n = sscanf(versionString, "%d.%d Mesa %d.%d", 130 int n = sscanf(versionString, "%d.%d Mesa %d.%d",
132 &major, &minor, &driverMajor, &driverMinor); 131 &major, &minor, &driverMajor, &driverMinor);
133 if (4 == n) { 132 if (4 == n) {
134 *outDriver = kMesa_GrGLDriver; 133 *outDriver = kMesa_GrGLDriver;
135 *outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor); 134 *outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor);
136 return; 135 return;
137 } 136 }
138 } 137 }
139 else { 138 else {
140 if (kNVIDIA_GrGLVendor == vendor) { 139 if (kNVIDIA_GrGLVendor == vendor) {
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 if (1 == n) { 296 if (1 == n) {
298 if (adrenoNumber >= 300) { 297 if (adrenoNumber >= 300) {
299 if (adrenoNumber < 400) { 298 if (adrenoNumber < 400) {
300 return kAdreno3xx_GrGLRenderer; 299 return kAdreno3xx_GrGLRenderer;
301 } 300 }
302 if (adrenoNumber < 500) { 301 if (adrenoNumber < 500) {
303 return kAdreno4xx_GrGLRenderer; 302 return kAdreno4xx_GrGLRenderer;
304 } 303 }
305 } 304 }
306 } 305 }
306 if (strcmp("Mesa Offscreen", rendererString)) {
307 return kOSMesa_GrGLRenderer;
308 }
307 } 309 }
308 return kOther_GrGLRenderer; 310 return kOther_GrGLRenderer;
309 } 311 }
310 312
311 GrGLVersion GrGLGetVersion(const GrGLInterface* gl) { 313 GrGLVersion GrGLGetVersion(const GrGLInterface* gl) {
312 const GrGLubyte* v; 314 const GrGLubyte* v;
313 GR_GL_CALL_RET(gl, v, GetString(GR_GL_VERSION)); 315 GR_GL_CALL_RET(gl, v, GetString(GR_GL_VERSION));
314 return GrGLGetVersionFromString((const char*) v); 316 return GrGLGetVersionFromString((const char*) v);
315 } 317 }
316 318
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 GR_STATIC_ASSERT(2 == kGreater_StencilFunc); 351 GR_STATIC_ASSERT(2 == kGreater_StencilFunc);
350 GR_STATIC_ASSERT(3 == kGEqual_StencilFunc); 352 GR_STATIC_ASSERT(3 == kGEqual_StencilFunc);
351 GR_STATIC_ASSERT(4 == kLess_StencilFunc); 353 GR_STATIC_ASSERT(4 == kLess_StencilFunc);
352 GR_STATIC_ASSERT(5 == kLEqual_StencilFunc); 354 GR_STATIC_ASSERT(5 == kLEqual_StencilFunc);
353 GR_STATIC_ASSERT(6 == kEqual_StencilFunc); 355 GR_STATIC_ASSERT(6 == kEqual_StencilFunc);
354 GR_STATIC_ASSERT(7 == kNotEqual_StencilFunc); 356 GR_STATIC_ASSERT(7 == kNotEqual_StencilFunc);
355 SkASSERT((unsigned) basicFunc < kBasicStencilFuncCnt); 357 SkASSERT((unsigned) basicFunc < kBasicStencilFuncCnt);
356 358
357 return gTable[basicFunc]; 359 return gTable[basicFunc];
358 } 360 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLUtil.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698