diff options
author | Jason Sams <jsams@google.com> | 2013-11-06 11:22:02 -0800 |
---|---|---|
committer | Jason Sams <jsams@google.com> | 2013-11-06 11:22:02 -0800 |
commit | e729a9400f3ed2234a95a53aadb3420b76436d63 (patch) | |
tree | 7b9eb2d7b20e3288bc236249d21818f89169674f /graphics/java/android/renderscript/RenderScript.java | |
parent | b0a2dc56782fadf9cd42a39b88624162f4f1de54 (diff) |
Use Object + type in place of specific array
Changed to avoid the explosion of entry points in the JNI layer.
Change-Id: I7d6cc565c8853b06560eb891fdd5e8acf05c9779
Diffstat (limited to 'graphics/java/android/renderscript/RenderScript.java')
-rw-r--r-- | graphics/java/android/renderscript/RenderScript.java | 68 |
1 files changed, 13 insertions, 55 deletions
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java index 7d4a5c4d1295..da0cfeb5357c 100644 --- a/graphics/java/android/renderscript/RenderScript.java +++ b/graphics/java/android/renderscript/RenderScript.java @@ -386,25 +386,10 @@ public class RenderScript { } - native void rsnAllocationData1D(int con, int id, int off, int mip, int count, int[] d, int sizeBytes); - synchronized void nAllocationData1D(int id, int off, int mip, int count, int[] d, int sizeBytes) { + native void rsnAllocationData1D(int con, int id, int off, int mip, int count, Object d, int sizeBytes, int dt); + synchronized void nAllocationData1D(int id, int off, int mip, int count, Object d, int sizeBytes, Element.DataType dt) { validate(); - rsnAllocationData1D(mContext, id, off, mip, count, d, sizeBytes); - } - native void rsnAllocationData1D(int con, int id, int off, int mip, int count, short[] d, int sizeBytes); - synchronized void nAllocationData1D(int id, int off, int mip, int count, short[] d, int sizeBytes) { - validate(); - rsnAllocationData1D(mContext, id, off, mip, count, d, sizeBytes); - } - native void rsnAllocationData1D(int con, int id, int off, int mip, int count, byte[] d, int sizeBytes); - synchronized void nAllocationData1D(int id, int off, int mip, int count, byte[] d, int sizeBytes) { - validate(); - rsnAllocationData1D(mContext, id, off, mip, count, d, sizeBytes); - } - native void rsnAllocationData1D(int con, int id, int off, int mip, int count, float[] d, int sizeBytes); - synchronized void nAllocationData1D(int id, int off, int mip, int count, float[] d, int sizeBytes) { - validate(); - rsnAllocationData1D(mContext, id, off, mip, count, d, sizeBytes); + rsnAllocationData1D(mContext, id, off, mip, count, d, sizeBytes, dt.mID); } native void rsnAllocationElementData1D(int con, int id, int xoff, int mip, int compIdx, byte[] d, int sizeBytes); @@ -433,25 +418,12 @@ public class RenderScript { srcMip, srcFace); } - native void rsnAllocationData2D(int con, int id, int xoff, int yoff, int mip, int face, int w, int h, byte[] d, int sizeBytes); - synchronized void nAllocationData2D(int id, int xoff, int yoff, int mip, int face, int w, int h, byte[] d, int sizeBytes) { - validate(); - rsnAllocationData2D(mContext, id, xoff, yoff, mip, face, w, h, d, sizeBytes); - } - native void rsnAllocationData2D(int con, int id, int xoff, int yoff, int mip, int face, int w, int h, short[] d, int sizeBytes); - synchronized void nAllocationData2D(int id, int xoff, int yoff, int mip, int face, int w, int h, short[] d, int sizeBytes) { - validate(); - rsnAllocationData2D(mContext, id, xoff, yoff, mip, face, w, h, d, sizeBytes); - } - native void rsnAllocationData2D(int con, int id, int xoff, int yoff, int mip, int face, int w, int h, int[] d, int sizeBytes); - synchronized void nAllocationData2D(int id, int xoff, int yoff, int mip, int face, int w, int h, int[] d, int sizeBytes) { + native void rsnAllocationData2D(int con, int id, int xoff, int yoff, int mip, int face, + int w, int h, Object d, int sizeBytes, int dt); + synchronized void nAllocationData2D(int id, int xoff, int yoff, int mip, int face, + int w, int h, Object d, int sizeBytes, Element.DataType dt) { validate(); - rsnAllocationData2D(mContext, id, xoff, yoff, mip, face, w, h, d, sizeBytes); - } - native void rsnAllocationData2D(int con, int id, int xoff, int yoff, int mip, int face, int w, int h, float[] d, int sizeBytes); - synchronized void nAllocationData2D(int id, int xoff, int yoff, int mip, int face, int w, int h, float[] d, int sizeBytes) { - validate(); - rsnAllocationData2D(mContext, id, xoff, yoff, mip, face, w, h, d, sizeBytes); + rsnAllocationData2D(mContext, id, xoff, yoff, mip, face, w, h, d, sizeBytes, dt.mID); } native void rsnAllocationData2D(int con, int id, int xoff, int yoff, int mip, int face, Bitmap b); synchronized void nAllocationData2D(int id, int xoff, int yoff, int mip, int face, Bitmap b) { @@ -477,27 +449,13 @@ public class RenderScript { srcAlloc, srcXoff, srcYoff, srcZoff, srcMip); } - native void rsnAllocationData3D(int con, int id, int xoff, int yoff, int zoff, int mip, int w, int h, int depth, byte[] d, int sizeBytes); - synchronized void nAllocationData3D(int id, int xoff, int yoff, int zoff, int mip, int w, int h, int depth, byte[] d, int sizeBytes) { + native void rsnAllocationData3D(int con, int id, int xoff, int yoff, int zoff, int mip, + int w, int h, int depth, Object d, int sizeBytes, int dt); + synchronized void nAllocationData3D(int id, int xoff, int yoff, int zoff, int mip, + int w, int h, int depth, Object d, int sizeBytes, Element.DataType dt) { validate(); - rsnAllocationData3D(mContext, id, xoff, yoff, zoff, mip, w, h, depth, d, sizeBytes); + rsnAllocationData3D(mContext, id, xoff, yoff, zoff, mip, w, h, depth, d, sizeBytes, dt.mID); } - native void rsnAllocationData3D(int con, int id, int xoff, int yoff, int zoff, int mip, int w, int h, int depth, short[] d, int sizeBytes); - synchronized void nAllocationData3D(int id, int xoff, int yoff, int zoff, int mip, int w, int h, int depth, short[] d, int sizeBytes) { - validate(); - rsnAllocationData3D(mContext, id, xoff, yoff, zoff, mip, w, h, depth, d, sizeBytes); - } - native void rsnAllocationData3D(int con, int id, int xoff, int yoff, int zoff, int mip, int w, int h, int depth, int[] d, int sizeBytes); - synchronized void nAllocationData3D(int id, int xoff, int yoff, int zoff, int mip, int w, int h, int depth, int[] d, int sizeBytes) { - validate(); - rsnAllocationData3D(mContext, id, xoff, yoff, zoff, mip, w, h, depth, d, sizeBytes); - } - native void rsnAllocationData3D(int con, int id, int xoff, int yoff, int zoff, int mip, int w, int h, int depth, float[] d, int sizeBytes); - synchronized void nAllocationData3D(int id, int xoff, int yoff, int zoff, int mip, int w, int h, int depth, float[] d, int sizeBytes) { - validate(); - rsnAllocationData3D(mContext, id, xoff, yoff, zoff, mip, w, h, depth, d, sizeBytes); - } - native void rsnAllocationRead(int con, int id, byte[] d); synchronized void nAllocationRead(int id, byte[] d) { |