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 : ""); |
} |
} |