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

Unified Diff: src/gpu/GrResourceCache.h

Issue 88113002: Speed up GrResourceCache lookup by inlining GrBinHashKey comparisons (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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
Index: src/gpu/GrResourceCache.h
diff --git a/src/gpu/GrResourceCache.h b/src/gpu/GrResourceCache.h
index 38378ac77130ffdf45c522ef24ee9474d2aa0bb3..532f7ffc11afe2ee1f73bca37c65057ad82cb5a1 100644
--- a/src/gpu/GrResourceCache.h
+++ b/src/gpu/GrResourceCache.h
@@ -82,18 +82,6 @@ public:
kResourceFlagsOffset);
}
- int compare(const GrResourceKey& other) const {
- return fKey.fHashedKey.compare(other.fKey.fHashedKey);
- }
-
- static bool LT(const GrResourceKey& a, const GrResourceKey& b) {
- return a.compare(b) < 0;
- }
-
- static bool EQ(const GrResourceKey& a, const GrResourceKey& b) {
- return 0 == a.compare(b);
- }
-
inline static bool LT(const GrResourceEntry& entry, const GrResourceKey& key);
inline static bool EQ(const GrResourceEntry& entry, const GrResourceKey& key);
inline static bool LT(const GrResourceEntry& a, const GrResourceEntry& b);
@@ -132,10 +120,6 @@ private:
typedef GrTBinHashKey<Key, kKeySize> HashedKey;
struct Key {
- int compare(const HashedKey& hashedKey) const {
- return fHashedKey.compare(hashedKey);
mtklein 2013/11/26 14:20:43 Does this intermediate Key struct really need to e
Kimmo Kinnunen 2013/11/27 08:16:54 Well, it might not be the only thing in this const
- }
-
HashedKey fHashedKey;
};
@@ -175,19 +159,19 @@ private:
};
bool GrResourceKey::LT(const GrResourceEntry& entry, const GrResourceKey& key) {
- return LT(entry.key(), key);
+ return entry.key().fKey.fHashedKey.LT(key.fKey.fHashedKey);
}
bool GrResourceKey::EQ(const GrResourceEntry& entry, const GrResourceKey& key) {
- return EQ(entry.key(), key);
+ return entry.key().fKey.fHashedKey.EQ(key.fKey.fHashedKey);
}
bool GrResourceKey::LT(const GrResourceEntry& a, const GrResourceEntry& b) {
- return LT(a.key(), b.key());
+ return LT(a, b.key());
}
bool GrResourceKey::EQ(const GrResourceEntry& a, const GrResourceEntry& b) {
- return EQ(a.key(), b.key());
+ return EQ(a, b.key());
}
///////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698