summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2011-09-27 18:45:57 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-09-27 18:45:57 -0700
commit8f0bb4bc1715ad9aaa486d010ea870ec2f43d245 (patch)
tree689da578a6f3924a91f8ab97d385ef30252c07cb
parent25438e2199fe0083639c76311d698a0a20446349 (diff)
parent5293cea4e05556b4144d9487b47282a21c9f6941 (diff)
downloadframeworks_base-8f0bb4bc1715ad9aaa486d010ea870ec2f43d245.zip
frameworks_base-8f0bb4bc1715ad9aaa486d010ea870ec2f43d245.tar.gz
frameworks_base-8f0bb4bc1715ad9aaa486d010ea870ec2f43d245.tar.bz2
Merge "Fix bug # 5376028 Arabic text is kinda broken - disappearing glyphs"
-rw-r--r--core/jni/android/graphics/TextLayoutCache.cpp19
1 files changed, 4 insertions, 15 deletions
diff --git a/core/jni/android/graphics/TextLayoutCache.cpp b/core/jni/android/graphics/TextLayoutCache.cpp
index c045c07..86ae7d2 100644
--- a/core/jni/android/graphics/TextLayoutCache.cpp
+++ b/core/jni/android/graphics/TextLayoutCache.cpp
@@ -551,8 +551,7 @@ void TextLayoutCacheValue::computeRunValuesWithHarfbuzz(SkPaint* paint, const UC
// Get LogClusters
if (outLogClusters) {
size_t countLogClusters = outLogClusters->size();
- size_t countGlyphs = shaperItem.num_glyphs;
- for (size_t i = 0; i < countGlyphs; i++) {
+ for (size_t i = 0; i < count; i++) {
// As there may be successive runs, we need to shift the log clusters
unsigned short logCluster = shaperItem.log_clusters[i] + countLogClusters;
#if DEBUG_GLYPHS
@@ -620,25 +619,15 @@ void TextLayoutCacheValue::getGlyphsIndexAndCount(size_t start, size_t count, si
*outGlyphsCount = 0;
return;
}
- size_t endIndex = 0;
- for(size_t i = 0; i < mGlyphs.size(); i++) {
- if (mLogClusters[i] <= start) {
- *outStartIndex = i;
- endIndex = i;
- continue;
- }
- if (mLogClusters[i] <= start + count) {
- endIndex = i;
- }
- }
- *outGlyphsCount = endIndex - *outStartIndex + 1;
+ *outStartIndex = mLogClusters[start];
+ *outGlyphsCount = mLogClusters[start + count - 1] - mLogClusters[start] + 1;
#if DEBUG_GLYPHS
LOGD("getGlyphsIndexes - start=%d count=%d - startIndex=%d count=%d", start, count,
*outStartIndex, *outGlyphsCount);
for(size_t i = 0; i < mGlyphs.size(); i++) {
LOGD("getGlyphs - all - glyph[%d] = %d", i, mGlyphs[i]);
}
- for(size_t i = 0; i < mGlyphs.size(); i++) {
+ for(size_t i = 0; i < mAdvances.size(); i++) {
LOGD("getGlyphs - all - logcl[%d] = %d", i, mLogClusters[i]);
}
#endif