diff options
author | Yang Ni <yangni@google.com> | 2017-04-20 22:47:34 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-04-20 22:47:34 +0000 |
commit | 0962a6e83c5496bf20aa1663c5d94b88026bd192 (patch) | |
tree | 28604aef1b41a3787e4bd6368773932a98646e35 /rs/java/android/renderscript/ScriptIntrinsicBlur.java | |
parent | 4ad5543b38165f07d1286d9e6712f4955d7961dc (diff) | |
parent | b44f4d2f51f21fa2c91888328612380c86cfedf6 (diff) |
Merge "Validates Intrinsic Blur only takes 2D Allocations"
am: b44f4d2f51
Change-Id: Ib2f8f8206fb77fad99c67d48b839231108e8d0cc
Diffstat (limited to 'rs/java/android/renderscript/ScriptIntrinsicBlur.java')
-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); } |