Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d1127ef authored by Tim Murray's avatar Tim Murray Committed by Android (Google) Code Review
Browse files

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

parents 978ad10c f9485d03
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -229,7 +229,7 @@ public class ImageProcessingActivity2 extends Activity
            break;
        }

        mTest.createBaseTest(this, mBitmapIn, mBitmapIn2);
        mTest.createBaseTest(this, mBitmapIn, mBitmapIn2, mBitmapOut);
        setupBars();

        mTest.runTest();
+6 −10
Original line number Diff line number Diff line
@@ -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());
    }