diff options
Diffstat (limited to 'graphics/java/android/renderscript/Allocation.java')
-rw-r--r-- | graphics/java/android/renderscript/Allocation.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java index 1593b7730a8f..e44a3ef50a6a 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. * |