Chromium Code Reviews| Index: src/core/SkGlyph.h |
| diff --git a/src/core/SkGlyph.h b/src/core/SkGlyph.h |
| index abca215d0039510da7218fcf031770901967e186..2db54bf86909a7d063fd65a1e6ec4218025a4326 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 GlyphHashTraits { |
|
mtklein
2015/07/21 19:35:52
Seems fine, but now that you're scoped here, HashT
herb_g
2015/07/21 22:27:34
Done.
|
| + public: |
| + static uint32_t GetKey(const SkGlyph& glyph) { |
| + return glyph.fID; |
| + } |
| + static uint32_t Hash(uint32_t glyphId) { |
| + return SkChecksum::CheapMix(glyphId); |
|
mtklein
2015/07/21 19:35:52
If we're seeing a lot of time spent looking throug
herb_g
2015/07/21 22:27:34
I think I'm going to work on tuning the hashing ta
mtklein
2015/07/21 22:30:30
Oh, yeah, most definitely another CL. SGTM!
|
| + } |
| + }; |
| + |
| private: |
| // TODO(herb) remove friend statement after SkGlyphCache cleanup. |
| friend class SkGlyphCache; |