summaryrefslogtreecommitdiffstats
path: root/graphics/java/android/renderscript/Allocation.java
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/java/android/renderscript/Allocation.java')
-rw-r--r--graphics/java/android/renderscript/Allocation.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java
index 10ccb87..e44a3ef 100644
--- a/graphics/java/android/renderscript/Allocation.java
+++ b/graphics/java/android/renderscript/Allocation.java
@@ -568,6 +568,21 @@ public class Allocation extends BaseObj {
}
/**
+ * Copy an allocation from an allocation. The types of both allocations
+ * must be identical.
+ *
+ * @param a the source allocation
+ */
+ public void copyFrom(Allocation a) {
+ mRS.validate();
+ if (!mType.equals(a.getType())) {
+ throw new RSIllegalArgumentException("Types of allocations must match.");
+ }
+ copy2DRangeFrom(0, 0, mCurrentDimX, mCurrentDimY, a, 0, 0);
+ }
+
+
+ /**
* This is only intended to be used by auto-generate code reflected from the
* renderscript script files.
*
@@ -971,11 +986,10 @@ public class Allocation extends BaseObj {
*
* A new type will be created with the new dimension.
*
- * @hide
* @param dimX The new size of the allocation.
* @param dimY The new size of the allocation.
*/
- public void resize(int dimX, int dimY) {
+ public synchronized void resize(int dimX, int dimY) {
if ((mType.getZ() > 0) || mType.hasFaces() || mType.hasMipmaps()) {
throw new RSInvalidStateException(
"Resize only support for 2D allocations at this time.");