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

Commit 5f528bec authored by Stephen Hines's avatar Stephen Hines
Browse files

Check Element in all API levels for copy2DRangeFrom().

Change-Id: I561317671a16888fc9f35908ab1ae1489a14fc6c
parent a9a7b374
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);
    }