summaryrefslogtreecommitdiffstats
path: root/tests/HwAccelerationTest
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-09-15 18:11:50 -0700
committerRomain Guy <romainguy@google.com>2010-09-15 18:11:50 -0700
commit6820ac8b14b4558f5d8b833dde80895306a3e137 (patch)
treeb90f253c05f20ae8a36c7bdc49147d447b75e7d5 /tests/HwAccelerationTest
parent9322775014432ed6c87c864e98fe482f879ff233 (diff)
downloadframeworks_base-6820ac8b14b4558f5d8b833dde80895306a3e137.zip
frameworks_base-6820ac8b14b4558f5d8b833dde80895306a3e137.tar.gz
frameworks_base-6820ac8b14b4558f5d8b833dde80895306a3e137.tar.bz2
Fix 9patch rendering.
Change-Id: Ic4c18ff483cca95fbabcb10843f7714efe488adb
Diffstat (limited to 'tests/HwAccelerationTest')
-rw-r--r--tests/HwAccelerationTest/res/drawable/patch.9.pngbin0 -> 2863 bytes
-rw-r--r--tests/HwAccelerationTest/src/com/android/test/hwui/ThinPatchesActivity.java14
2 files changed, 10 insertions, 4 deletions
diff --git a/tests/HwAccelerationTest/res/drawable/patch.9.png b/tests/HwAccelerationTest/res/drawable/patch.9.png
new file mode 100644
index 0000000..e3b3639
--- /dev/null
+++ b/tests/HwAccelerationTest/res/drawable/patch.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ThinPatchesActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ThinPatchesActivity.java
index d374c32..4f605fa 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/ThinPatchesActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ThinPatchesActivity.java
@@ -41,13 +41,14 @@ public class ThinPatchesActivity extends Activity {
}
private class PatchView extends View {
- private Drawable mPatch;
+ private Drawable mPatch1, mPatch2;
public PatchView(Activity activity) {
super(activity);
final Resources resources = activity.getResources();
- mPatch = resources.getDrawable(R.drawable.btn_toggle_on);
+ mPatch1 = resources.getDrawable(R.drawable.patch);
+ mPatch2 = resources.getDrawable(R.drawable.btn_toggle_on);
}
@Override
@@ -58,8 +59,13 @@ public class ThinPatchesActivity extends Activity {
final int left = (getWidth() - width) / 2;
final int top = (getHeight() - height) / 2;
- mPatch.setBounds(left, top, left + width, top + height);
- mPatch.draw(canvas);
+ mPatch1.setBounds(left, top, left + width, top + height);
+ mPatch1.draw(canvas);
+
+ canvas.translate(0.0f, height + 20.0f);
+
+ mPatch2.setBounds(left, top, left + width, top + height);
+ mPatch2.draw(canvas);
}
}
}