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

Commit b6d04f84 authored by Stephen Hines's avatar Stephen Hines
Browse files

Fix app bug related to same input/output bitmap.

Due to our new bitmap storage optimization, we can't reuse the same
bitmap as input and output safely (since we modify the output directly).
This change updates ImageProcessing to appropriately create a distinct
output Bitmap Allocation and actually use it.

Change-Id: Iecf6c2d203bd1c370b8d0a9fb7e69b419d2eb69b
parent ac2b0238
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -275,7 +275,7 @@ public class ImageProcessingActivity extends Activity
            break;
        }

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

        mTest.runTest();
+2 −2
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ public class TestBase {
        return false;
    }

    public final void createBaseTest(ImageProcessingActivity ipact, Bitmap b, Bitmap b2) {
    public final void createBaseTest(ImageProcessingActivity ipact, Bitmap b, Bitmap b2, Bitmap outb) {
        act = ipact;
        mRS = RenderScript.create(act);
        mRS.setMessageHandler(new MessageProcessor(act));
@@ -117,7 +117,7 @@ public class TestBase {
        mInPixelsAllocation2 = Allocation.createFromBitmap(mRS, b2,
                                                          Allocation.MipmapControl.MIPMAP_NONE,
                                                          Allocation.USAGE_SCRIPT);
        mOutPixelsAllocation = Allocation.createFromBitmap(mRS, b,
        mOutPixelsAllocation = Allocation.createFromBitmap(mRS, outb,
                                                           Allocation.MipmapControl.MIPMAP_NONE,
                                                           Allocation.USAGE_SCRIPT);
        createTest(act.getResources());