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

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

Issue 174123003: Add hooks for GL_EXT_debug_marker in gpu (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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
« no previous file with comments | « src/gpu/gl/GrGLCreateNullInterface.cpp ('k') | src/gpu/gl/GrGLInterface.cpp » ('j') | 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 SkAutoTDelete< SkTArray<SkString> > oldStrings(fStrings.detach()); 113 SkAutoTDelete< SkTArray<SkString> > oldStrings(fStrings.detach());
114 fStrings.reset(SkNEW(SkTArray<SkString>(oldStrings->count() - 1))); 114 fStrings.reset(SkNEW(SkTArray<SkString>(oldStrings->count() - 1)));
115 fStrings->push_back_n(idx, &oldStrings->front()); 115 fStrings->push_back_n(idx, &oldStrings->front());
116 fStrings->push_back_n(oldStrings->count() - idx - 1, &(*oldStrings)[idx] + 1); 116 fStrings->push_back_n(oldStrings->count() - idx - 1, &(*oldStrings)[idx] + 1);
117 return true; 117 return true;
118 } else { 118 } else {
119 return false; 119 return false;
120 } 120 }
121 } 121 }
122 122
123 void GrGLExtensions::add(const char ext[]) {
124 int idx = find_string(*fStrings, ext);
125 if (idx < 0) {
126 // This is not the most effecient approach since we end up doing a full sort of the
127 // extensions after the add
128 fStrings->push_back().set(ext);
129 SkTLessFunctionToFunctorAdaptor<SkString, extension_compare> cmp;
130 SkTQSort(&fStrings->front(), &fStrings->back(), cmp);
131 }
132 }
133
123 void GrGLExtensions::print(const char* sep) const { 134 void GrGLExtensions::print(const char* sep) const {
124 if (NULL == sep) { 135 if (NULL == sep) {
125 sep = " "; 136 sep = " ";
126 } 137 }
127 int cnt = fStrings->count(); 138 int cnt = fStrings->count();
128 for (int i = 0; i < cnt; ++i) { 139 for (int i = 0; i < cnt; ++i) {
129 GrPrintf("%s%s", (*fStrings)[i].c_str(), (i < cnt - 1) ? sep : ""); 140 GrPrintf("%s%s", (*fStrings)[i].c_str(), (i < cnt - 1) ? sep : "");
130 } 141 }
131 } 142 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLCreateNullInterface.cpp ('k') | src/gpu/gl/GrGLInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698