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

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

Issue 948473002: Port GrGLCaps over to use SkTHash. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: winders Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLCaps.h ('k') | tests/HashTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLCaps.cpp
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 1f50f8d1e18a6be82b834529ecadee5b6af431f6..9911d53f43c373d54cb88561d4269ea5e5361884 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -749,20 +749,13 @@ bool GrGLCaps::readPixelsSupported(const GrGLInterface* intf,
GrGLenum format,
GrGLenum type,
GrGLenum currFboFormat) const {
-
- ReadPixelsSupportedFormats::Key key = {format, type, currFboFormat};
-
- ReadPixelsSupportedFormats* cachedValue = fReadPixelsSupportedCache.find(key);
-
- if (NULL == cachedValue) {
- bool value = doReadPixelsSupported(intf, format, type);
- ReadPixelsSupportedFormats newValue(key, value);
- fReadPixelsSupportedCache.add(newValue);
-
- return newValue.value();
+ ReadPixelsSupportedFormat key = {format, type, currFboFormat};
+ if (const bool* supported = fReadPixelsSupportedCache.find(key)) {
+ return *supported;
}
-
- return cachedValue->value();
+ bool supported = this->doReadPixelsSupported(intf, format, type);
+ fReadPixelsSupportedCache.set(key, supported);
+ return supported;
}
void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
« no previous file with comments | « src/gpu/gl/GrGLCaps.h ('k') | tests/HashTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698