diff options
author | Jason Sams <jsams@google.com> | 2013-11-06 15:08:07 -0800 |
---|---|---|
committer | Jason Sams <jsams@google.com> | 2013-11-11 23:22:53 +0000 |
commit | 21659ac4c83d272f3ffd2f9b6333acbe5f0b02a1 (patch) | |
tree | 34d75bf3276470de59adaf228807ed4c94cfd223 /graphics/java | |
parent | c2c5689da5c39425c0c9bc44e7d0fcae20b4300f (diff) | |
download | frameworks_base-21659ac4c83d272f3ffd2f9b6333acbe5f0b02a1.zip frameworks_base-21659ac4c83d272f3ffd2f9b6333acbe5f0b02a1.tar.gz frameworks_base-21659ac4c83d272f3ffd2f9b6333acbe5f0b02a1.tar.bz2 |
Add long/double read support.
Change-Id: I1957f7ac18262a3004a4adcb7c31055212e483c2
Diffstat (limited to 'graphics/java')
-rw-r--r-- | graphics/java/android/renderscript/Allocation.java | 8 | ||||
-rw-r--r-- | graphics/java/android/renderscript/RenderScript.java | 31 |
2 files changed, 21 insertions, 18 deletions
diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java index 0cafdd7..8e69f56 100644 --- a/graphics/java/android/renderscript/Allocation.java +++ b/graphics/java/android/renderscript/Allocation.java @@ -1262,7 +1262,7 @@ public class Allocation extends BaseObj { Trace.traceBegin(RenderScript.TRACE_TAG, "copyTo"); validateIsInt8(); mRS.validate(); - mRS.nAllocationRead(getID(mRS), d); + mRS.nAllocationRead(getID(mRS), d, Element.DataType.SIGNED_8); Trace.traceEnd(RenderScript.TRACE_TAG); } @@ -1277,7 +1277,7 @@ public class Allocation extends BaseObj { Trace.traceBegin(RenderScript.TRACE_TAG, "copyTo"); validateIsInt16(); mRS.validate(); - mRS.nAllocationRead(getID(mRS), d); + mRS.nAllocationRead(getID(mRS), d, Element.DataType.SIGNED_16); Trace.traceEnd(RenderScript.TRACE_TAG); } @@ -1292,7 +1292,7 @@ public class Allocation extends BaseObj { Trace.traceBegin(RenderScript.TRACE_TAG, "copyTo"); validateIsInt32(); mRS.validate(); - mRS.nAllocationRead(getID(mRS), d); + mRS.nAllocationRead(getID(mRS), d, Element.DataType.SIGNED_32); Trace.traceEnd(RenderScript.TRACE_TAG); } @@ -1307,7 +1307,7 @@ public class Allocation extends BaseObj { Trace.traceBegin(RenderScript.TRACE_TAG, "copyTo"); validateIsFloat32(); mRS.validate(); - mRS.nAllocationRead(getID(mRS), d); + mRS.nAllocationRead(getID(mRS), d, Element.DataType.FLOAT_32); Trace.traceEnd(RenderScript.TRACE_TAG); } diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java index da0cfeb..322a045 100644 --- a/graphics/java/android/renderscript/RenderScript.java +++ b/graphics/java/android/renderscript/RenderScript.java @@ -425,6 +425,7 @@ public class RenderScript { validate(); 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) { validate(); @@ -457,26 +458,28 @@ public class RenderScript { rsnAllocationData3D(mContext, id, xoff, yoff, zoff, mip, w, h, depth, d, sizeBytes, dt.mID); } - native void rsnAllocationRead(int con, int id, byte[] d); - synchronized void nAllocationRead(int id, byte[] d) { - validate(); - rsnAllocationRead(mContext, id, d); - } - native void rsnAllocationRead(int con, int id, short[] d); - synchronized void nAllocationRead(int id, short[] d) { + native void rsnAllocationRead(int con, int id, Object d, int dt); + synchronized void nAllocationRead(int id, Object d, Element.DataType dt) { validate(); - rsnAllocationRead(mContext, id, d); + rsnAllocationRead(mContext, id, d, dt.mID); } - native void rsnAllocationRead(int con, int id, int[] d); - synchronized void nAllocationRead(int id, int[] d) { + + native void rsnAllocationRead1D(int con, int id, int off, int mip, int count, Object d, + int sizeBytes, int dt); + synchronized void nAllocationRead1D(int id, int off, int mip, int count, Object d, + int sizeBytes, Element.DataType dt) { validate(); - rsnAllocationRead(mContext, id, d); + rsnAllocationRead1D(mContext, id, off, mip, count, d, sizeBytes, dt.mID); } - native void rsnAllocationRead(int con, int id, float[] d); - synchronized void nAllocationRead(int id, float[] d) { + + native void rsnAllocationRead2D(int con, int id, int xoff, int yoff, int mip, int face, + int w, int h, Object d, int sizeBytes, int dt); + synchronized void nAllocationRead2D(int id, int xoff, int yoff, int mip, int face, + int w, int h, Object d, int sizeBytes, Element.DataType dt) { validate(); - rsnAllocationRead(mContext, id, d); + rsnAllocationRead2D(mContext, id, xoff, yoff, mip, face, w, h, d, sizeBytes, dt.mID); } + native int rsnAllocationGetType(int con, int id); synchronized int nAllocationGetType(int id) { validate(); |