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

Commit aa5d5b19 authored by Stephen Hines's avatar Stephen Hines Committed by Android (Google) Code Review
Browse files

Merge "Check Element in all API levels for copy2DRangeFrom()."

parents 00415803 5f528bec
Loading
Loading
Loading
Loading
+4 −20
Original line number Diff line number Diff line
@@ -899,38 +899,22 @@ public class Allocation extends BaseObj {
     * @param data to be placed into the allocation
     */
    public void copy2DRangeFrom(int xoff, int yoff, int w, int h, byte[] data) {
        // We can only validate the type on API 18+, since this check was not present in
        // earlier releases.
        if (mRS.getApplicationContext().getApplicationInfo().targetSdkVersion >= 18) {
        validateIsInt8();
        }
        copy2DRangeFromUnchecked(xoff, yoff, w, h, data);
    }

    public void copy2DRangeFrom(int xoff, int yoff, int w, int h, short[] data) {
        // We can only validate the type on API 18+, since this check was not present in
        // earlier releases.
        if (mRS.getApplicationContext().getApplicationInfo().targetSdkVersion >= 18) {
        validateIsInt16();
        }
        copy2DRangeFromUnchecked(xoff, yoff, w, h, data);
    }

    public void copy2DRangeFrom(int xoff, int yoff, int w, int h, int[] data) {
        // We can only validate the type on API 18+, since this check was not present in
        // earlier releases.
        if (mRS.getApplicationContext().getApplicationInfo().targetSdkVersion >= 18) {
        validateIsInt32();
        }
        copy2DRangeFromUnchecked(xoff, yoff, w, h, data);
    }

    public void copy2DRangeFrom(int xoff, int yoff, int w, int h, float[] data) {
        // We can only validate the type on API 18+, since this check was not present in
        // earlier releases.
        if (mRS.getApplicationContext().getApplicationInfo().targetSdkVersion >= 18) {
        validateIsFloat32();
        }
        copy2DRangeFromUnchecked(xoff, yoff, w, h, data);
    }