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

Commit f671fb0b authored by Tim Murray's avatar Tim Murray
Browse files

Add copyFrom(Allocation a).

Change-Id: Ibc334326083b5471584dcf1c068e4e810aede20f
parent bc254b95
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -19196,6 +19196,7 @@ package android.renderscript {
    method public void copyFrom(byte[]);
    method public void copyFrom(float[]);
    method public void copyFrom(android.graphics.Bitmap);
    method public void copyFrom(android.renderscript.Allocation);
    method public void copyFromUnchecked(int[]);
    method public void copyFromUnchecked(short[]);
    method public void copyFromUnchecked(byte[]);
+15 −0
Original line number Diff line number Diff line
@@ -567,6 +567,21 @@ public class Allocation extends BaseObj {
        mRS.nAllocationCopyFromBitmap(getID(mRS), b);
    }

    /**
     * Copy an allocation from an allocation.  The types of both allocations
     * must be identical.
     *
     * @param a the source allocation
     */
    public void copyFrom(Allocation a) {
        mRS.validate();
        if (!mType.equals(a.getType())) {
            throw new RSIllegalArgumentException("Types of allocations must match.");
        }
        copy2DRangeFrom(0, 0, mCurrentDimX, mCurrentDimY, a, 0, 0);
    }


    /**
     * This is only intended to be used by auto-generate code reflected from the
     * renderscript script files.