OSDN Git Service

Correct shadowtext glyph count
authorChris Craik <ccraik@google.com>
Fri, 4 Dec 2015 17:16:58 +0000 (09:16 -0800)
committerChris Craik <ccraik@google.com>
Fri, 4 Dec 2015 17:28:22 +0000 (09:28 -0800)
bug:25837773

Change-Id: Id890624ddce3e5a331ecef207011709be0daf703

libs/hwui/TextDropShadowCache.cpp

index 996ac8e..51f1652 100644 (file)
@@ -83,7 +83,7 @@ int ShadowText::compare(const ShadowText& lhs, const ShadowText& rhs) {
         if (!lhs.positions) return -1;
         if (!rhs.positions) return +1;
 
-        return memcmp(lhs.positions, rhs.positions, lhs.glyphCount << 1);
+        return memcmp(lhs.positions, rhs.positions, lhs.glyphCount * sizeof(float) * 2);
     }
 
     return 0;
@@ -169,7 +169,7 @@ void TextDropShadowCache::clear() {
 
 ShadowTexture* TextDropShadowCache::get(const SkPaint* paint, const char* glyphs, int numGlyphs,
         float radius, const float* positions) {
-    ShadowText entry(paint, radius, numGlyphs * 2, glyphs, positions);
+    ShadowText entry(paint, radius, numGlyphs, glyphs, positions);
     ShadowTexture* texture = mCache.get(entry);
 
     if (!texture) {