| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #include "gl/GrGLExtensions.h" | 8 #include "gl/GrGLExtensions.h" |
| 9 #include "gl/GrGLDefines.h" | 9 #include "gl/GrGLDefines.h" |
| 10 #include "gl/GrGLUtil.h" | 10 #include "gl/GrGLUtil.h" |
| 11 | 11 |
| 12 #include "SkTSearch.h" | 12 #include "SkTSearch.h" |
| 13 #include "SkTSort.h" | 13 #include "SkTSort.h" |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 inline bool extension_compare(const SkString& a, const SkString& b) { | 16 inline bool extension_compare(const SkString& a, const SkString& b) { |
| 17 return strcmp(a.c_str(), b.c_str()) < 0; | 17 return strcmp(a.c_str(), b.c_str()) < 0; |
| 18 } | 18 } |
| 19 } | 19 } |
| 20 | 20 |
| 21 bool GrGLExtensions::init(GrGLBinding binding, | 21 bool GrGLExtensions::init(GrGLStandard standard, |
| 22 GrGLGetStringProc getString, | 22 GrGLGetStringProc getString, |
| 23 GrGLGetStringiProc getStringi, | 23 GrGLGetStringiProc getStringi, |
| 24 GrGLGetIntegervProc getIntegerv) { | 24 GrGLGetIntegervProc getIntegerv) { |
| 25 fStrings.reset(); | 25 fStrings.reset(); |
| 26 if (NULL == getString) { | 26 if (NULL == getString) { |
| 27 return false; | 27 return false; |
| 28 } | 28 } |
| 29 | 29 |
| 30 // glGetStringi and indexed extensions were added in version 3.0 of desktop
GL and ES. | 30 // glGetStringi and indexed extensions were added in version 3.0 of desktop
GL and ES. |
| 31 const GrGLubyte* verString = getString(GR_GL_VERSION); | 31 const GrGLubyte* verString = getString(GR_GL_VERSION); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 void GrGLExtensions::print(const char* sep) const { | 88 void GrGLExtensions::print(const char* sep) const { |
| 89 if (NULL == sep) { | 89 if (NULL == sep) { |
| 90 sep = " "; | 90 sep = " "; |
| 91 } | 91 } |
| 92 int cnt = fStrings.count(); | 92 int cnt = fStrings.count(); |
| 93 for (int i = 0; i < cnt; ++i) { | 93 for (int i = 0; i < cnt; ++i) { |
| 94 GrPrintf("%s%s", fStrings[i].c_str(), (i < cnt - 1) ? sep : ""); | 94 GrPrintf("%s%s", fStrings[i].c_str(), (i < cnt - 1) ? sep : ""); |
| 95 } | 95 } |
| 96 } | 96 } |
| OLD | NEW |