diff options
Diffstat (limited to 'graphics/java/android/renderscript/Allocation.java')
-rw-r--r-- | graphics/java/android/renderscript/Allocation.java | 62 |
1 files changed, 21 insertions, 41 deletions
diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java index dca934f82cab..e8e3c41379c9 100644 --- a/graphics/java/android/renderscript/Allocation.java +++ b/graphics/java/android/renderscript/Allocation.java @@ -16,17 +16,12 @@ package android.renderscript; -import java.io.IOException; -import java.io.InputStream; import java.util.HashMap; import android.content.res.Resources; -import android.content.res.AssetManager; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.view.Surface; -import android.graphics.SurfaceTexture; import android.util.Log; -import android.util.TypedValue; import android.graphics.Canvas; import android.os.Trace; @@ -127,17 +122,17 @@ public class Allocation extends BaseObj { public static final int USAGE_GRAPHICS_RENDER_TARGET = 0x0010; /** - * The Allocation will be used as a {@link android.graphics.SurfaceTexture} - * consumer. This usage will cause the Allocation to be created as - * read-only. + * The Allocation will be used as a {@link android.view.Surface} + * consumer. This usage will cause the Allocation to be created + * as read-only. * */ public static final int USAGE_IO_INPUT = 0x0020; /** - * The Allocation will be used as a {@link android.graphics.SurfaceTexture} + * The Allocation will be used as a {@link android.view.Surface} * producer. The dimensions and format of the {@link - * android.graphics.SurfaceTexture} will be forced to those of the + * android.view.Surface} will be forced to those of the * Allocation. * */ @@ -412,14 +407,6 @@ public class Allocation extends BaseObj { } /** - * Delete once code is updated. - * @hide - */ - public void ioSendOutput() { - ioSend(); - } - - /** * Receive the latest input into the Allocation. This operation * is only valid if {@link #USAGE_IO_INPUT} is set on the Allocation. * @@ -810,7 +797,7 @@ public class Allocation extends BaseObj { Trace.traceBegin(RenderScript.TRACE_TAG, "copy1DRangeFromUnchecked"); int dataSize = mType.mElement.getBytesSize() * count; data1DChecks(off, count, d.length * 4, dataSize); - mRS.nAllocationData1D(getIDSafe(), off, mSelectedLOD, count, d, dataSize); + mRS.nAllocationData1D(getIDSafe(), off, mSelectedLOD, count, d, dataSize, Element.DataType.SIGNED_32); Trace.traceEnd(RenderScript.TRACE_TAG); } @@ -826,7 +813,7 @@ public class Allocation extends BaseObj { Trace.traceBegin(RenderScript.TRACE_TAG, "copy1DRangeFromUnchecked"); int dataSize = mType.mElement.getBytesSize() * count; data1DChecks(off, count, d.length * 2, dataSize); - mRS.nAllocationData1D(getIDSafe(), off, mSelectedLOD, count, d, dataSize); + mRS.nAllocationData1D(getIDSafe(), off, mSelectedLOD, count, d, dataSize, Element.DataType.SIGNED_16); Trace.traceEnd(RenderScript.TRACE_TAG); } @@ -842,7 +829,7 @@ public class Allocation extends BaseObj { Trace.traceBegin(RenderScript.TRACE_TAG, "copy1DRangeFromUnchecked"); int dataSize = mType.mElement.getBytesSize() * count; data1DChecks(off, count, d.length, dataSize); - mRS.nAllocationData1D(getIDSafe(), off, mSelectedLOD, count, d, dataSize); + mRS.nAllocationData1D(getIDSafe(), off, mSelectedLOD, count, d, dataSize, Element.DataType.SIGNED_8); Trace.traceEnd(RenderScript.TRACE_TAG); } @@ -858,7 +845,7 @@ public class Allocation extends BaseObj { Trace.traceBegin(RenderScript.TRACE_TAG, "copy1DRangeFromUnchecked"); int dataSize = mType.mElement.getBytesSize() * count; data1DChecks(off, count, d.length * 4, dataSize); - mRS.nAllocationData1D(getIDSafe(), off, mSelectedLOD, count, d, dataSize); + mRS.nAllocationData1D(getIDSafe(), off, mSelectedLOD, count, d, dataSize, Element.DataType.FLOAT_32); Trace.traceEnd(RenderScript.TRACE_TAG); } @@ -964,7 +951,7 @@ public class Allocation extends BaseObj { mRS.validate(); validate2DRange(xoff, yoff, w, h); mRS.nAllocationData2D(getIDSafe(), xoff, yoff, mSelectedLOD, mSelectedFace.mID, - w, h, data, data.length); + w, h, data, data.length, Element.DataType.SIGNED_8); Trace.traceEnd(RenderScript.TRACE_TAG); } @@ -973,7 +960,7 @@ public class Allocation extends BaseObj { mRS.validate(); validate2DRange(xoff, yoff, w, h); mRS.nAllocationData2D(getIDSafe(), xoff, yoff, mSelectedLOD, mSelectedFace.mID, - w, h, data, data.length * 2); + w, h, data, data.length * 2, Element.DataType.SIGNED_16); Trace.traceEnd(RenderScript.TRACE_TAG); } @@ -982,7 +969,7 @@ public class Allocation extends BaseObj { mRS.validate(); validate2DRange(xoff, yoff, w, h); mRS.nAllocationData2D(getIDSafe(), xoff, yoff, mSelectedLOD, mSelectedFace.mID, - w, h, data, data.length * 4); + w, h, data, data.length * 4, Element.DataType.SIGNED_32); Trace.traceEnd(RenderScript.TRACE_TAG); } @@ -991,7 +978,7 @@ public class Allocation extends BaseObj { mRS.validate(); validate2DRange(xoff, yoff, w, h); mRS.nAllocationData2D(getIDSafe(), xoff, yoff, mSelectedLOD, mSelectedFace.mID, - w, h, data, data.length * 4); + w, h, data, data.length * 4, Element.DataType.FLOAT_32); Trace.traceEnd(RenderScript.TRACE_TAG); } @@ -1137,7 +1124,7 @@ public class Allocation extends BaseObj { mRS.validate(); validate3DRange(xoff, yoff, zoff, w, h, d); mRS.nAllocationData3D(getIDSafe(), xoff, yoff, zoff, mSelectedLOD, - w, h, d, data, data.length); + w, h, d, data, data.length, Element.DataType.SIGNED_8); } /** @@ -1148,7 +1135,7 @@ public class Allocation extends BaseObj { mRS.validate(); validate3DRange(xoff, yoff, zoff, w, h, d); mRS.nAllocationData3D(getIDSafe(), xoff, yoff, zoff, mSelectedLOD, - w, h, d, data, data.length * 2); + w, h, d, data, data.length * 2, Element.DataType.SIGNED_16); } /** @@ -1159,7 +1146,7 @@ public class Allocation extends BaseObj { mRS.validate(); validate3DRange(xoff, yoff, zoff, w, h, d); mRS.nAllocationData3D(getIDSafe(), xoff, yoff, zoff, mSelectedLOD, - w, h, d, data, data.length * 4); + w, h, d, data, data.length * 4, Element.DataType.SIGNED_32); } /** @@ -1170,7 +1157,7 @@ public class Allocation extends BaseObj { mRS.validate(); validate3DRange(xoff, yoff, zoff, w, h, d); mRS.nAllocationData3D(getIDSafe(), xoff, yoff, zoff, mSelectedLOD, - w, h, d, data, data.length * 4); + w, h, d, data, data.length * 4, Element.DataType.FLOAT_32); } @@ -1271,7 +1258,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); } @@ -1286,7 +1273,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); } @@ -1301,7 +1288,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); } @@ -1316,7 +1303,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); } @@ -1547,13 +1534,6 @@ public class Allocation extends BaseObj { } /** - * @hide - */ - public void setSurfaceTexture(SurfaceTexture st) { - setSurface(new Surface(st)); - } - - /** * Associate a {@link android.view.Surface} with this Allocation. This * operation is only valid for Allocations with {@link #USAGE_IO_OUTPUT}. * |