summaryrefslogtreecommitdiffstats
path: root/tests/HwAccelerationTest/src/com/android/test/hwui
diff options
context:
space:
mode:
Diffstat (limited to 'tests/HwAccelerationTest/src/com/android/test/hwui')
-rw-r--r--tests/HwAccelerationTest/src/com/android/test/hwui/ScaledTextActivity.java22
1 files changed, 20 insertions, 2 deletions
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ScaledTextActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ScaledTextActivity.java
index e1bf3ea..a4e9b52 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/ScaledTextActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ScaledTextActivity.java
@@ -54,6 +54,7 @@ public class ScaledTextActivity extends Activity {
public ScaledTextView(Context c) {
super(c);
+ setLayerType(LAYER_TYPE_HARDWARE, null);
mPath = makePath();
@@ -92,11 +93,28 @@ public class ScaledTextActivity extends Activity {
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
- canvas.drawARGB(255, 255, 255, 255);
canvas.drawText(TEXT, 30.0f, 30.0f, mPaint);
+ mPaint.setTextAlign(Paint.Align.CENTER);
+ canvas.drawText(TEXT, 30.0f, 50.0f, mPaint);
+ mPaint.setTextAlign(Paint.Align.RIGHT);
+ canvas.drawText(TEXT, 30.0f, 70.0f, mPaint);
- canvas.translate(0.0f, 50.0f);
+ canvas.save();
+ canvas.translate(400.0f, 0.0f);
+ canvas.scale(3.0f, 3.0f);
+ mPaint.setTextAlign(Paint.Align.LEFT);
+ mPaint.setStrikeThruText(true);
+ canvas.drawText(TEXT, 30.0f, 30.0f, mPaint);
+ mPaint.setStrikeThruText(false);
+ mPaint.setTextAlign(Paint.Align.CENTER);
+ canvas.drawText(TEXT, 30.0f, 50.0f, mPaint);
+ mPaint.setTextAlign(Paint.Align.RIGHT);
+ canvas.drawText(TEXT, 30.0f, 70.0f, mPaint);
+ canvas.restore();
+
+ mPaint.setTextAlign(Paint.Align.LEFT);
+ canvas.translate(0.0f, 100.0f);
canvas.save();
canvas.scale(mScale, mScale);