summaryrefslogtreecommitdiffstats
path: root/tests/HwAccelerationTest
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2014-02-05 16:50:41 -0800
committerChris Craik <ccraik@google.com>2014-02-06 16:07:37 -0800
commit1df26446b7eac7050767c38ca977fde03a41a033 (patch)
tree7a21fd8c7d067b80c704c72e2cf02342b7511c78 /tests/HwAccelerationTest
parentd5154ec2bc7e7c0bdfd14fc784912d390afe43cc (diff)
downloadframeworks_base-1df26446b7eac7050767c38ca977fde03a41a033.zip
frameworks_base-1df26446b7eac7050767c38ca977fde03a41a033.tar.gz
frameworks_base-1df26446b7eac7050767c38ca977fde03a41a033.tar.bz2
Rework and clean up DisplayList projection
Move the projection surface to be a property of a DisplayList, set to true for every background drawable. Additionally, handle a projecting view background such that it doesn't try to project onto itself (which is undesirable). Change-Id: Ic70b17474bd87340e80767f8518f73b233419c7a
Diffstat (limited to 'tests/HwAccelerationTest')
-rw-r--r--tests/HwAccelerationTest/res/layout/projection.xml5
-rw-r--r--tests/HwAccelerationTest/src/com/android/test/hwui/ProjectionActivity.java27
2 files changed, 3 insertions, 29 deletions
diff --git a/tests/HwAccelerationTest/res/layout/projection.xml b/tests/HwAccelerationTest/res/layout/projection.xml
index 564201a..b6e4c5e 100644
--- a/tests/HwAccelerationTest/res/layout/projection.xml
+++ b/tests/HwAccelerationTest/res/layout/projection.xml
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
-<view class="com.android.test.hwui.ProjectionActivity$ProjecteeLayout"
+<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
+ android:background="#66ff0000"
tools:context="com.example.projection.ProjectionActivity"
tools:ignore="MergeRootFrame">
<TextView
@@ -33,4 +34,4 @@
android:layout_height="100dp"
android:textSize="50sp"
android:text="TextView"/>
-</view> \ No newline at end of file
+</LinearLayout> \ No newline at end of file
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ProjectionActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ProjectionActivity.java
index f27652d..208c387 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/ProjectionActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ProjectionActivity.java
@@ -72,33 +72,6 @@ public class ProjectionActivity extends Activity {
}
}
- public static class ProjecteeLayout extends LinearLayout {
- private final Paint mPaint = new Paint();
- private final RectF mRectF = new RectF();
-
- public ProjecteeLayout(Context context) {
- this(context, null);
- }
-
- public ProjecteeLayout(Context context, AttributeSet attrs) {
- this(context, attrs, 0);
- }
-
- public ProjecteeLayout(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- canvas.save(0x20); // secret save flag
- mRectF.set(0, 0, getWidth(), getHeight());
- mPaint.setColor(0x5f000000);
- canvas.drawOval(mRectF, mPaint);
- canvas.restore();
- super.dispatchDraw(canvas);
- }
- }
-
static View container;
@Override