diff options
author | Miao Wang <miaowang@google.com> | 2015-01-15 11:09:23 -0800 |
---|---|---|
committer | Miao Wang <miaowang@google.com> | 2015-01-21 21:17:19 +0000 |
commit | b590b354ef407c1c60288d2f8c3950d2f53d14fa (patch) | |
tree | ce0d11c926f03e6f0b23cb18ebf7f50af1e87e10 /rs/java/android/renderscript/ScriptIntrinsicHistogram.java | |
parent | 298071951210ae23c8023c4dc8f82da5d1760211 (diff) | |
download | frameworks_base-b590b354ef407c1c60288d2f8c3950d2f53d14fa.zip frameworks_base-b590b354ef407c1c60288d2f8c3950d2f53d14fa.tar.gz frameworks_base-b590b354ef407c1c60288d2f8c3950d2f53d14fa.tar.bz2 |
[Renderscript] Add check for Allocation.copyTo(Array) and
Fix the input allocation type check for Histogram Intrinsic.
Bug: 19035242
Change-Id: I0ef2672bf816854db90fc92dc9ef51d1d231c246
Diffstat (limited to 'rs/java/android/renderscript/ScriptIntrinsicHistogram.java')
-rw-r--r-- | rs/java/android/renderscript/ScriptIntrinsicHistogram.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/rs/java/android/renderscript/ScriptIntrinsicHistogram.java b/rs/java/android/renderscript/ScriptIntrinsicHistogram.java index 95b610a..4ecac99 100644 --- a/rs/java/android/renderscript/ScriptIntrinsicHistogram.java +++ b/rs/java/android/renderscript/ScriptIntrinsicHistogram.java @@ -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); |