Loading libs/hwui/TextDropShadowCache.cpp +8 −4 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ namespace uirenderer { /////////////////////////////////////////////////////////////////////////////// hash_t ShadowText::hash() const { uint32_t charCount = len * sizeof(char16_t); uint32_t charCount = len / sizeof(char16_t); uint32_t hash = JenkinsHashMix(0, len); hash = JenkinsHashMix(hash, android::hash_type(radius)); hash = JenkinsHashMix(hash, android::hash_type(textSize)); Loading @@ -38,10 +38,14 @@ 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) { hash = JenkinsHashMixShorts(hash, text, charCount); } if (positions) { for (uint32_t i = 0; i < charCount * 2; i++) { hash = JenkinsHashMix(hash, android::hash_type(positions[i])); } } return JenkinsHashWhiten(hash); } Loading libs/hwui/TextDropShadowCache.h +4 −2 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ struct ShadowText { flags(0), italicStyle(0.0f), scaleX(0), text(NULL), positions(NULL) { } // len is the number of bytes in text ShadowText(SkPaint* paint, float radius, uint32_t len, const char* srcText, const float* positions): len(len), radius(radius), positions(positions) { Loading Loading @@ -69,11 +70,12 @@ struct ShadowText { } void copyTextLocally() { str.setTo((const char16_t*) text, len * sizeof(char16_t)); uint32_t charCount = len / sizeof(char16_t); str.setTo((const char16_t*) text, charCount); text = str.string(); if (positions != NULL) { positionsCopy.clear(); positionsCopy.appendArray(positions, len); positionsCopy.appendArray(positions, charCount * 2); positions = positionsCopy.array(); } } Loading Loading
libs/hwui/TextDropShadowCache.cpp +8 −4 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ namespace uirenderer { /////////////////////////////////////////////////////////////////////////////// hash_t ShadowText::hash() const { uint32_t charCount = len * sizeof(char16_t); uint32_t charCount = len / sizeof(char16_t); uint32_t hash = JenkinsHashMix(0, len); hash = JenkinsHashMix(hash, android::hash_type(radius)); hash = JenkinsHashMix(hash, android::hash_type(textSize)); Loading @@ -38,10 +38,14 @@ 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) { hash = JenkinsHashMixShorts(hash, text, charCount); } if (positions) { for (uint32_t i = 0; i < charCount * 2; i++) { hash = JenkinsHashMix(hash, android::hash_type(positions[i])); } } return JenkinsHashWhiten(hash); } Loading
libs/hwui/TextDropShadowCache.h +4 −2 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ struct ShadowText { flags(0), italicStyle(0.0f), scaleX(0), text(NULL), positions(NULL) { } // len is the number of bytes in text ShadowText(SkPaint* paint, float radius, uint32_t len, const char* srcText, const float* positions): len(len), radius(radius), positions(positions) { Loading Loading @@ -69,11 +70,12 @@ struct ShadowText { } void copyTextLocally() { str.setTo((const char16_t*) text, len * sizeof(char16_t)); uint32_t charCount = len / sizeof(char16_t); str.setTo((const char16_t*) text, charCount); text = str.string(); if (positions != NULL) { positionsCopy.clear(); positionsCopy.appendArray(positions, len); positionsCopy.appendArray(positions, charCount * 2); positions = positionsCopy.array(); } } Loading