summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/ScriptIntrinsicBlur.java
diff options
context:
space:
mode:
authorYang Ni <yangni@google.com>2017-04-20 22:37:20 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-04-20 22:37:21 +0000
commitb44f4d2f51f21fa2c91888328612380c86cfedf6 (patch)
tree5d92e65a951913f7c143f26f5dfd9d3df8fa33ee /rs/java/android/renderscript/ScriptIntrinsicBlur.java
parenta070e55e341c03efc3c340d6ab4fad93cb4ab449 (diff)
parentbb671376ff85066499bf59e32d6138a73fb06f91 (diff)
Merge "Validates Intrinsic Blur only takes 2D Allocations"
Diffstat (limited to 'rs/java/android/renderscript/ScriptIntrinsicBlur.java')
-rw-r--r--rs/java/android/renderscript/ScriptIntrinsicBlur.java9
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);
}