Fix range on blur intrinsic.
The intrinsic fails when the radius was 0. A blur
of radius 0 is a nop and should be disallowed. Fix the
test to allow sub-pixel radius to be selected.
bug 7273437
Change-Id: I2805674e29d557615eb7ac65c7910d4dffa28b58
diff --git a/graphics/java/android/renderscript/ScriptIntrinsicBlur.java b/graphics/java/android/renderscript/ScriptIntrinsicBlur.java
index 61e5d4f..2a04b42 100644
--- a/graphics/java/android/renderscript/ScriptIntrinsicBlur.java
+++ b/graphics/java/android/renderscript/ScriptIntrinsicBlur.java
@@ -69,13 +69,13 @@
/**
* Set the radius of the Blur.
*
- * Supported range 0-25
+ * Supported range 0 < radius <= 25
*
* @param radius The radius of the blur
*/
public void setRadius(float radius) {
- if (radius < 0 || radius > 25) {
- throw new RSIllegalArgumentException("Radius out of range (0-25).");
+ if (radius <= 0 || radius > 25) {
+ throw new RSIllegalArgumentException("Radius out of range (0 < r <= 25).");
}
setVar(0, radius);
}