summaryrefslogtreecommitdiffstats
path: root/tests/BiDiTests
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2011-04-05 17:02:36 -0700
committerFabrice Di Meglio <fdimeglio@google.com>2011-04-08 14:37:18 -0700
commitfcf2be1846935e7983ea2fe87fdd4d7af27764b6 (patch)
treeb891830d00d48f63aaf00a665861a056d6e24fc3 /tests/BiDiTests
parentfcdebf88a483faa2f9bbde2b9a4093ca98b2ba6c (diff)
downloadframeworks_base-fcf2be1846935e7983ea2fe87fdd4d7af27764b6.zip
frameworks_base-fcf2be1846935e7983ea2fe87fdd4d7af27764b6.tar.gz
frameworks_base-fcf2be1846935e7983ea2fe87fdd4d7af27764b6.tar.bz2
TextLayoutCache - add glyphs caching
- cache glyphs after Harfbuzz shaping - use "m" prefix for member variables - add temporary API for drawing text with glyphs - update BiDiTest app Change-Id: I619b3f313b15f010018daad21b3e5e486619b4e4
Diffstat (limited to 'tests/BiDiTests')
-rw-r--r--tests/BiDiTests/src/com/android/bidi/BiDiTestView.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/BiDiTests/src/com/android/bidi/BiDiTestView.java b/tests/BiDiTests/src/com/android/bidi/BiDiTestView.java
index cd415c2..f00bd06 100644
--- a/tests/BiDiTests/src/com/android/bidi/BiDiTestView.java
+++ b/tests/BiDiTests/src/com/android/bidi/BiDiTestView.java
@@ -150,11 +150,13 @@ public class BiDiTestView extends View {
drawMetricsAroundText(canvas, x, y, textWidthHB, textWidthICU, textSize, Color.RED, Color.GREEN);
paint.setColor(Color.WHITE);
- char[] glyphs = new char[2*length];
- int count = getGlyphs(text, glyphs, dir);
-
+// char[] glyphs = new char[2*length];
+// int count = getGlyphs(text, glyphs, dir);
+//
// logGlypths(glyphs, count);
- drawTextWithDrawGlyph(canvas, glyphs, count, x, y + currentTextSize);
+// drawTextWithDrawGlyph(canvas, glyphs, count, x, y + currentTextSize);
+
+ drawTextWithGlyphs(canvas, text, x, y + currentTextSize, dir);
// Restore old paint properties
paint.setFakeBoldText(oldFakeBold);
@@ -167,6 +169,11 @@ public class BiDiTestView extends View {
canvas.drawGlyphs(glyphs, 0, count, x, y, paint);
}
+ private void drawTextWithGlyphs(Canvas canvas, String text, int x, int y, int dir) {
+ paint.setBidiFlags(dir);
+ canvas.drawTextWithGlyphs(text, x, y, paint);
+ }
+
private void logGlypths(char[] glyphs, int count) {
Log.v(TAG, "GlyphIds - count=" + count);
for (int n = 0; n < count; n++) {