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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } | 122 } |
123 return kNone_GrGLBinding; | 123 return kNone_GrGLBinding; |
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) { |
| 133 return 0 == strcmp(rendererString, "Chromium"); |
| 134 } |
| 135 |
132 GrGLVersion GrGLGetVersionFromString(const char* versionString) { | 136 GrGLVersion GrGLGetVersionFromString(const char* versionString) { |
133 if (NULL == versionString) { | 137 if (NULL == versionString) { |
134 SkDEBUGFAIL("NULL GL version string."); | 138 SkDEBUGFAIL("NULL GL version string."); |
135 return 0; | 139 return 0; |
136 } | 140 } |
137 | 141 |
138 int major, minor; | 142 int major, minor; |
139 | 143 |
140 // check for mesa | 144 // check for mesa |
141 int mesaMajor, mesaMinor; | 145 int mesaMajor, mesaMinor; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 dest[9] = 0; | 293 dest[9] = 0; |
290 dest[10] = 1; | 294 dest[10] = 1; |
291 dest[11] = 0; | 295 dest[11] = 0; |
292 | 296 |
293 // Col 3 | 297 // Col 3 |
294 dest[12] = SkScalarToFloat(src[SkMatrix::kMTransX]); | 298 dest[12] = SkScalarToFloat(src[SkMatrix::kMTransX]); |
295 dest[13] = SkScalarToFloat(src[SkMatrix::kMTransY]); | 299 dest[13] = SkScalarToFloat(src[SkMatrix::kMTransY]); |
296 dest[14] = 0; | 300 dest[14] = 0; |
297 dest[15] = SkScalarToFloat(src[SkMatrix::kMPersp2]); | 301 dest[15] = SkScalarToFloat(src[SkMatrix::kMPersp2]); |
298 } | 302 } |
OLD | NEW |