Expose unchecked copyFrom variants.
Change-Id: I452d082bb4adbd578b6300bf5829dc59e91e517a
diff --git a/api/11.xml b/api/11.xml
index 4f4cc5e..945c614 100644
--- a/api/11.xml
+++ b/api/11.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"
@@ -175641,6 +175761,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"
@@ -175663,6 +175794,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 11837d5..945c614 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 1789891..74cdf80 100644
--- a/graphics/java/android/renderscript/Allocation.java
+++ b/graphics/java/android/renderscript/Allocation.java
@@ -268,22 +268,105 @@
}
}
+ /**
+ * 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 @@
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);