summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/jni/android/graphics/Canvas.cpp10
-rw-r--r--core/jni/android/graphics/TextLayout.h8
-rw-r--r--core/jni/android/graphics/TextLayoutCache.cpp11
-rw-r--r--core/jni/android_view_GLES20Canvas.cpp6
4 files changed, 12 insertions, 23 deletions
diff --git a/core/jni/android/graphics/Canvas.cpp b/core/jni/android/graphics/Canvas.cpp
index f8be136f4866..b01dcd8306eb 100644
--- a/core/jni/android/graphics/Canvas.cpp
+++ b/core/jni/android/graphics/Canvas.cpp
@@ -770,11 +770,7 @@ public:
value->computeValues(paint, textArray, start, count, end, flags);
#endif
-#if DEBUG_GLYPHS
- logGlyphs(value);
-#endif
-
- doDrawGlyphs(canvas, value->getGlyphs(), 0, value->getGlyphsCount(),
+ doDrawGlyphs(canvas, value->getGlyphs(), 0, value->getGlyphsCount(),
x, y, flags, paint);
}
@@ -794,10 +790,6 @@ public:
value->computeValues(paint, textArray, start, count, contextCount, flags);
#endif
-#if DEBUG_GLYPHS
- logGlyphs(value);
-#endif
-
doDrawGlyphs(canvas, value->getGlyphs(), 0, value->getGlyphsCount(),
x, y, flags, paint);
}
diff --git a/core/jni/android/graphics/TextLayout.h b/core/jni/android/graphics/TextLayout.h
index d197d043e4bb..9bb1b921675a 100644
--- a/core/jni/android/graphics/TextLayout.h
+++ b/core/jni/android/graphics/TextLayout.h
@@ -64,14 +64,6 @@ enum {
kDirection_Mask = 0x1
};
-static void logGlyphs(sp<TextLayoutCacheValue> value) {
- if (value == NULL) return;
- LOGD("Got glyphs - count=%d", value->getGlyphsCount());
- for (size_t i = 0; i < value->getGlyphsCount(); i++) {
- LOGD(" glyphs[%d]=%d", i, value->getGlyphs()[i]);
- }
-}
-
class TextLayout {
public:
diff --git a/core/jni/android/graphics/TextLayoutCache.cpp b/core/jni/android/graphics/TextLayoutCache.cpp
index 89440c9dc0bd..f04c5eb5f24e 100644
--- a/core/jni/android/graphics/TextLayoutCache.cpp
+++ b/core/jni/android/graphics/TextLayoutCache.cpp
@@ -554,6 +554,15 @@ void TextLayoutCacheValue::computeValuesWithHarfbuzz(SkPaint* paint, const UChar
#endif
}
+static void logGlyphs(HB_ShaperItem shaperItem) {
+ LOGD("Got glyphs - count=%d", shaperItem.num_glyphs);
+ for (size_t i = 0; i < shaperItem.num_glyphs; i++) {
+ LOGD(" glyphs[%d]=%d - offset.x=%f offset.y=%f", i, shaperItem.glyphs[i],
+ HBFixedToFloat(shaperItem.offsets[i].x),
+ HBFixedToFloat(shaperItem.offsets[i].y));
+ }
+}
+
void TextLayoutCacheValue::computeRunValuesWithHarfbuzz(SkPaint* paint, const UChar* chars,
size_t start, size_t count, size_t contextCount, bool isRTL,
jfloat* outAdvances, jfloat* outTotalAdvance,
@@ -570,6 +579,8 @@ void TextLayoutCacheValue::computeRunValuesWithHarfbuzz(SkPaint* paint, const UC
shaperItem.kerning_applied);
LOGD(" -- string= '%s'", String8(chars + start, count).string());
LOGD(" -- isDevKernText=%d", paint->isDevKernText());
+
+ logGlyphs(shaperItem);
#endif
if (shaperItem.advances == NULL || shaperItem.num_glyphs == 0) {
diff --git a/core/jni/android_view_GLES20Canvas.cpp b/core/jni/android_view_GLES20Canvas.cpp
index 80c79fd9dbdc..fb5e5fe0bfe3 100644
--- a/core/jni/android_view_GLES20Canvas.cpp
+++ b/core/jni/android_view_GLES20Canvas.cpp
@@ -472,9 +472,6 @@ static void renderText(OpenGLRenderer* renderer, const jchar* text, int count,
value = new TextLayoutCacheValue();
value->computeValues(paint, text, 0, count, count, flags);
#endif
-#if DEBUG_GLYPHS
- logGlyphs(value);
-#endif
const jchar* glyphArray = value->getGlyphs();
int glyphCount = value->getGlyphsCount();
int bytesCount = glyphCount * sizeof(jchar);
@@ -505,9 +502,6 @@ static void renderTextRun(OpenGLRenderer* renderer, const jchar* text,
value = new TextLayoutCacheValue();
value->computeValues(paint, text, start, count, contextCount, flags);
#endif
-#if DEBUG_GLYPHS
- logGlyphs(value);
-#endif
const jchar* glyphArray = value->getGlyphs();
int glyphCount = value->getGlyphsCount();
int bytesCount = glyphCount * sizeof(jchar);