diff options
author | Romain Guy <romainguy@google.com> | 2011-01-23 16:15:02 -0800 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2011-01-23 16:15:02 -0800 |
commit | 8b2f5267f16c295f12faab810527cd6311997e34 (patch) | |
tree | 2f81ab177ebfadee474c44f3aa8e44cdc539665e /tests/HwAccelerationTest | |
parent | c1cd9ba335b293f11e1082447ef08e474710a05f (diff) | |
download | frameworks_base-8b2f5267f16c295f12faab810527cd6311997e34.zip frameworks_base-8b2f5267f16c295f12faab810527cd6311997e34.tar.gz frameworks_base-8b2f5267f16c295f12faab810527cd6311997e34.tar.bz2 |
Add support for arcs.
Change-Id: I96c057ff4eb1b464b03f132da0b85333777bee4f
Diffstat (limited to 'tests/HwAccelerationTest')
-rw-r--r-- | tests/HwAccelerationTest/src/com/android/test/hwui/ShapesActivity.java | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ShapesActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ShapesActivity.java index ddf43d7..97e5526 100644 --- a/tests/HwAccelerationTest/src/com/android/test/hwui/ShapesActivity.java +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ShapesActivity.java @@ -39,6 +39,7 @@ public class ShapesActivity extends Activity { private Paint mFillPaint; private RectF mRect; private RectF mOval; + private RectF mArc; ShapesView(Context c) { super(c); @@ -63,6 +64,7 @@ public class ShapesActivity extends Activity { mFillPaint.setStyle(Paint.Style.FILL); mOval = new RectF(0.0f, 0.0f, 80.0f, 45.0f); + mArc = new RectF(0.0f, 0.0f, 100.0f, 120.0f); } @Override @@ -103,7 +105,7 @@ public class ShapesActivity extends Activity { canvas.restore(); canvas.save(); - canvas.translate(650.0f, 50.0f); + canvas.translate(625.0f, 50.0f); canvas.drawRect(0.0f, 0.0f, 160.0f, 90.0f, mNormalPaint); canvas.translate(0.0f, 110.0f); @@ -112,6 +114,28 @@ public class ShapesActivity extends Activity { canvas.translate(0.0f, 110.0f); canvas.drawRect(0.0f, 0.0f, 160.0f, 90.0f, mFillPaint); canvas.restore(); + + canvas.save(); + canvas.translate(825.0f, 50.0f); + canvas.drawArc(mArc, -30.0f, 70.0f, true, mNormalPaint); + + canvas.translate(0.0f, 110.0f); + canvas.drawArc(mArc, -30.0f, 70.0f, true, mStrokePaint); + + canvas.translate(0.0f, 110.0f); + canvas.drawArc(mArc, -30.0f, 70.0f, true, mFillPaint); + canvas.restore(); + + canvas.save(); + canvas.translate(950.0f, 50.0f); + canvas.drawArc(mArc, 30.0f, 100.0f, false, mNormalPaint); + + canvas.translate(0.0f, 110.0f); + canvas.drawArc(mArc, 30.0f, 100.0f, false, mStrokePaint); + + canvas.translate(0.0f, 110.0f); + canvas.drawArc(mArc, 30.0f, 100.0f, false, mFillPaint); + canvas.restore(); } } } |