diff options
author | Yang Ni <yangni@google.com> | 2017-04-20 23:04:07 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-04-20 23:04:07 +0000 |
commit | 2d5664f68b0b30fe5edd95c10bbe9740c0140d6f (patch) | |
tree | 295f98336be97279a022cf3a634806ce679f0bba /rs | |
parent | e36a8b4ec7a5073250e170dd0b80185858e2ee8d (diff) | |
parent | 5be70d014bc9be603a91e298129e54e9b45ac13a (diff) |
Merge "Validates Intrinsic Blur only takes 2D Allocations" am: b44f4d2f51 am: 0962a6e83c am: cfe40aa165
am: 5be70d014b
Change-Id: Ie79dfe42049354c3bb60de9e9987fc8c75167f30
Diffstat (limited to 'rs')
-rw-r--r-- | rs/java/android/renderscript/ScriptIntrinsicBlur.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/rs/java/android/renderscript/ScriptIntrinsicBlur.java b/rs/java/android/renderscript/ScriptIntrinsicBlur.java index 7a702e877a2e..a36873e34d8c 100644 --- a/rs/java/android/renderscript/ScriptIntrinsicBlur.java +++ b/rs/java/android/renderscript/ScriptIntrinsicBlur.java @@ -59,6 +59,9 @@ public final class ScriptIntrinsicBlur extends ScriptIntrinsic { * @param ain The input allocation */ public void setInput(Allocation ain) { + if (ain.getType().getY() == 0) { + throw new RSIllegalArgumentException("Input set to a 1D Allocation"); + } mInput = ain; setVar(1, ain); } @@ -85,6 +88,9 @@ public final class ScriptIntrinsicBlur extends ScriptIntrinsic { * type. */ public void forEach(Allocation aout) { + if (aout.getType().getY() == 0) { + throw new RSIllegalArgumentException("Output is a 1D Allocation"); + } forEach(0, (Allocation) null, aout, null); } @@ -97,6 +103,9 @@ public final class ScriptIntrinsicBlur extends ScriptIntrinsic { * @param opt LaunchOptions for clipping */ public void forEach(Allocation aout, Script.LaunchOptions opt) { + if (aout.getType().getY() == 0) { + throw new RSIllegalArgumentException("Output is a 1D Allocation"); + } forEach(0, (Allocation) null, aout, null, opt); } |