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

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

Issue 1674823002: Replace GrGLInterface's function pointers with std::functions (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase and address comment Created 4 years, 10 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
« include/gpu/gl/GrGLFunctions.h ('K') | « src/gpu/gl/GrGLCaps.cpp ('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 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
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
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 }
OLDNEW
« include/gpu/gl/GrGLFunctions.h ('K') | « src/gpu/gl/GrGLCaps.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698