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

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

Issue 133413003: Rename GrGLBinding->GrGLStandard, no longer a bitfield (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: actually fix enum names? Created 6 years, 11 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 | Annotate | Revision Log
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 #if GR_GL_LOG_CALLS 86 #if GR_GL_LOG_CALLS
87 bool gLogCallsGL = !!(GR_GL_LOG_CALLS_START); 87 bool gLogCallsGL = !!(GR_GL_LOG_CALLS_START);
88 #endif 88 #endif
89 89
90 #if GR_GL_CHECK_ERROR 90 #if GR_GL_CHECK_ERROR
91 bool gCheckErrorGL = !!(GR_GL_CHECK_ERROR_START); 91 bool gCheckErrorGL = !!(GR_GL_CHECK_ERROR_START);
92 #endif 92 #endif
93 93
94 /////////////////////////////////////////////////////////////////////////////// 94 ///////////////////////////////////////////////////////////////////////////////
95 95
96 GrGLBinding GrGLGetBindingInUseFromString(const char* versionString) { 96 GrGLStandard GrGLGetStandardInUseFromString(const char* versionString) {
97 if (NULL == versionString) { 97 if (NULL == versionString) {
98 SkDEBUGFAIL("NULL GL version string."); 98 SkDEBUGFAIL("NULL GL version string.");
99 return kNone_GrGLBinding; 99 return kNone_GrGLStandard;
100 } 100 }
101 101
102 int major, minor; 102 int major, minor;
103 103
104 // check for desktop 104 // check for desktop
105 int n = sscanf(versionString, "%d.%d", &major, &minor); 105 int n = sscanf(versionString, "%d.%d", &major, &minor);
106 if (2 == n) { 106 if (2 == n) {
107 return kDesktop_GrGLBinding; 107 return kGL_GrGLStandard;
108 } 108 }
109 109
110 // check for ES 1 110 // check for ES 1
111 char profile[2]; 111 char profile[2];
112 n = sscanf(versionString, "OpenGL ES-%c%c %d.%d", profile, profile+1, &major , &minor); 112 n = sscanf(versionString, "OpenGL ES-%c%c %d.%d", profile, profile+1, &major , &minor);
113 if (4 == n) { 113 if (4 == n) {
114 // we no longer support ES1. 114 // we no longer support ES1.
115 return kNone_GrGLBinding; 115 return kNone_GrGLStandard;
116 } 116 }
117 117
118 // check for ES2 118 // check for ES2
119 n = sscanf(versionString, "OpenGL ES %d.%d", &major, &minor); 119 n = sscanf(versionString, "OpenGL ES %d.%d", &major, &minor);
120 if (2 == n) { 120 if (2 == n) {
121 return kES_GrGLBinding; 121 return kGLES_GrGLStandard;
122 } 122 }
123 return kNone_GrGLBinding; 123 return kNone_GrGLStandard;
124 } 124 }
125 125
126 bool GrGLIsMesaFromVersionString(const char* versionString) { 126 bool GrGLIsMesaFromVersionString(const char* versionString) {
127 int major, minor, mesaMajor, mesaMinor; 127 int major, minor, mesaMajor, mesaMinor;
128 int n = sscanf(versionString, "%d.%d Mesa %d.%d", &major, &minor, &mesaMajor , &mesaMinor); 128 int n = sscanf(versionString, "%d.%d Mesa %d.%d", &major, &minor, &mesaMajor , &mesaMinor);
129 return 4 == n; 129 return 4 == n;
130 } 130 }
131 131
132 bool GrGLIsChromiumFromRendererString(const char* rendererString) { 132 bool GrGLIsChromiumFromRendererString(const char* rendererString) {
133 return 0 == strcmp(rendererString, "Chromium"); 133 return 0 == strcmp(rendererString, "Chromium");
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 221
222 GrGLRenderer GrGLGetRendererFromString(const char* rendererString) { 222 GrGLRenderer GrGLGetRendererFromString(const char* rendererString) {
223 if (NULL != rendererString) { 223 if (NULL != rendererString) {
224 if (0 == strcmp(rendererString, "NVIDIA Tegra 3")) { 224 if (0 == strcmp(rendererString, "NVIDIA Tegra 3")) {
225 return kTegra3_GrGLRenderer; 225 return kTegra3_GrGLRenderer;
226 } 226 }
227 } 227 }
228 return kOther_GrGLRenderer; 228 return kOther_GrGLRenderer;
229 } 229 }
230 230
231 GrGLBinding GrGLGetBindingInUse(const GrGLInterface* gl) {
232 const GrGLubyte* v;
233 GR_GL_CALL_RET(gl, v, GetString(GR_GL_VERSION));
234 return GrGLGetBindingInUseFromString((const char*) v);
235 }
236
237 GrGLVersion GrGLGetVersion(const GrGLInterface* gl) { 231 GrGLVersion GrGLGetVersion(const GrGLInterface* gl) {
238 const GrGLubyte* v; 232 const GrGLubyte* v;
239 GR_GL_CALL_RET(gl, v, GetString(GR_GL_VERSION)); 233 GR_GL_CALL_RET(gl, v, GetString(GR_GL_VERSION));
240 return GrGLGetVersionFromString((const char*) v); 234 return GrGLGetVersionFromString((const char*) v);
241 } 235 }
242 236
243 GrGLSLVersion GrGLGetGLSLVersion(const GrGLInterface* gl) { 237 GrGLSLVersion GrGLGetGLSLVersion(const GrGLInterface* gl) {
244 const GrGLubyte* v; 238 const GrGLubyte* v;
245 GR_GL_CALL_RET(gl, v, GetString(GR_GL_SHADING_LANGUAGE_VERSION)); 239 GR_GL_CALL_RET(gl, v, GetString(GR_GL_SHADING_LANGUAGE_VERSION));
246 return GrGLGetGLSLVersionFromString((const char*) v); 240 return GrGLGetGLSLVersionFromString((const char*) v);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 dest[9] = 0; 287 dest[9] = 0;
294 dest[10] = 1; 288 dest[10] = 1;
295 dest[11] = 0; 289 dest[11] = 0;
296 290
297 // Col 3 291 // Col 3
298 dest[12] = SkScalarToFloat(src[SkMatrix::kMTransX]); 292 dest[12] = SkScalarToFloat(src[SkMatrix::kMTransX]);
299 dest[13] = SkScalarToFloat(src[SkMatrix::kMTransY]); 293 dest[13] = SkScalarToFloat(src[SkMatrix::kMTransY]);
300 dest[14] = 0; 294 dest[14] = 0;
301 dest[15] = SkScalarToFloat(src[SkMatrix::kMPersp2]); 295 dest[15] = SkScalarToFloat(src[SkMatrix::kMPersp2]);
302 } 296 }
OLDNEW
« src/gpu/gl/GrGLContext.cpp ('K') | « src/gpu/gl/GrGLUtil.h ('k') | src/gpu/gl/GrGpuGL.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698