Merge "Update IP2 to use bitmap-backed allocations."

This commit is contained in:
Tim Murray
2013-01-09 18:13:58 -08:00
committed by Android (Google) Code Review
2 changed files with 7 additions and 11 deletions

View File

@@ -229,7 +229,7 @@ public class ImageProcessingActivity2 extends Activity
break;
}
mTest.createBaseTest(this, mBitmapIn, mBitmapIn2);
mTest.createBaseTest(this, mBitmapIn, mBitmapIn2, mBitmapOut);
setupBars();
mTest.runTest();

View File

@@ -88,18 +88,14 @@ public class TestBase {
return false;
}
public final void createBaseTest(ImageProcessingActivity2 ipact, Bitmap b, Bitmap b2) {
public final void createBaseTest(ImageProcessingActivity2 ipact, Bitmap b, Bitmap b2, Bitmap outb) {
act = ipact;
mRS = RenderScript.create(act);
mInPixelsAllocation = Allocation.createFromBitmap(mRS, b,
Allocation.MipmapControl.MIPMAP_NONE,
Allocation.USAGE_SCRIPT);
mInPixelsAllocation2 = Allocation.createFromBitmap(mRS, b2,
Allocation.MipmapControl.MIPMAP_NONE,
Allocation.USAGE_SCRIPT);
mOutPixelsAllocation = Allocation.createFromBitmap(mRS, b,
Allocation.MipmapControl.MIPMAP_NONE,
Allocation.USAGE_SCRIPT);
mInPixelsAllocation = Allocation.createFromBitmap(mRS, b);
mInPixelsAllocation2 = Allocation.createFromBitmap(mRS, b2);
mOutPixelsAllocation = Allocation.createFromBitmap(mRS, outb);
createTest(act.getResources());
}