summaryrefslogtreecommitdiffstats
path: root/core/jni
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2012-05-04 13:11:24 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-05-04 13:11:24 -0700
commite5c67bf7e14392feb54c26b7576b4d6c36b0068e (patch)
tree5bfe340935de640fd4cf48440ab029c734ff93af /core/jni
parenta1f084e8a22385d8ab4ea8a2e5bb6abf1768f8bb (diff)
parentb294435b5c6e0fee8c431ed3f6d77427d3d79dde (diff)
downloadframeworks_base-e5c67bf7e14392feb54c26b7576b4d6c36b0068e.zip
frameworks_base-e5c67bf7e14392feb54c26b7576b4d6c36b0068e.tar.gz
frameworks_base-e5c67bf7e14392feb54c26b7576b4d6c36b0068e.tar.bz2
Merge "Make Arabic script runs longer (for performance) - bug 6426451." into jb-dev
Diffstat (limited to 'core/jni')
-rw-r--r--core/jni/android/graphics/TextLayoutCache.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/jni/android/graphics/TextLayoutCache.cpp b/core/jni/android/graphics/TextLayoutCache.cpp
index a33b46a..0d36edf 100644
--- a/core/jni/android/graphics/TextLayoutCache.cpp
+++ b/core/jni/android/graphics/TextLayoutCache.cpp
@@ -849,7 +849,11 @@ size_t TextLayoutShaper::shapeFontRun(const SkPaint* paint, bool isRTL) {
case HB_Script_Tamil:
case HB_Script_Thai:{
const uint16_t* text16 = (const uint16_t*)(mShaperItem.string + mShaperItem.item.pos);
+ const uint16_t* text16End = text16 + mShaperItem.item.length;
SkUnichar firstUnichar = SkUTF16_NextUnichar(&text16);
+ while (firstUnichar == ' ' && text16 < text16End) {
+ firstUnichar = SkUTF16_NextUnichar(&text16);
+ }
baseGlyphCount = paint->getBaseGlyphCount(firstUnichar);
break;
}