diff options
author | Chris Wailes <chriswailes@google.com> | 2014-07-15 10:56:14 -0700 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2014-08-18 08:03:52 -0700 |
commit | be7b1defb6b11920703b241ba5815fb09487bb02 (patch) | |
tree | 3054452637bc4a2d0fd89823071423853c1239a0 /rs/java/android/renderscript/RenderScript.java | |
parent | 21d1b115a1d79a00991dddb883d9fb3e1863e35c (diff) | |
download | frameworks_base-be7b1defb6b11920703b241ba5815fb09487bb02.zip frameworks_base-be7b1defb6b11920703b241ba5815fb09487bb02.tar.gz frameworks_base-be7b1defb6b11920703b241ba5815fb09487bb02.tar.bz2 |
Collapse code paths for single- and multi-input kernels.
This patch simplifies the RenderScript JNI layer by replacing six functions
with a single funciton. This new function now handles all previous cases.
Functions in android.renderscript.script have been updated to use this new JNI
function.
Change-Id: I6cd5448534c38123d51a589339bbeb7e98453e73
Diffstat (limited to 'rs/java/android/renderscript/RenderScript.java')
-rw-r--r-- | rs/java/android/renderscript/RenderScript.java | 50 |
1 files changed, 6 insertions, 44 deletions
diff --git a/rs/java/android/renderscript/RenderScript.java b/rs/java/android/renderscript/RenderScript.java index f2b1380..bd272bc 100644 --- a/rs/java/android/renderscript/RenderScript.java +++ b/rs/java/android/renderscript/RenderScript.java @@ -590,52 +590,14 @@ public class RenderScript { validate(); rsnScriptInvoke(mContext, id, slot); } - native void rsnScriptForEach(long con, long id, int slot, long ain, long aout, byte[] params); - native void rsnScriptForEach(long con, long id, int slot, long ain, long aout); - native void rsnScriptForEachClipped(long con, long id, int slot, long ain, long aout, byte[] params, - int xstart, int xend, int ystart, int yend, int zstart, int zend); - native void rsnScriptForEachClipped(long con, long id, int slot, long ain, long aout, - int xstart, int xend, int ystart, int yend, int zstart, int zend); - synchronized void nScriptForEach(long id, int slot, long ain, long aout, byte[] params) { - validate(); - if (params == null) { - rsnScriptForEach(mContext, id, slot, ain, aout); - } else { - rsnScriptForEach(mContext, id, slot, ain, aout, params); - } - } - synchronized void nScriptForEachClipped(long id, int slot, long ain, long aout, byte[] params, - int xstart, int xend, int ystart, int yend, int zstart, int zend) { - validate(); - 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 rsnScriptForEach(long con, long id, int slot, long[] ains, + long aout, byte[] params, int[] limits); - /** - * Multi-input code. - * - */ - - // @hide - native void rsnScriptForEachMultiClipped(long con, long id, int slot, long[] ains, long aout, byte[] params, - int xstart, int xend, int ystart, int yend, int zstart, int zend); - // @hide - native void rsnScriptForEachMultiClipped(long con, long id, int slot, long[] ains, long aout, - int xstart, int xend, int ystart, int yend, int zstart, int zend); - - // @hide - synchronized void nScriptForEachMultiClipped(long id, int slot, long[] ains, long aout, byte[] params, - int xstart, int xend, int ystart, int yend, int zstart, int zend) { - validate(); - if (params == null) { - rsnScriptForEachMultiClipped(mContext, id, slot, ains, aout, xstart, xend, ystart, yend, zstart, zend); - } else { - rsnScriptForEachMultiClipped(mContext, id, slot, ains, aout, params, xstart, xend, ystart, yend, zstart, zend); - } + synchronized void nScriptForEach(long id, int slot, long[] ains, long aout, + byte[] params, int[] limits) { + validate(); + rsnScriptForEach(mContext, id, slot, ains, aout, params, limits); } native void rsnScriptInvokeV(long con, long id, int slot, byte[] params); |