diff options
author | Fabrice Di Meglio <fdimeglio@google.com> | 2011-05-13 18:51:21 -0700 |
---|---|---|
committer | Fabrice Di Meglio <fdimeglio@google.com> | 2011-05-13 18:58:59 -0700 |
commit | 8fb507171f68d4170cfeb1187ee7d1f70f98917d (patch) | |
tree | aa89021b5b9264ab0ae88d85dc05ac55071e0535 /core/jni/android | |
parent | f470ced7cdb10a112a526339f92840587918aa6b (diff) | |
download | frameworks_base-8fb507171f68d4170cfeb1187ee7d1f70f98917d.zip frameworks_base-8fb507171f68d4170cfeb1187ee7d1f70f98917d.tar.gz frameworks_base-8fb507171f68d4170cfeb1187ee7d1f70f98917d.tar.bz2 |
Fix bug #4415576 Gmail text looks broken
- pass correct "contextCount" when needed
Change-Id: I56ebd9486e99e6ca5a3973ec403cf1ced874b4c3
Diffstat (limited to 'core/jni/android')
-rw-r--r-- | core/jni/android/graphics/Canvas.cpp | 2 | ||||
-rw-r--r-- | core/jni/android/graphics/Paint.cpp | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/core/jni/android/graphics/Canvas.cpp b/core/jni/android/graphics/Canvas.cpp index 2dceab9..d9e2c95 100644 --- a/core/jni/android/graphics/Canvas.cpp +++ b/core/jni/android/graphics/Canvas.cpp @@ -777,7 +777,7 @@ public: jint count = end - start; sp<TextLayoutCacheValue> value = gTextLayoutCache.getValue( - paint, textArray, start, count, count, flags); + paint, textArray, start, count, end, flags); if (value == NULL) { LOGE("drawTextWithGlyphs -- cannot get Cache value"); return ; diff --git a/core/jni/android/graphics/Paint.cpp b/core/jni/android/graphics/Paint.cpp index 768b836..64749e9 100644 --- a/core/jni/android/graphics/Paint.cpp +++ b/core/jni/android/graphics/Paint.cpp @@ -335,8 +335,8 @@ public: const jchar* textArray = env->GetCharArrayElements(text, NULL); jfloat result = 0; #if RTL_USE_HARFBUZZ - TextLayout::getTextRunAdvances(paint, textArray, index, count, count, paint->getFlags(), - NULL /* dont need all advances */, result); + TextLayout::getTextRunAdvances(paint, textArray, index, count, textLength, + paint->getFlags(), NULL /* dont need all advances */, result); #else // we double count, since measureText wants a byteLength SkScalar width = paint->measureText(textArray + index, count << 1); @@ -362,8 +362,8 @@ public: jfloat width = 0; #if RTL_USE_HARFBUZZ - TextLayout::getTextRunAdvances(paint, textArray, 0, count, count, paint->getFlags(), - NULL /* dont need all advances */, width); + TextLayout::getTextRunAdvances(paint, textArray, start, count, end, + paint->getFlags(), NULL /* dont need all advances */, width); #else width = SkScalarToFloat(paint->measureText(textArray + start, count << 1)); @@ -381,8 +381,8 @@ public: size_t textLength = env->GetStringLength(text); jfloat width = 0; #if RTL_USE_HARFBUZZ - TextLayout::getTextRunAdvances(paint, textArray, 0, textLength, textLength, paint->getFlags(), - NULL /* dont need all advances */, width); + TextLayout::getTextRunAdvances(paint, textArray, 0, textLength, textLength, + paint->getFlags(), NULL /* dont need all advances */, width); #else width = SkScalarToFloat(paint->measureText(textArray, textLength << 1)); #endif @@ -396,8 +396,8 @@ public: #if RTL_USE_HARFBUZZ jfloat totalAdvance; - TextLayout::getTextRunAdvances(paint, text, 0, count, count, paint->getFlags(), - widthsArray, totalAdvance); + TextLayout::getTextRunAdvances(paint, text, 0, count, count, + paint->getFlags(), widthsArray, totalAdvance); #else SkScalar* scalarArray = (SkScalar*)widthsArray; |