diff options
Diffstat (limited to 'graphics/java/android/renderscript/ScriptIntrinsicBlend.java')
-rw-r--r-- | graphics/java/android/renderscript/ScriptIntrinsicBlend.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/graphics/java/android/renderscript/ScriptIntrinsicBlend.java b/graphics/java/android/renderscript/ScriptIntrinsicBlend.java index 13c03af..65c69c0 100644 --- a/graphics/java/android/renderscript/ScriptIntrinsicBlend.java +++ b/graphics/java/android/renderscript/ScriptIntrinsicBlend.java @@ -36,17 +36,18 @@ public class ScriptIntrinsicBlend extends ScriptIntrinsic { * @return ScriptIntrinsicBlend */ public static ScriptIntrinsicBlend create(RenderScript rs, Element e) { - int id = rs.nScriptIntrinsicCreate(6, e.getID(rs)); + // 7 comes from RS_SCRIPT_INTRINSIC_ID_BLEND in rsDefines.h + int id = rs.nScriptIntrinsicCreate(7, e.getID(rs)); return new ScriptIntrinsicBlend(id, rs); } private void blend(int id, Allocation ain, Allocation aout) { - if (ain.getElement() != Element.U8_4(mRS)) { - throw new RSIllegalArgumentException("Input not of expected format."); + if (!ain.getElement().isCompatible(Element.U8_4(mRS))) { + throw new RSIllegalArgumentException("Input is not of expected format."); } - if (aout.getElement() != Element.U8_4(mRS)) { - throw new RSIllegalArgumentException("Output not of expected format."); + if (!aout.getElement().isCompatible(Element.U8_4(mRS))) { + throw new RSIllegalArgumentException("Output is not of expected format."); } forEach(id, ain, aout, null); } |