Loading core/jni/android/graphics/TextLayoutCache.cpp +18 −2 Original line number Diff line number Diff line Loading @@ -236,6 +236,22 @@ TextLayoutCacheKey::TextLayoutCacheKey(const SkPaint* paint, hinting = paint->getHinting(); } TextLayoutCacheKey::TextLayoutCacheKey(const TextLayoutCacheKey& other) : text(NULL), textCopy(other.textCopy), contextCount(other.contextCount), dirFlags(other.dirFlags), typeface(other.typeface), textSize(other.textSize), textSkewX(other.textSkewX), textScaleX(other.textScaleX), flags(other.flags), hinting(other.hinting) { if (other.text) { textCopy.setTo(other.text); } } bool TextLayoutCacheKey::operator<(const TextLayoutCacheKey& rhs) const { LTE_INT(count) { LTE_INT(contextCount) { Loading @@ -247,7 +263,7 @@ bool TextLayoutCacheKey::operator<(const TextLayoutCacheKey& rhs) const { LTE_INT(flags) { LTE_INT(hinting) { LTE_INT(dirFlags) { return strncmp16(text, rhs.text, contextCount) < 0; return strncmp16(getText(), rhs.getText(), contextCount) < 0; } } } Loading @@ -263,7 +279,7 @@ bool TextLayoutCacheKey::operator<(const TextLayoutCacheKey& rhs) const { void TextLayoutCacheKey::internalTextCopy() { textCopy.setTo(text, contextCount); text = textCopy.string(); text = NULL; } size_t TextLayoutCacheKey::getSize() { Loading core/jni/android/graphics/TextLayoutCache.h +7 −1 Original line number Diff line number Diff line Loading @@ -72,6 +72,8 @@ public: const UChar* text, size_t start, size_t count, size_t contextCount, int dirFlags); TextLayoutCacheKey(const TextLayoutCacheKey& other); bool operator<(const TextLayoutCacheKey& rhs) const; /** Loading @@ -86,7 +88,7 @@ public: size_t getSize(); private: const UChar* text; const UChar* text; // if text is NULL, use textCopy String16 textCopy; size_t start; size_t count; Loading @@ -98,6 +100,10 @@ private: SkScalar textScaleX; uint32_t flags; SkPaint::Hinting hinting; inline const UChar* getText() const { return text ? text : textCopy.string(); } }; // TextLayoutCacheKey /* Loading Loading
core/jni/android/graphics/TextLayoutCache.cpp +18 −2 Original line number Diff line number Diff line Loading @@ -236,6 +236,22 @@ TextLayoutCacheKey::TextLayoutCacheKey(const SkPaint* paint, hinting = paint->getHinting(); } TextLayoutCacheKey::TextLayoutCacheKey(const TextLayoutCacheKey& other) : text(NULL), textCopy(other.textCopy), contextCount(other.contextCount), dirFlags(other.dirFlags), typeface(other.typeface), textSize(other.textSize), textSkewX(other.textSkewX), textScaleX(other.textScaleX), flags(other.flags), hinting(other.hinting) { if (other.text) { textCopy.setTo(other.text); } } bool TextLayoutCacheKey::operator<(const TextLayoutCacheKey& rhs) const { LTE_INT(count) { LTE_INT(contextCount) { Loading @@ -247,7 +263,7 @@ bool TextLayoutCacheKey::operator<(const TextLayoutCacheKey& rhs) const { LTE_INT(flags) { LTE_INT(hinting) { LTE_INT(dirFlags) { return strncmp16(text, rhs.text, contextCount) < 0; return strncmp16(getText(), rhs.getText(), contextCount) < 0; } } } Loading @@ -263,7 +279,7 @@ bool TextLayoutCacheKey::operator<(const TextLayoutCacheKey& rhs) const { void TextLayoutCacheKey::internalTextCopy() { textCopy.setTo(text, contextCount); text = textCopy.string(); text = NULL; } size_t TextLayoutCacheKey::getSize() { Loading
core/jni/android/graphics/TextLayoutCache.h +7 −1 Original line number Diff line number Diff line Loading @@ -72,6 +72,8 @@ public: const UChar* text, size_t start, size_t count, size_t contextCount, int dirFlags); TextLayoutCacheKey(const TextLayoutCacheKey& other); bool operator<(const TextLayoutCacheKey& rhs) const; /** Loading @@ -86,7 +88,7 @@ public: size_t getSize(); private: const UChar* text; const UChar* text; // if text is NULL, use textCopy String16 textCopy; size_t start; size_t count; Loading @@ -98,6 +100,10 @@ private: SkScalar textScaleX; uint32_t flags; SkPaint::Hinting hinting; inline const UChar* getText() const { return text ? text : textCopy.string(); } }; // TextLayoutCacheKey /* Loading