From dac6ed0b69b23ab25757085dd5ce68092516ee2f Mon Sep 17 00:00:00 2001 From: Stephen Hines Date: Wed, 13 Feb 2013 00:09:02 -0800 Subject: Add rsnScriptForEachClipped() implementation with no param array. JNI doesn't let us pass down a NULL parameter array (from the usrData part of our reflection). In this case, we simply clone our existing function, but remove the offending array parameter. Change-Id: Ib1d6e202f2a55ba8922eec3da5a93d8daa882250 --- graphics/java/android/renderscript/RenderScript.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'graphics/java/android/renderscript/RenderScript.java') diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java index 50d888fa242b..c3ddd32e39b6 100644 --- a/graphics/java/android/renderscript/RenderScript.java +++ b/graphics/java/android/renderscript/RenderScript.java @@ -519,6 +519,8 @@ public class RenderScript { native void rsnScriptForEach(int con, int id, int slot, int ain, int aout); native void rsnScriptForEachClipped(int con, int id, int slot, int ain, int aout, byte[] params, int xstart, int xend, int ystart, int yend, int zstart, int zend); + native void rsnScriptForEachClipped(int con, int id, int slot, int ain, int aout, + int xstart, int xend, int ystart, int yend, int zstart, int zend); synchronized void nScriptForEach(int id, int slot, int ain, int aout, byte[] params) { validate(); if (params == null) { @@ -531,7 +533,11 @@ public class RenderScript { synchronized void nScriptForEachClipped(int id, int slot, int ain, int aout, byte[] params, int xstart, int xend, int ystart, int yend, int zstart, int zend) { validate(); - rsnScriptForEachClipped(mContext, id, slot, ain, aout, params, xstart, xend, ystart, yend, zstart, zend); + if (params == null) { + rsnScriptForEachClipped(mContext, id, slot, ain, aout, xstart, xend, ystart, yend, zstart, zend); + } else { + rsnScriptForEachClipped(mContext, id, slot, ain, aout, params, xstart, xend, ystart, yend, zstart, zend); + } } native void rsnScriptInvokeV(int con, int id, int slot, byte[] params); -- cgit v1.2.3