diff options
Diffstat (limited to 'rs/java/android/renderscript/RenderScript.java')
-rw-r--r-- | rs/java/android/renderscript/RenderScript.java | 101 |
1 files changed, 55 insertions, 46 deletions
diff --git a/rs/java/android/renderscript/RenderScript.java b/rs/java/android/renderscript/RenderScript.java index e86c461..271fe05 100644 --- a/rs/java/android/renderscript/RenderScript.java +++ b/rs/java/android/renderscript/RenderScript.java @@ -302,6 +302,46 @@ public class RenderScript { rsnContextResume(mContext); } + native long rsnClosureCreate(long con, long kernelID, long returnValue, + long[] fieldIDs, long[] values, int[] sizes, long[] depClosures, + long[] depFieldIDs); + synchronized long nClosureCreate(long kernelID, long returnValue, + long[] fieldIDs, long[] values, int[] sizes, long[] depClosures, + long[] depFieldIDs) { + validate(); + return rsnClosureCreate(mContext, kernelID, returnValue, fieldIDs, values, + sizes, depClosures, depFieldIDs); + } + + native void rsnClosureSetArg(long con, long closureID, int index, + long value, int size); + synchronized void nClosureSetArg(long closureID, int index, long value, + int size) { + validate(); + rsnClosureSetArg(mContext, closureID, index, value, size); + } + + native void rsnClosureSetGlobal(long con, long closureID, long fieldID, + long value, int size); + // Does this have to be synchronized? + synchronized void nClosureSetGlobal(long closureID, long fieldID, + long value, int size) { + validate(); // TODO: is this necessary? + rsnClosureSetGlobal(mContext, closureID, fieldID, value, size); + } + + native long rsnScriptGroup2Create(long con, long[] closures); + synchronized long nScriptGroup2Create(long[] closures) { + validate(); + return rsnScriptGroup2Create(mContext, closures); + } + + native void rsnScriptGroup2Execute(long con, long groupID); + synchronized void nScriptGroup2Execute(long groupID) { + validate(); + rsnScriptGroup2Execute(mContext, groupID); + } + native void rsnAssignName(long con, long obj, byte[] name); synchronized void nAssignName(long obj, byte[] name) { validate(); @@ -605,52 +645,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); @@ -869,6 +871,7 @@ public class RenderScript { Element mElement_I32; Element mElement_U64; Element mElement_I64; + Element mElement_F16; Element mElement_F32; Element mElement_F64; Element mElement_BOOLEAN; @@ -892,6 +895,10 @@ public class RenderScript { Element mElement_RGBA_4444; Element mElement_RGBA_8888; + Element mElement_HALF_2; + Element mElement_HALF_3; + Element mElement_HALF_4; + Element mElement_FLOAT_2; Element mElement_FLOAT_3; Element mElement_FLOAT_4; @@ -1040,8 +1047,10 @@ public class RenderScript { * their priority to LOW to avoid starving forground processes. */ public enum Priority { - LOW (Process.THREAD_PRIORITY_BACKGROUND + (5 * Process.THREAD_PRIORITY_LESS_FAVORABLE)), - NORMAL (Process.THREAD_PRIORITY_DISPLAY); + // These values used to represent official thread priority values + // now they are simply enums to be used by the runtime side + LOW (15), + NORMAL (-8); int mID; Priority(int id) { |