diff options
Diffstat (limited to 'rs/java/android/renderscript/RenderScript.java')
-rw-r--r-- | rs/java/android/renderscript/RenderScript.java | 61 |
1 files changed, 52 insertions, 9 deletions
diff --git a/rs/java/android/renderscript/RenderScript.java b/rs/java/android/renderscript/RenderScript.java index 4440417333f8..425569cd8fa1 100644 --- a/rs/java/android/renderscript/RenderScript.java +++ b/rs/java/android/renderscript/RenderScript.java @@ -18,17 +18,20 @@ package android.renderscript; import java.io.File; import java.lang.reflect.Method; +import java.nio.ByteBuffer; +import java.util.ArrayList; import java.util.concurrent.locks.ReentrantReadWriteLock; import android.content.Context; import android.content.res.AssetManager; import android.graphics.Bitmap; import android.graphics.SurfaceTexture; -import android.util.Log; -import android.view.Surface; import android.os.SystemProperties; import android.os.Trace; -import java.util.ArrayList; +import android.util.Log; +import android.view.Surface; + +// TODO: Clean up the whitespace that separates methods in this class. /** * This class provides access to a RenderScript context, which controls RenderScript @@ -88,6 +91,14 @@ public class RenderScript { */ public static final int CREATE_FLAG_LOW_POWER = 0x0004; + /** + * @hide + * Context creation flag which instructs the implementation to wait for + * a debugger to be attached before continuing execution. + */ + public static final int CREATE_FLAG_WAIT_FOR_ATTACH = 0x0008; + + /* * Detect the bitness of the VM to allow FieldPacker to do the right thing. */ @@ -466,12 +477,28 @@ public class RenderScript { rsnAllocationCopyToBitmap(mContext, alloc, bmp); } - native void rsnAllocationSyncAll(long con, long alloc, int src); synchronized void nAllocationSyncAll(long alloc, int src) { validate(); rsnAllocationSyncAll(mContext, alloc, src); } + + native ByteBuffer rsnAllocationGetByteBuffer(long con, long alloc, long[] stride, int xBytesSize, int dimY, int dimZ); + synchronized ByteBuffer nAllocationGetByteBuffer(long alloc, long[] stride, int xBytesSize, int dimY, int dimZ) { + validate(); + return rsnAllocationGetByteBuffer(mContext, alloc, stride, xBytesSize, dimY, dimZ); + } + + native void rsnAllocationSetupBufferQueue(long con, long alloc, int numAlloc); + synchronized void nAllocationSetupBufferQueue(long alloc, int numAlloc) { + validate(); + rsnAllocationSetupBufferQueue(mContext, alloc, numAlloc); + } + native void rsnAllocationShareBufferQueue(long con, long alloc1, long alloc2); + synchronized void nAllocationShareBufferQueue(long alloc1, long alloc2) { + validate(); + rsnAllocationShareBufferQueue(mContext, alloc1, alloc2); + } native Surface rsnAllocationGetSurface(long con, long alloc); synchronized Surface nAllocationGetSurface(long alloc) { validate(); @@ -487,13 +514,12 @@ public class RenderScript { validate(); rsnAllocationIoSend(mContext, alloc); } - native void rsnAllocationIoReceive(long con, long alloc); - synchronized void nAllocationIoReceive(long alloc) { + native long rsnAllocationIoReceive(long con, long alloc); + synchronized long nAllocationIoReceive(long alloc) { validate(); - rsnAllocationIoReceive(mContext, alloc); + return rsnAllocationIoReceive(mContext, alloc); } - native void rsnAllocationGenerateMipmaps(long con, long alloc); synchronized void nAllocationGenerateMipmaps(long alloc) { validate(); @@ -726,6 +752,22 @@ public class RenderScript { rsnScriptForEach(mContext, id, slot, ains, aout, params, limits); } + native void rsnScriptReduce(long con, long id, int slot, long ain, + long aout, int[] limits); + synchronized void nScriptReduce(long id, int slot, long ain, long aout, + int[] limits) { + validate(); + rsnScriptReduce(mContext, id, slot, ain, aout, limits); + } + + native void rsnScriptReduceNew(long con, long id, int slot, long[] ains, + long aout, int[] limits); + synchronized void nScriptReduceNew(long id, int slot, long ains[], long aout, + int[] limits) { + validate(); + rsnScriptReduceNew(mContext, id, slot, ains, aout, limits); + } + native void rsnScriptInvokeV(long con, long id, int slot, byte[] params); synchronized void nScriptInvokeV(long id, int slot, byte[] params) { validate(); @@ -1356,7 +1398,8 @@ public class RenderScript { return null; } - if ((flags & ~(CREATE_FLAG_LOW_LATENCY | CREATE_FLAG_LOW_POWER)) != 0) { + if ((flags & ~(CREATE_FLAG_LOW_LATENCY | CREATE_FLAG_LOW_POWER | + CREATE_FLAG_WAIT_FOR_ATTACH)) != 0) { throw new RSIllegalArgumentException("Invalid flags passed."); } |