Index: src/core/SkGlyph.h |
diff --git a/src/core/SkGlyph.h b/src/core/SkGlyph.h |
index abca215d0039510da7218fcf031770901967e186..469985959cc867d825d31810a57556bb13c2da3f 100644 |
--- a/src/core/SkGlyph.h |
+++ b/src/core/SkGlyph.h |
@@ -8,6 +8,7 @@ |
#ifndef SkGlyph_DEFINED |
#define SkGlyph_DEFINED |
+#include "SkChecksum.h" |
#include "SkTypes.h" |
#include "SkFixed.h" |
#include "SkMask.h" |
@@ -114,6 +115,16 @@ class SkGlyph { |
void toMask(SkMask* mask) const; |
+ class HashTraits { |
+ public: |
+ static uint32_t GetKey(const SkGlyph& glyph) { |
+ return glyph.fID; |
+ } |
+ static uint32_t Hash(uint32_t glyphId) { |
+ return SkChecksum::CheapMix(glyphId); |
+ } |
+ }; |
+ |
private: |
// TODO(herb) remove friend statement after SkGlyphCache cleanup. |
friend class SkGlyphCache; |