From 31a7e42f4baa059352f0db119de38428e655eab2 Mon Sep 17 00:00:00 2001 From: Jason Sams Date: Tue, 26 Oct 2010 13:09:17 -0700 Subject: Begin adding async allocation creation. Change-Id: I5d1381699e2b334c1d824f357bd6b310a5f79be8 Implement async bitmap upload and clean up types. Change-Id: Icbe9894e04c1319351c1cd75b0e0017855198f20 --- graphics/java/android/renderscript/Allocation.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'graphics/java/android/renderscript/Allocation.java') diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java index 6c08ce5..f8ad5cc 100644 --- a/graphics/java/android/renderscript/Allocation.java +++ b/graphics/java/android/renderscript/Allocation.java @@ -194,11 +194,15 @@ public class Allocation extends BaseObj { mRS.nAllocationRead(mID, d); } - public void resize(int dimX) { + public synchronized 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); + + int typeID = mRS.nAllocationGetType(mID); + mType = new Type(typeID, mRS); + mType.updateFromNative(); } /* -- cgit v1.1