[RenderScript] Allow U8_2 & U8_3 input allocation for Histogram
Intrinsic
Bug: 19035242
Bug: 19124958
Change-Id: I9e806d7a0786e728c5f23607dc67ca5d755e12ed
diff --git a/rs/java/android/renderscript/ScriptIntrinsicHistogram.java b/rs/java/android/renderscript/ScriptIntrinsicHistogram.java
index 4ecac99..f8c0c16 100644
--- a/rs/java/android/renderscript/ScriptIntrinsicHistogram.java
+++ b/rs/java/android/renderscript/ScriptIntrinsicHistogram.java
@@ -92,8 +92,10 @@
"Input vector size must be >= output vector size.");
}
if (!ain.getType().getElement().isCompatible(Element.U8(mRS)) &&
+ !ain.getType().getElement().isCompatible(Element.U8_2(mRS)) &&
+ !ain.getType().getElement().isCompatible(Element.U8_3(mRS)) &&
!ain.getType().getElement().isCompatible(Element.U8_4(mRS))) {
- throw new RSIllegalArgumentException("Input type must be U8 or U8_4.");
+ throw new RSIllegalArgumentException("Input type must be U8, U8_1, U8_2 or U8_4.");
}
forEach(0, ain, null, null, opt);
@@ -188,8 +190,10 @@
throw new RSIllegalArgumentException("Output vector size must be one.");
}
if (!ain.getType().getElement().isCompatible(Element.U8(mRS)) &&
+ !ain.getType().getElement().isCompatible(Element.U8_2(mRS)) &&
+ !ain.getType().getElement().isCompatible(Element.U8_3(mRS)) &&
!ain.getType().getElement().isCompatible(Element.U8_4(mRS))) {
- throw new RSIllegalArgumentException("Input type must be U8 or U8_4.");
+ throw new RSIllegalArgumentException("Input type must be U8, U8_1, U8_2 or U8_4.");
}
forEach(1, ain, null, null, opt);