summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorTim Murray <timmurray@google.com>2012-09-26 13:46:46 -0700
committerTim Murray <timmurray@google.com>2012-09-26 16:29:08 -0700
commit74478f73b7ecf5c6bceb214b2704184ad9e2e0ec (patch)
treee85e16245b0cbd37d64ef63b0174df1d620837fe /graphics
parentfea9df6386d66089b004719f194625e159bb344a (diff)
downloadframeworks_base-74478f73b7ecf5c6bceb214b2704184ad9e2e0ec.zip
frameworks_base-74478f73b7ecf5c6bceb214b2704184ad9e2e0ec.tar.gz
frameworks_base-74478f73b7ecf5c6bceb214b2704184ad9e2e0ec.tar.bz2
fix blend intrinsics, add tests
Bug: 7190126 Change-Id: If69213377282bf5b412508e7af974a1f8d440287
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/renderscript/ScriptIntrinsicBlend.java11
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);
}