summaryrefslogtreecommitdiffstats
path: root/tests/HwAccelerationTest
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2012-02-24 17:54:07 -0800
committerRomain Guy <romainguy@google.com>2012-02-24 17:54:07 -0800
commit03d58520c3eb6bb7efb7235bfd957550533d6725 (patch)
tree97b131fd746d7857a005dc2a93d64469ebbcb7fc /tests/HwAccelerationTest
parent325740fb444af8fc7fb0119b2e30ce322c2ae134 (diff)
downloadframeworks_base-03d58520c3eb6bb7efb7235bfd957550533d6725.zip
frameworks_base-03d58520c3eb6bb7efb7235bfd957550533d6725.tar.gz
frameworks_base-03d58520c3eb6bb7efb7235bfd957550533d6725.tar.bz2
More infrastructure for Canvas.drawTextOnPath
Change-Id: Iff42b24e342650d06fa4e2fa9db6c28da820ff01
Diffstat (limited to 'tests/HwAccelerationTest')
-rw-r--r--tests/HwAccelerationTest/src/com/android/test/hwui/TextOnPathActivity.java22
1 files changed, 19 insertions, 3 deletions
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/TextOnPathActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/TextOnPathActivity.java
index 439d029..b798ee7 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/TextOnPathActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/TextOnPathActivity.java
@@ -64,8 +64,8 @@ public class TextOnPathActivity extends Activity {
mPaint.setAntiAlias(true);
mPaint.setColor(0xff000000);
- StringBuilder builder = new StringBuilder(TEST_STRING.length() * 5);
- for (int i = 0; i < 5; i++) {
+ StringBuilder builder = new StringBuilder(TEST_STRING.length() * 2);
+ for (int i = 0; i < 2; i++) {
builder.append(TEST_STRING);
}
mText = builder.toString();
@@ -77,8 +77,24 @@ public class TextOnPathActivity extends Activity {
canvas.drawARGB(255, 255, 255, 255);
- canvas.translate(550.0f, 60.0f);
+ canvas.save();
+ canvas.translate(400.0f, 350.0f);
+ mPaint.setTextAlign(Paint.Align.LEFT);
+ canvas.drawTextOnPath(mText + mText, mPath, 0.0f, 0.0f, mPaint);
+ canvas.restore();
+
+ canvas.save();
+ canvas.translate(150.0f, 60.0f);
+ canvas.drawTextOnPath(mText, mPath, 0.0f, 0.0f, mPaint);
+
+ canvas.translate(250.0f, 0.0f);
+ mPaint.setTextAlign(Paint.Align.CENTER);
+ canvas.drawTextOnPath(mText, mPath, 0.0f, 0.0f, mPaint);
+
+ canvas.translate(250.0f, 0.0f);
+ mPaint.setTextAlign(Paint.Align.RIGHT);
canvas.drawTextOnPath(mText, mPath, 0.0f, 0.0f, mPaint);
+ canvas.restore();
}
}
}