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

Unified Diff: src/gpu/gl/GrGLExtensions.cpp

Issue 140823003: Move GrGLExtensions from GrGLContextInfo to GrGLInterface (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix Android Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLContext.cpp ('k') | src/gpu/gl/GrGLInterface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLExtensions.cpp
diff --git a/src/gpu/gl/GrGLExtensions.cpp b/src/gpu/gl/GrGLExtensions.cpp
index dcfa4f767711378e35f3950c6b6a4b1de5f2c53b..4e75d3e08c064c5e82a1322c47193baa57962744 100644
--- a/src/gpu/gl/GrGLExtensions.cpp
+++ b/src/gpu/gl/GrGLExtensions.cpp
@@ -22,7 +22,9 @@ bool GrGLExtensions::init(GrGLStandard standard,
GrGLGetStringProc getString,
GrGLGetStringiProc getStringi,
GrGLGetIntegervProc getIntegerv) {
- fStrings.reset();
+ fInitialized = false;
+ fStrings->reset();
+
if (NULL == getString) {
return false;
}
@@ -41,10 +43,10 @@ bool GrGLExtensions::init(GrGLStandard standard,
}
GrGLint extensionCnt = 0;
getIntegerv(GR_GL_NUM_EXTENSIONS, &extensionCnt);
- fStrings.push_back_n(extensionCnt);
+ fStrings->push_back_n(extensionCnt);
for (int i = 0; i < extensionCnt; ++i) {
const char* ext = (const char*) getStringi(GR_GL_EXTENSIONS, i);
- fStrings[i] = ext;
+ (*fStrings)[i] = ext;
}
} else {
const char* extensions = (const char*) getString(GR_GL_EXTENSIONS);
@@ -62,24 +64,25 @@ bool GrGLExtensions::init(GrGLStandard standard,
}
// we found an extension
size_t length = strcspn(extensions, " ");
- fStrings.push_back().set(extensions, length);
+ fStrings->push_back().set(extensions, length);
extensions += length;
}
}
- if (!fStrings.empty()) {
+ if (!fStrings->empty()) {
SkTLessFunctionToFunctorAdaptor<SkString, extension_compare> cmp;
- SkTQSort(&fStrings.front(), &fStrings.back(), cmp);
+ SkTQSort(&fStrings->front(), &fStrings->back(), cmp);
}
+ fInitialized = true;
return true;
}
bool GrGLExtensions::has(const char* ext) const {
- if (fStrings.empty()) {
+ if (fStrings->empty()) {
return false;
}
SkString extensionStr(ext);
- int idx = SkTSearch<SkString, extension_compare>(&fStrings.front(),
- fStrings.count(),
+ int idx = SkTSearch<SkString, extension_compare>(&fStrings->front(),
+ fStrings->count(),
extensionStr,
sizeof(SkString));
return idx >= 0;
@@ -89,8 +92,8 @@ void GrGLExtensions::print(const char* sep) const {
if (NULL == sep) {
sep = " ";
}
- int cnt = fStrings.count();
+ int cnt = fStrings->count();
for (int i = 0; i < cnt; ++i) {
- GrPrintf("%s%s", fStrings[i].c_str(), (i < cnt - 1) ? sep : "");
+ GrPrintf("%s%s", (*fStrings)[i].c_str(), (i < cnt - 1) ? sep : "");
}
}
« no previous file with comments | « src/gpu/gl/GrGLContext.cpp ('k') | src/gpu/gl/GrGLInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698