use 8 bits for fontcache hash

git-svn-id: http://skia.googlecode.com/svn/trunk@9532 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2013-06-12 17:14:37 +00:00
parent c26523067a
commit b8b619a158

View File

@ -241,15 +241,10 @@ private:
// no reason to use the same kHashCount as fGlyphHash, but we do for now
CharGlyphRec fCharToGlyphHash[kHashCount];
enum {
// shift so that the top bits fall into kHashBits region
kShiftForHashIndex = SkGlyph::kSubShift +
SkGlyph::kSubBits*2 -
kHashBits
};
static inline unsigned ID2HashIndex(uint32_t id) {
return (id ^ (id >> kShiftForHashIndex)) & kHashMask;
id ^= id >> 16;
id ^= id >> 8;
return id & kHashMask;
}
// used to track (approx) how much ram is tied-up in this cache