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

Unified Diff: src/core/SkPictureFlat.h

Issue 222473002: SkTDynamicHash: pick up GetKey(), Hash() from T by default. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 9 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 | « no previous file | src/core/SkScaledImageCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPictureFlat.h
diff --git a/src/core/SkPictureFlat.h b/src/core/SkPictureFlat.h
index f63b9c10a72495c1fe22758ae035c9e990cc621d..49281146607a71674939920d2f78ceee0e04df5b 100644
--- a/src/core/SkPictureFlat.h
+++ b/src/core/SkPictureFlat.h
@@ -335,9 +335,10 @@ public:
}
private:
- // For SkTDynamicHash.
- static const SkFlatData& Identity(const SkFlatData& flat) { return flat; }
- static uint32_t Hash(const SkFlatData& flat) { return flat.checksum(); }
+ struct HashTraits {
+ static const SkFlatData& GetKey(const SkFlatData& flat) { return flat; }
+ static uint32_t Hash(const SkFlatData& flat) { return flat.checksum(); }
+ };
void setIndex(int index) { fIndex = index; }
uint8_t* data() { return (uint8_t*)this + sizeof(*this); }
@@ -563,7 +564,7 @@ private:
SkTDArray<const SkFlatData*> fIndexedData;
// For SkFlatData -> cached SkFlatData, which has index().
- SkTDynamicHash<SkFlatData, SkFlatData, SkFlatData::Identity, SkFlatData::Hash> fHash;
+ SkTDynamicHash<SkFlatData, SkFlatData, SkFlatData::HashTraits> fHash;
};
typedef SkFlatDictionary<SkPaint, SkPaint::FlatteningTraits> SkPaintDictionary;
« no previous file with comments | « no previous file | src/core/SkScaledImageCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698