diff options
author | Stephen Hines <srhines@google.com> | 2013-02-13 00:09:02 -0800 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2013-02-13 00:09:02 -0800 |
commit | dac6ed0b69b23ab25757085dd5ce68092516ee2f (patch) | |
tree | 6dea6180df015a6f29346679c6181d78fedafce3 /graphics/java/android/renderscript/RenderScript.java | |
parent | 7d9cf2b74236953671d20f5634f3b4234c25c6fa (diff) |
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
Diffstat (limited to 'graphics/java/android/renderscript/RenderScript.java')
-rw-r--r-- | graphics/java/android/renderscript/RenderScript.java | 8 |
1 files changed, 7 insertions, 1 deletions
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); |