diff options
author | Chris Craik <ccraik@google.com> | 2014-01-26 11:30:58 -0800 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2014-01-29 13:55:39 -0800 |
commit | 6657a6c53930eb0ff8d03317eb10ea7ddb0c49b4 (patch) | |
tree | 37821f1cd1b594c83b6341ce65c1e1847ef1ecf6 /tests/HwAccelerationTest | |
parent | 967c7fb2af23cbdadba45f9113cbcaa9f55c3f24 (diff) | |
download | frameworks_base-6657a6c53930eb0ff8d03317eb10ea7ddb0c49b4.zip frameworks_base-6657a6c53930eb0ff8d03317eb10ea7ddb0c49b4.tar.gz frameworks_base-6657a6c53930eb0ff8d03317eb10ea7ddb0c49b4.tar.bz2 |
Update reordering method names, and make 3d reordering API public
IsContainedVolume -> hasIsolatedZVolume conveys that this affects Z
ordering of views
ProjectToContainedBackground -> ProjectBackwards, since it ended up
using its own projection target, separate from the 3d volume bit
Change-Id: Ia2cde838cc4da134366fe6ff623290fbd65e50c3
Diffstat (limited to 'tests/HwAccelerationTest')
5 files changed, 108 insertions, 1 deletions
diff --git a/tests/HwAccelerationTest/AndroidManifest.xml b/tests/HwAccelerationTest/AndroidManifest.xml index 0ad3456..c8eefe0 100644 --- a/tests/HwAccelerationTest/AndroidManifest.xml +++ b/tests/HwAccelerationTest/AndroidManifest.xml @@ -867,5 +867,14 @@ </intent-filter> </activity> + <activity + android:name="IsolationVolumeActivity" + android:label="Reordering/IsolationVolume"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + <category android:name="com.android.test.hwui.TEST" /> + </intent-filter> + </activity> + </application> </manifest> diff --git a/tests/HwAccelerationTest/res/layout/isolation.xml b/tests/HwAccelerationTest/res/layout/isolation.xml new file mode 100644 index 0000000..802ac7f --- /dev/null +++ b/tests/HwAccelerationTest/res/layout/isolation.xml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="#f55"> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> + <LinearLayout + android:layout_width="0dp" + android:layout_height="150dp" + android:layout_weight="1" + android:isolatedZVolume="false" + android:orientation="vertical"> + <TextView style="@style/TopLeftReorderTextView"/> + <TextView style="@style/BottomLeftReorderTextView"/> + </LinearLayout> + <LinearLayout + android:layout_width="0dp" + android:layout_height="150dp" + android:layout_weight="1" + android:isolatedZVolume="false" + android:orientation="vertical"> + <TextView style="@style/TopRightReorderTextView"/> + <TextView style="@style/BottomRightReorderTextView"/> + </LinearLayout> + </LinearLayout> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> + <LinearLayout + android:layout_width="0dp" + android:layout_height="150dp" + android:layout_weight="1" + android:orientation="vertical"> + <TextView style="@style/TopLeftReorderTextView"/> + <TextView style="@style/BottomLeftReorderTextView"/> + </LinearLayout> + <LinearLayout + android:layout_width="0dp" + android:layout_height="150dp" + android:layout_weight="1" + android:orientation="vertical"> + <TextView style="@style/TopRightReorderTextView"/> + <TextView style="@style/BottomRightReorderTextView"/> + </LinearLayout> + </LinearLayout> +</LinearLayout>
\ No newline at end of file diff --git a/tests/HwAccelerationTest/res/values/styles.xml b/tests/HwAccelerationTest/res/values/styles.xml new file mode 100644 index 0000000..0ffd3d7 --- /dev/null +++ b/tests/HwAccelerationTest/res/values/styles.xml @@ -0,0 +1,34 @@ +<resources> + <style name="ReorderTextView" parent="@android:style/TextAppearance.Medium"> + <item name="android:layout_width">match_parent</item> + <item name="android:layout_height">75dp</item> + <item name="android:gravity">center</item> + </style> + <style name="LeftReorderTextView" parent="@style/ReorderTextView"> + <item name="android:translationX">50dp</item> + </style> + <style name="RightReorderTextView" parent="@style/ReorderTextView"> + <item name="android:translationX">-50dp</item> + </style> + + <style name="TopLeftReorderTextView" parent="@style/LeftReorderTextView"> + <item name="android:background">#666</item> + <item name="android:text">100</item> + <item name="android:translationZ">100dp</item> + </style> + <style name="BottomLeftReorderTextView" parent="@style/LeftReorderTextView"> + <item name="android:background">#bbb</item> + <item name="android:text">300</item> + <item name="android:translationZ">300dp</item> + </style> + <style name="TopRightReorderTextView" parent="@style/RightReorderTextView"> + <item name="android:background">#888</item> + <item name="android:text">200</item> + <item name="android:translationZ">200dp</item> + </style> + <style name="BottomRightReorderTextView" parent="@style/RightReorderTextView"> + <item name="android:background">#ccc</item> + <item name="android:text">400</item> + <item name="android:translationZ">400dp</item> + </style> +</resources> diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/IsolationVolumeActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/IsolationVolumeActivity.java new file mode 100644 index 0000000..d5c93f2 --- /dev/null +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/IsolationVolumeActivity.java @@ -0,0 +1,12 @@ +package com.android.test.hwui; + +import android.os.Bundle; +import android.app.Activity; + +public class IsolationVolumeActivity extends Activity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.isolation); + } +} diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ProjectionActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ProjectionActivity.java index 51a6803..f27652d 100644 --- a/tests/HwAccelerationTest/src/com/android/test/hwui/ProjectionActivity.java +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ProjectionActivity.java @@ -48,7 +48,7 @@ public class ProjectionActivity extends Activity { private void setProject(boolean value) { DisplayList displayList = getDisplayList(); if (displayList != null) { - displayList.setProjectToContainedVolume(value); + displayList.setProjectBackwards(value); } // NOTE: we can't invalidate ProjectedView for the redraw because: // 1) the view won't preserve displayList properties that it doesn't know about |