diff options
author | Chris Craik <ccraik@google.com> | 2016-02-05 20:10:50 -0800 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2016-02-08 22:45:22 +0000 |
commit | e8c3c813b0e3ac98304b17a751ce6e436e252bd9 (patch) | |
tree | 90835064430759a497f20787e20b353a4e45af3f /libs/hwui/TextDropShadowCache.cpp | |
parent | 901bbe066762a644ec0790de8b07199f4464bb4f (diff) |
Fix TextDropShadowCacheTests and glyph_t everywhere
Change-Id: I943eae4e9408c77bdfba6304ba7ee3e862351a41
Diffstat (limited to 'libs/hwui/TextDropShadowCache.cpp')
-rw-r--r-- | libs/hwui/TextDropShadowCache.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libs/hwui/TextDropShadowCache.cpp b/libs/hwui/TextDropShadowCache.cpp index fe4b3d7507b2..e1f0b2a20172 100644 --- a/libs/hwui/TextDropShadowCache.cpp +++ b/libs/hwui/TextDropShadowCache.cpp @@ -37,9 +37,9 @@ hash_t ShadowText::hash() const { hash = JenkinsHashMix(hash, flags); hash = JenkinsHashMix(hash, android::hash_type(italicStyle)); hash = JenkinsHashMix(hash, android::hash_type(scaleX)); - if (text) { + if (glyphs) { hash = JenkinsHashMixShorts( - hash, reinterpret_cast<const uint16_t*>(text), glyphCount); + hash, reinterpret_cast<const uint16_t*>(glyphs), glyphCount); } if (positions) { for (uint32_t i = 0; i < glyphCount * 2; i++) { @@ -71,11 +71,11 @@ int ShadowText::compare(const ShadowText& lhs, const ShadowText& rhs) { if (lhs.scaleX < rhs.scaleX) return -1; if (lhs.scaleX > rhs.scaleX) return +1; - if (lhs.text != rhs.text) { - if (!lhs.text) return -1; - if (!rhs.text) return +1; + if (lhs.glyphs != rhs.glyphs) { + if (!lhs.glyphs) return -1; + if (!rhs.glyphs) return +1; - deltaInt = memcmp(lhs.text, rhs.text, lhs.glyphCount * sizeof(glyph_t)); + deltaInt = memcmp(lhs.glyphs, rhs.glyphs, lhs.glyphCount * sizeof(glyph_t)); if (deltaInt != 0) return deltaInt; } @@ -145,7 +145,7 @@ void TextDropShadowCache::clear() { mCache.clear(); } -ShadowTexture* TextDropShadowCache::get(const SkPaint* paint, const char* glyphs, int numGlyphs, +ShadowTexture* TextDropShadowCache::get(const SkPaint* paint, const glyph_t* glyphs, int numGlyphs, float radius, const float* positions) { ShadowText entry(paint, radius, numGlyphs, glyphs, positions); ShadowTexture* texture = mCache.get(entry); |