[Renderscript] Add check for Allocation.copyTo(Array) and

Fix the input allocation type check for Histogram Intrinsic.

Bug: 19035242
Change-Id: I0ef2672bf816854db90fc92dc9ef51d1d231c246
This commit is contained in:
Miao Wang
2015-01-15 11:09:23 -08:00
parent 2980719512
commit b590b354ef
2 changed files with 10 additions and 6 deletions

View File

@@ -91,9 +91,9 @@ public final class ScriptIntrinsicHistogram extends ScriptIntrinsic {
throw new RSIllegalArgumentException(
"Input vector size must be >= output vector size.");
}
if (ain.getType().getElement().isCompatible(Element.U8(mRS)) &&
ain.getType().getElement().isCompatible(Element.U8_4(mRS))) {
throw new RSIllegalArgumentException("Output type must be U32 or I32.");
if (!ain.getType().getElement().isCompatible(Element.U8(mRS)) &&
!ain.getType().getElement().isCompatible(Element.U8_4(mRS))) {
throw new RSIllegalArgumentException("Input type must be U8 or U8_4.");
}
forEach(0, ain, null, null, opt);
@@ -187,9 +187,9 @@ public final class ScriptIntrinsicHistogram extends ScriptIntrinsic {
if (mOut.getType().getElement().getVectorSize() != 1) {
throw new RSIllegalArgumentException("Output vector size must be one.");
}
if (ain.getType().getElement().isCompatible(Element.U8(mRS)) &&
ain.getType().getElement().isCompatible(Element.U8_4(mRS))) {
throw new RSIllegalArgumentException("Output type must be U32 or I32.");
if (!ain.getType().getElement().isCompatible(Element.U8(mRS)) &&
!ain.getType().getElement().isCompatible(Element.U8_4(mRS))) {
throw new RSIllegalArgumentException("Input type must be U8 or U8_4.");
}
forEach(1, ain, null, null, opt);