diff options
author | Tim Murray <timmurray@google.com> | 2012-10-17 15:51:48 -0700 |
---|---|---|
committer | Tim Murray <timmurray@google.com> | 2012-10-17 15:51:48 -0700 |
commit | 57b35572cc2780b83d1dc239b24fae51c9fbd561 (patch) | |
tree | 1900d8f3a65362acb3040310bcb496cf5d9e2b27 /tests/RenderScriptTests | |
parent | 1c80844464fbe977c5303cd56af9abb81a2bc218 (diff) | |
download | frameworks_base-57b35572cc2780b83d1dc239b24fae51c9fbd561.zip frameworks_base-57b35572cc2780b83d1dc239b24fae51c9fbd561.tar.gz frameworks_base-57b35572cc2780b83d1dc239b24fae51c9fbd561.tar.bz2 |
Remove copyBitmap from ImageProcessing.
Change-Id: Ib9079fab3b3d3da429f32c4c6688e6c437eb8795
Diffstat (limited to 'tests/RenderScriptTests')
-rw-r--r-- | tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java index db0ef78..445751e 100644 --- a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java +++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java @@ -296,7 +296,8 @@ public class ImageProcessingActivity extends Activity mBitmapIn = loadBitmap(R.drawable.img1600x1067); mBitmapIn2 = loadBitmap(R.drawable.img1600x1067b); - mBitmapOut = loadBitmap(R.drawable.img1600x1067); + mBitmapOut = Bitmap.createBitmap(mBitmapIn.getWidth(), mBitmapIn.getHeight(), + mBitmapIn.getConfig()); mSurfaceView = (SurfaceView) findViewById(R.id.surface); @@ -337,15 +338,7 @@ public class ImageProcessingActivity extends Activity private Bitmap loadBitmap(int resource) { final BitmapFactory.Options options = new BitmapFactory.Options(); options.inPreferredConfig = Bitmap.Config.ARGB_8888; - return copyBitmap(BitmapFactory.decodeResource(getResources(), resource, options)); - } - - private static Bitmap copyBitmap(Bitmap source) { - Bitmap b = Bitmap.createBitmap(source.getWidth(), source.getHeight(), source.getConfig()); - Canvas c = new Canvas(b); - c.drawBitmap(source, 0, 0, null); - source.recycle(); - return b; + return BitmapFactory.decodeResource(getResources(), resource, options); } // button hook |