diff options
| author | 2011-01-19 16:27:06 -0800 | |
|---|---|---|
| committer | 2011-01-19 16:27:06 -0800 | |
| commit | 9dd9d021896e350df983baf7174d980a43533e69 (patch) | |
| tree | 9e29daf4ffe483af53a2b9ab5a48ff6b6344a471 | |
| parent | b2b14397e522da4d779b19415eab49967a7922d9 (diff) | |
| parent | 4fa3eed8e03348e2629abd539b3476a86b44135e (diff) | |
Merge "Expose unchecked copyFrom variants." into honeycomb
| -rw-r--r-- | api/11.xml | 142 | ||||
| -rw-r--r-- | api/current.xml | 122 | ||||
| -rw-r--r-- | graphics/java/android/renderscript/Allocation.java | 166 |
3 files changed, 425 insertions, 5 deletions
diff --git a/api/11.xml b/api/11.xml index fe2fb2afe033..31cfc85db89a 100644 --- a/api/11.xml +++ b/api/11.xml @@ -166482,6 +166482,74 @@ <parameter name="d" type="float[]"> </parameter> </method> +<method name="copy1DRangeFromUnchecked" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="off" type="int"> +</parameter> +<parameter name="count" type="int"> +</parameter> +<parameter name="d" type="int[]"> +</parameter> +</method> +<method name="copy1DRangeFromUnchecked" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="off" type="int"> +</parameter> +<parameter name="count" type="int"> +</parameter> +<parameter name="d" type="short[]"> +</parameter> +</method> +<method name="copy1DRangeFromUnchecked" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="off" type="int"> +</parameter> +<parameter name="count" type="int"> +</parameter> +<parameter name="d" type="byte[]"> +</parameter> +</method> +<method name="copy1DRangeFromUnchecked" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="off" type="int"> +</parameter> +<parameter name="count" type="int"> +</parameter> +<parameter name="d" type="float[]"> +</parameter> +</method> <method name="copy2DRangeFrom" return="void" abstract="false" @@ -166661,6 +166729,58 @@ <parameter name="b" type="android.graphics.Bitmap"> </parameter> </method> +<method name="copyFromUnchecked" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="d" type="int[]"> +</parameter> +</method> +<method name="copyFromUnchecked" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="d" type="short[]"> +</parameter> +</method> +<method name="copyFromUnchecked" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="d" type="byte[]"> +</parameter> +</method> +<method name="copyFromUnchecked" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="d" type="float[]"> +</parameter> +</method> <method name="copyTo" return="void" abstract="false" @@ -175630,6 +175750,17 @@ visibility="public" > </field> +<field name="KEY_PARAM_PAN" + type="java.lang.String" + transient="false" + volatile="false" + value=""pan"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="KEY_PARAM_STREAM" type="java.lang.String" transient="false" @@ -175652,6 +175783,17 @@ visibility="public" > </field> +<field name="KEY_PARAM_VOLUME" + type="java.lang.String" + transient="false" + volatile="false" + value=""volume"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> </class> <interface name="TextToSpeech.OnInitListener" abstract="true" diff --git a/api/current.xml b/api/current.xml index 98b0155ce2e8..83bfedb7281d 100644 --- a/api/current.xml +++ b/api/current.xml @@ -166493,6 +166493,74 @@ <parameter name="d" type="float[]"> </parameter> </method> +<method name="copy1DRangeFromUnchecked" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="off" type="int"> +</parameter> +<parameter name="count" type="int"> +</parameter> +<parameter name="d" type="int[]"> +</parameter> +</method> +<method name="copy1DRangeFromUnchecked" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="off" type="int"> +</parameter> +<parameter name="count" type="int"> +</parameter> +<parameter name="d" type="short[]"> +</parameter> +</method> +<method name="copy1DRangeFromUnchecked" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="off" type="int"> +</parameter> +<parameter name="count" type="int"> +</parameter> +<parameter name="d" type="byte[]"> +</parameter> +</method> +<method name="copy1DRangeFromUnchecked" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="off" type="int"> +</parameter> +<parameter name="count" type="int"> +</parameter> +<parameter name="d" type="float[]"> +</parameter> +</method> <method name="copy2DRangeFrom" return="void" abstract="false" @@ -166672,6 +166740,58 @@ <parameter name="b" type="android.graphics.Bitmap"> </parameter> </method> +<method name="copyFromUnchecked" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="d" type="int[]"> +</parameter> +</method> +<method name="copyFromUnchecked" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="d" type="short[]"> +</parameter> +</method> +<method name="copyFromUnchecked" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="d" type="byte[]"> +</parameter> +</method> +<method name="copyFromUnchecked" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="d" type="float[]"> +</parameter> +</method> <method name="copyTo" return="void" abstract="false" @@ -260217,7 +260337,7 @@ deprecated="not deprecated" visibility="public" > -<parameter name="t" type="T"> +<parameter name="arg0" type="T"> </parameter> </method> </interface> diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java index 1789891d73e5..74cdf80a9294 100644 --- a/graphics/java/android/renderscript/Allocation.java +++ b/graphics/java/android/renderscript/Allocation.java @@ -268,22 +268,105 @@ public class Allocation extends BaseObj { } } + /** + * Copy an allocation from an array. This variant is not type + * checked which allows an application to fill in structured + * data from an array. + * + * @param d the source data array + */ + public void copyFromUnchecked(int[] d) { + mRS.validate(); + copy1DRangeFromUnchecked(0, mType.getCount(), d); + } + /** + * Copy an allocation from an array. This variant is not type + * checked which allows an application to fill in structured + * data from an array. + * + * @param d the source data array + */ + public void copyFromUnchecked(short[] d) { + mRS.validate(); + copy1DRangeFromUnchecked(0, mType.getCount(), d); + } + /** + * Copy an allocation from an array. This variant is not type + * checked which allows an application to fill in structured + * data from an array. + * + * @param d the source data array + */ + public void copyFromUnchecked(byte[] d) { + mRS.validate(); + copy1DRangeFromUnchecked(0, mType.getCount(), d); + } + /** + * Copy an allocation from an array. This variant is not type + * checked which allows an application to fill in structured + * data from an array. + * + * @param d the source data array + */ + public void copyFromUnchecked(float[] d) { + mRS.validate(); + copy1DRangeFromUnchecked(0, mType.getCount(), d); + } + + /** + * Copy an allocation from an array. This variant is type + * checked and will generate exceptions if the Allocation type + * is not a 32 bit integer type. + * + * @param d the source data array + */ public void copyFrom(int[] d) { mRS.validate(); copy1DRangeFrom(0, mType.getCount(), d); } + + /** + * Copy an allocation from an array. This variant is type + * checked and will generate exceptions if the Allocation type + * is not a 16 bit integer type. + * + * @param d the source data array + */ public void copyFrom(short[] d) { mRS.validate(); copy1DRangeFrom(0, mType.getCount(), d); } + + /** + * Copy an allocation from an array. This variant is type + * checked and will generate exceptions if the Allocation type + * is not a 8 bit integer type. + * + * @param d the source data array + */ public void copyFrom(byte[] d) { mRS.validate(); copy1DRangeFrom(0, mType.getCount(), d); } + + /** + * Copy an allocation from an array. This variant is type + * checked and will generate exceptions if the Allocation type + * is not a 32 bit float type. + * + * @param d the source data array + */ public void copyFrom(float[] d) { mRS.validate(); copy1DRangeFrom(0, mType.getCount(), d); } + + /** + * Copy an allocation from a bitmap. The height, width, and + * format of the bitmap must match the existing allocation. + * + * @param b the source bitmap + */ public void copyFrom(Bitmap b) { mRS.validate(); validateBitmapSize(b); @@ -369,39 +452,114 @@ public class Allocation extends BaseObj { mRS.nAllocationGenerateMipmaps(getID()); } - void copy1DRangeFromUnchecked(int off, int count, int[] d) { + /** + * Copy part of an allocation from an array. This variant is + * not type checked which allows an application to fill in + * structured data from an array. + * + * @param off The offset of the first element to be copied. + * @param count The number of elements to be copied. + * @param d the source data array + */ + public void copy1DRangeFromUnchecked(int off, int count, int[] d) { int dataSize = mType.mElement.getSizeBytes() * count; data1DChecks(off, count, d.length * 4, dataSize); mRS.nAllocationData1D(getID(), off, 0, count, d, dataSize); } - void copy1DRangeFromUnchecked(int off, int count, short[] d) { + /** + * Copy part of an allocation from an array. This variant is + * not type checked which allows an application to fill in + * structured data from an array. + * + * @param off The offset of the first element to be copied. + * @param count The number of elements to be copied. + * @param d the source data array + */ + public void copy1DRangeFromUnchecked(int off, int count, short[] d) { int dataSize = mType.mElement.getSizeBytes() * count; data1DChecks(off, count, d.length * 2, dataSize); mRS.nAllocationData1D(getID(), off, 0, count, d, dataSize); } - void copy1DRangeFromUnchecked(int off, int count, byte[] d) { + /** + * Copy part of an allocation from an array. This variant is + * not type checked which allows an application to fill in + * structured data from an array. + * + * @param off The offset of the first element to be copied. + * @param count The number of elements to be copied. + * @param d the source data array + */ + public void copy1DRangeFromUnchecked(int off, int count, byte[] d) { int dataSize = mType.mElement.getSizeBytes() * count; data1DChecks(off, count, d.length, dataSize); mRS.nAllocationData1D(getID(), off, 0, count, d, dataSize); } - void copy1DRangeFromUnchecked(int off, int count, float[] d) { + /** + * Copy part of an allocation from an array. This variant is + * not type checked which allows an application to fill in + * structured data from an array. + * + * @param off The offset of the first element to be copied. + * @param count The number of elements to be copied. + * @param d the source data array + */ + public void copy1DRangeFromUnchecked(int off, int count, float[] d) { int dataSize = mType.mElement.getSizeBytes() * count; data1DChecks(off, count, d.length * 4, dataSize); mRS.nAllocationData1D(getID(), off, 0, count, d, dataSize); } + /** + * Copy part of an allocation from an array. This variant is + * type checked and will generate exceptions if the Allocation + * type is not a 32 bit integer type. + * + * @param off The offset of the first element to be copied. + * @param count The number of elements to be copied. + * @param d the source data array + */ public void copy1DRangeFrom(int off, int count, int[] d) { validateIsInt32(); copy1DRangeFromUnchecked(off, count, d); } + + /** + * Copy part of an allocation from an array. This variant is + * type checked and will generate exceptions if the Allocation + * type is not a 16 bit integer type. + * + * @param off The offset of the first element to be copied. + * @param count The number of elements to be copied. + * @param d the source data array + */ public void copy1DRangeFrom(int off, int count, short[] d) { validateIsInt16(); copy1DRangeFromUnchecked(off, count, d); } + + /** + * Copy part of an allocation from an array. This variant is + * type checked and will generate exceptions if the Allocation + * type is not a 8 bit integer type. + * + * @param off The offset of the first element to be copied. + * @param count The number of elements to be copied. + * @param d the source data array + */ public void copy1DRangeFrom(int off, int count, byte[] d) { validateIsInt8(); copy1DRangeFromUnchecked(off, count, d); } + + /** + * Copy part of an allocation from an array. This variant is + * type checked and will generate exceptions if the Allocation + * type is not a 32 bit float type. + * + * @param off The offset of the first element to be copied. + * @param count The number of elements to be copied. + * @param d the source data array + */ public void copy1DRangeFrom(int off, int count, float[] d) { validateIsFloat32(); copy1DRangeFromUnchecked(off, count, d); |