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

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

Merge "Add copyFrom(Allocation a)."

parents 6cd677c3 f671fb0b
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.