summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-01-23 14:18:41 -0800
committerRomain Guy <romainguy@google.com>2011-01-23 14:18:41 -0800
commitc1cd9ba335b293f11e1082447ef08e474710a05f (patch)
tree3f07bf1887e0cd5602c2f1e356e3efe92d7f766b /tests
parentf6834478b379856d3e5de92ddce7de0e6ba9fa4a (diff)
downloadframeworks_base-c1cd9ba335b293f11e1082447ef08e474710a05f.zip
frameworks_base-c1cd9ba335b293f11e1082447ef08e474710a05f.tar.gz
frameworks_base-c1cd9ba335b293f11e1082447ef08e474710a05f.tar.bz2
Add support for ovals and stroked rectangles.
Change-Id: I1292e241386763c82e6622c8f7ed90b0f5b7bd4f
Diffstat (limited to 'tests')
-rw-r--r--tests/HwAccelerationTest/src/com/android/test/hwui/ShapesActivity.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ShapesActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ShapesActivity.java
index 536a669..ddf43d7 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/ShapesActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ShapesActivity.java
@@ -38,6 +38,7 @@ public class ShapesActivity extends Activity {
private Paint mStrokePaint;
private Paint mFillPaint;
private RectF mRect;
+ private RectF mOval;
ShapesView(Context c) {
super(c);
@@ -60,6 +61,8 @@ public class ShapesActivity extends Activity {
mFillPaint.setAntiAlias(true);
mFillPaint.setColor(0xff0000ff);
mFillPaint.setStyle(Paint.Style.FILL);
+
+ mOval = new RectF(0.0f, 0.0f, 80.0f, 45.0f);
}
@Override
@@ -87,6 +90,28 @@ public class ShapesActivity extends Activity {
canvas.translate(0.0f, 110.0f);
canvas.drawCircle(80.0f, 45.0f, 45.0f, mFillPaint);
canvas.restore();
+
+ canvas.save();
+ canvas.translate(450.0f, 50.0f);
+ canvas.drawOval(mOval, mNormalPaint);
+
+ canvas.translate(0.0f, 110.0f);
+ canvas.drawOval(mOval, mStrokePaint);
+
+ canvas.translate(0.0f, 110.0f);
+ canvas.drawOval(mOval, mFillPaint);
+ canvas.restore();
+
+ canvas.save();
+ canvas.translate(650.0f, 50.0f);
+ canvas.drawRect(0.0f, 0.0f, 160.0f, 90.0f, mNormalPaint);
+
+ canvas.translate(0.0f, 110.0f);
+ canvas.drawRect(0.0f, 0.0f, 160.0f, 90.0f, mStrokePaint);
+
+ canvas.translate(0.0f, 110.0f);
+ canvas.drawRect(0.0f, 0.0f, 160.0f, 90.0f, mFillPaint);
+ canvas.restore();
}
}
}