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

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

Issue 146863003: Revert "Turn NVPR on by default (but off in tools)." (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/GrGLCaps.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 33273e5f6511b41615919e43a5acee9c95344720..4e75d3e08c064c5e82a1322c47193baa57962744 100644
--- a/src/gpu/gl/GrGLExtensions.cpp
+++ b/src/gpu/gl/GrGLExtensions.cpp
@@ -12,35 +12,12 @@
#include "SkTSearch.h"
#include "SkTSort.h"
-namespace { // This cannot be static because it is used as a template parameter.
+namespace {
inline bool extension_compare(const SkString& a, const SkString& b) {
return strcmp(a.c_str(), b.c_str()) < 0;
}
}
-// finds the index of ext in strings or a negative result if ext is not found.
-static int find_string(const SkTArray<SkString>& strings, const char ext[]) {
- if (strings.empty()) {
- return -1;
- }
- SkString extensionStr(ext);
- int idx = SkTSearch<SkString, extension_compare>(&strings.front(),
- strings.count(),
- extensionStr,
- sizeof(SkString));
- return idx;
-}
-
-GrGLExtensions::GrGLExtensions(const GrGLExtensions& that) : fStrings(SkNEW(SkTArray<SkString>)) {
- *this = that;
-}
-
-GrGLExtensions& GrGLExtensions::operator=(const GrGLExtensions& that) {
- *fStrings = *that.fStrings;
- fInitialized = that.fInitialized;
- return *this;
-}
-
bool GrGLExtensions::init(GrGLStandard standard,
GrGLGetStringProc getString,
GrGLGetStringiProc getStringi,
@@ -99,25 +76,16 @@ bool GrGLExtensions::init(GrGLStandard standard,
return true;
}
-bool GrGLExtensions::has(const char ext[]) const {
- SkASSERT(fInitialized);
- return find_string(*fStrings, ext) >= 0;
-}
-
-bool GrGLExtensions::remove(const char ext[]) {
- SkASSERT(fInitialized);
- int idx = find_string(*fStrings, ext);
- if (idx >= 0) {
- // This is not terribly effecient but we really only expect this function to be called at
- // most a handful of times when our test programs start.
- SkAutoTDelete< SkTArray<SkString> > oldStrings(fStrings.detach());
- fStrings.reset(SkNEW(SkTArray<SkString>(oldStrings->count() - 1)));
- fStrings->push_back_n(idx, &oldStrings->front());
- fStrings->push_back_n(oldStrings->count() - idx - 1, &(*oldStrings)[idx] + 1);
- return true;
- } else {
+bool GrGLExtensions::has(const char* ext) const {
+ if (fStrings->empty()) {
return false;
}
+ SkString extensionStr(ext);
+ int idx = SkTSearch<SkString, extension_compare>(&fStrings->front(),
+ fStrings->count(),
+ extensionStr,
+ sizeof(SkString));
+ return idx >= 0;
}
void GrGLExtensions::print(const char* sep) const {
« no previous file with comments | « src/gpu/gl/GrGLCaps.cpp ('k') | src/gpu/gl/GrGLInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698