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

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

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/core/SkTHashCache.h ('k') | src/gpu/gl/GrGLCaps.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLCaps.h
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index 527cd33ee325da4d4d340d6f2308f0296ea2c262..1b77ed0e3204099847b26decf6c6a5ddb8753904 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -12,7 +12,7 @@
#include "GrDrawTargetCaps.h"
#include "GrGLStencilBuffer.h"
#include "SkChecksum.h"
-#include "SkTHashCache.h"
+#include "SkTHash.h"
#include "SkTArray.h"
class GrGLContextInfo;
@@ -393,45 +393,23 @@ private:
const char* fFBFetchColorName;
const char* fFBFetchExtensionString;
- class ReadPixelsSupportedFormats {
- public:
- struct Key {
- GrGLenum fFormat;
- GrGLenum fType;
- GrGLenum fFboFormat;
-
- bool operator==(const Key& rhs) const {
- return fFormat == rhs.fFormat
- && fType == rhs.fType
- && fFboFormat == rhs.fFboFormat;
- }
-
- uint32_t getHash() const {
- return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this), sizeof(*this));
- }
- };
-
- ReadPixelsSupportedFormats(Key key, bool value) : fKey(key), fValue(value) {
- }
-
- static const Key& GetKey(const ReadPixelsSupportedFormats& element) {
- return element.fKey;
- }
+ struct ReadPixelsSupportedFormat {
+ GrGLenum fFormat;
+ GrGLenum fType;
+ GrGLenum fFboFormat;
- static uint32_t Hash(const Key& key) {
- return key.getHash();
+ bool operator==(const ReadPixelsSupportedFormat& rhs) const {
+ return fFormat == rhs.fFormat
+ && fType == rhs.fType
+ && fFboFormat == rhs.fFboFormat;
}
-
- bool value() const {
- return fValue;
+ static uint32_t Hash(const ReadPixelsSupportedFormat& r) {
+ return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(&r), sizeof(r));
}
- private:
- Key fKey;
- bool fValue;
};
- mutable SkTHashCache<ReadPixelsSupportedFormats,
- ReadPixelsSupportedFormats::Key> fReadPixelsSupportedCache;
+ mutable SkTHashMap<ReadPixelsSupportedFormat, bool, ReadPixelsSupportedFormat::Hash>
+ fReadPixelsSupportedCache;
typedef GrDrawTargetCaps INHERITED;
};
« no previous file with comments | « src/core/SkTHashCache.h ('k') | src/gpu/gl/GrGLCaps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698