fix blend intrinsics, add tests

Bug: 7190126
Change-Id: If69213377282bf5b412508e7af974a1f8d440287
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 @@
      * @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);
     }