diff options
Diffstat (limited to 'graphics/java/android/renderscript/Allocation.java')
-rw-r--r-- | graphics/java/android/renderscript/Allocation.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java index 985d700..2c076b3 100644 --- a/graphics/java/android/renderscript/Allocation.java +++ b/graphics/java/android/renderscript/Allocation.java @@ -182,6 +182,24 @@ public class Allocation extends BaseObj { mRS.nAllocationRead(mID, d); } + public void resize(int dimX) { + if ((mType.getY() > 0)|| (mType.getZ() > 0) || mType.getFaces() || mType.getLOD()) { + throw new IllegalStateException("Resize only support for 1D allocations at this time."); + } + mRS.nAllocationResize1D(mID, dimX); + } + + /* + public void resize(int dimX, int dimY) { + if ((mType.getZ() > 0) || mType.getFaces() || mType.getLOD()) { + throw new IllegalStateException("Resize only support for 2D allocations at this time."); + } + if (mType.getY() == 0) { + throw new IllegalStateException("Resize only support for 2D allocations at this time."); + } + mRS.nAllocationResize2D(mID, dimX, dimY); + } + */ public class Adapter1D extends BaseObj { Adapter1D(int id, RenderScript rs) { |