| 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" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 break; | 55 break; |
| 56 } | 56 } |
| 57 // we found an extension | 57 // we found an extension |
| 58 size_t length = strcspn(in, " "); | 58 size_t length = strcspn(in, " "); |
| 59 out->push_back().set(in, length); | 59 out->push_back().set(in, length); |
| 60 in += length; | 60 in += length; |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 | 63 |
| 64 bool GrGLExtensions::init(GrGLStandard standard, | 64 bool GrGLExtensions::init(GrGLStandard standard, |
| 65 GrGLGetStringProc getString, | 65 GrGLFunction<GrGLGetStringProc> getString, |
| 66 GrGLGetStringiProc getStringi, | 66 GrGLFunction<GrGLGetStringiProc> getStringi, |
| 67 GrGLGetIntegervProc getIntegerv, | 67 GrGLFunction<GrGLGetIntegervProc> getIntegerv, |
| 68 GrEGLQueryStringProc queryString, | 68 GrGLFunction<GrEGLQueryStringProc> queryString, |
| 69 GrEGLDisplay eglDisplay) { | 69 GrEGLDisplay eglDisplay) { |
| 70 fInitialized = false; | 70 fInitialized = false; |
| 71 fStrings->reset(); | 71 fStrings->reset(); |
| 72 | 72 |
| 73 if (!getString) { | 73 if (!getString) { |
| 74 return false; | 74 return false; |
| 75 } | 75 } |
| 76 | 76 |
| 77 // glGetStringi and indexed extensions were added in version 3.0 of desktop
GL and ES. | 77 // glGetStringi and indexed extensions were added in version 3.0 of desktop
GL and ES. |
| 78 const GrGLubyte* verString = getString(GR_GL_VERSION); | 78 const GrGLubyte* verString = getString(GR_GL_VERSION); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 148 |
| 149 void GrGLExtensions::print(const char* sep) const { | 149 void GrGLExtensions::print(const char* sep) const { |
| 150 if (nullptr == sep) { | 150 if (nullptr == sep) { |
| 151 sep = " "; | 151 sep = " "; |
| 152 } | 152 } |
| 153 int cnt = fStrings->count(); | 153 int cnt = fStrings->count(); |
| 154 for (int i = 0; i < cnt; ++i) { | 154 for (int i = 0; i < cnt; ++i) { |
| 155 SkDebugf("%s%s", (*fStrings)[i].c_str(), (i < cnt - 1) ? sep : ""); | 155 SkDebugf("%s%s", (*fStrings)[i].c_str(), (i < cnt - 1) ? sep : ""); |
| 156 } | 156 } |
| 157 } | 157 } |
| OLD | NEW |