diff options
author | Tim Murray <timmurray@google.com> | 2012-10-03 13:50:05 -0700 |
---|---|---|
committer | Tim Murray <timmurray@google.com> | 2012-10-05 16:45:45 -0700 |
commit | f671fb0b35e945e5fc1416603e3b9a1c61d9dab9 (patch) | |
tree | c61f1e97545c097a1f97dbf81d2f9b0d05b809a0 /graphics/java/android/renderscript/Allocation.java | |
parent | bc254b959744b21fd8cb9a7bf72ee3d1ae9cbba1 (diff) |
Add copyFrom(Allocation a).
Change-Id: Ibc334326083b5471584dcf1c068e4e810aede20f
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. * |