diff options
author | Romain Guy <romainguy@google.com> | 2010-06-22 13:11:24 -0700 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2010-06-22 13:11:24 -0700 |
commit | 85bf02fc16784d935fb9eebfa9cb20fe46ff7951 (patch) | |
tree | 7d8cb5d36bca58555a33e8647afd8f0e00647b7b /tests/HwAccelerationTest | |
parent | 102fb89b9a4d2a6620f88b247405f853d78a09b6 (diff) | |
download | frameworks_base-85bf02fc16784d935fb9eebfa9cb20fe46ff7951.zip frameworks_base-85bf02fc16784d935fb9eebfa9cb20fe46ff7951.tar.gz frameworks_base-85bf02fc16784d935fb9eebfa9cb20fe46ff7951.tar.bz2 |
Fix the simulator build.
Change-Id: Ie404f7c2c308f0657f273af19a56e8c039b61898
Diffstat (limited to 'tests/HwAccelerationTest')
-rw-r--r-- | tests/HwAccelerationTest/src/com/google/android/test/hwui/HwUiActivity.java | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/tests/HwAccelerationTest/src/com/google/android/test/hwui/HwUiActivity.java b/tests/HwAccelerationTest/src/com/google/android/test/hwui/HwUiActivity.java index 1ee2dc1..d24f027 100644 --- a/tests/HwAccelerationTest/src/com/google/android/test/hwui/HwUiActivity.java +++ b/tests/HwAccelerationTest/src/com/google/android/test/hwui/HwUiActivity.java @@ -36,46 +36,21 @@ public class HwUiActivity extends Activity { setContentView(new DirtyBitmapView(this)); } + @SuppressWarnings({"UnusedDeclaration"}) static int dipToPx(Context c, int dip) { return (int) (c.getResources().getDisplayMetrics().density * dip + 0.5f); } static class DirtyBitmapView extends View { - private Bitmap mCache; - DirtyBitmapView(Context c) { super(c); - - final int width = dipToPx(c, 100); - final int height = dipToPx(c, 100); - - mCache = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); - logGenerationId("Dirty cache created", mCache); - - Canvas canvas = new Canvas(mCache); - logGenerationId("Canvas cache created", mCache); - - canvas.drawColor(0xffff0000); - logGenerationId("Cache filled", mCache); - - Paint p = new Paint(); - p.setColor(0xff0000ff); - - canvas.drawRect(width / 2.0f, height / 2.0f, width, height, p); - logGenerationId("Cache modified", mCache); - } - - private static void logGenerationId(String message, Bitmap b) { - d(LOG_TAG, message); - d(LOG_TAG, " bitmap id=" + b.getGenerationId()); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); - - canvas.drawBitmap(mCache, 0, 0, null); - logGenerationId("Cache drawn", mCache); + + canvas.drawRGB(255, 0, 0); } } } |