From e651cc6239616a202f6e96ebc2ed93b4b8b3627c Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Mon, 14 May 2012 19:44:40 -0700 Subject: Remove all Dalvik allocations from Cavnas.drawBitmap(int[], ...) Change-Id: Ie28538a2104d21154fdc78a56525e7403f08287d --- .../src/com/android/test/hwui/BitmapMutateActivity.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/BitmapMutateActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/BitmapMutateActivity.java index db9017c..0d825d7 100644 --- a/tests/HwAccelerationTest/src/com/android/test/hwui/BitmapMutateActivity.java +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/BitmapMutateActivity.java @@ -87,7 +87,7 @@ public class BitmapMutateActivity extends Activity { int width = mBitmap1.getWidth(); int height = mBitmap1.getHeight(); - canvas.translate((getWidth() - width) / 2, (getHeight() - height) / 2); + canvas.translate((getWidth() - width) / 2, 0); for (int x = 0; x < width; x++) { int color = 0xff000000; @@ -101,6 +101,11 @@ public class BitmapMutateActivity extends Activity { mBitmap1.setPixels(mPixels, 0, width, 0, 0, width, height); canvas.drawBitmap(mBitmap1, 0.0f, 0.0f, mBitmapPaint); + + canvas.save(); + canvas.translate(0.0f, height + 32); + canvas.drawBitmap(mPixels, 0, width, 0.0f, 0.0f, width, height, false, mBitmapPaint); + canvas.restore(); } } } -- cgit v1.1