diff options
| author | Jason Sams <rjsams@android.com> | 2010-10-26 13:09:17 -0700 |
|---|---|---|
| committer | Jason Sams <rjsams@android.com> | 2010-10-26 13:09:17 -0700 |
| commit | 31a7e42f4baa059352f0db119de38428e655eab2 (patch) | |
| tree | 7e3bf245244215cad507f57c24043f20a91bcd8c /graphics/java/android | |
| parent | cd44bf9c7ae89edcf906451e162d096cf3d7e561 (diff) | |
| download | frameworks_base-31a7e42f4baa059352f0db119de38428e655eab2.zip frameworks_base-31a7e42f4baa059352f0db119de38428e655eab2.tar.gz frameworks_base-31a7e42f4baa059352f0db119de38428e655eab2.tar.bz2 | |
Begin adding async allocation creation.
Change-Id: I5d1381699e2b334c1d824f357bd6b310a5f79be8
Implement async bitmap upload and clean up types.
Change-Id: Icbe9894e04c1319351c1cd75b0e0017855198f20
Diffstat (limited to 'graphics/java/android')
| -rw-r--r-- | graphics/java/android/renderscript/Allocation.java | 6 | ||||
| -rw-r--r-- | graphics/java/android/renderscript/Script.java | 17 |
2 files changed, 6 insertions, 17 deletions
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(); } /* diff --git a/graphics/java/android/renderscript/Script.java b/graphics/java/android/renderscript/Script.java index 53a33e4..430789a 100644 --- a/graphics/java/android/renderscript/Script.java +++ b/graphics/java/android/renderscript/Script.java @@ -112,12 +112,10 @@ public class Script extends BaseObj { public static class FieldBase { protected Element mElement; - protected Type mType; protected Allocation mAllocation; protected void init(RenderScript rs, int dimx) { mAllocation = Allocation.createSized(rs, mElement, dimx); - mType = mAllocation.getType(); } protected FieldBase() { @@ -128,7 +126,7 @@ public class Script extends BaseObj { } public Type getType() { - return mType; + return mAllocation.getType(); } public Allocation getAllocation() { @@ -138,19 +136,6 @@ public class Script extends BaseObj { //@Override public void updateAllocation() { } - - - // - /* - public class ScriptField_UserField - extends android.renderscript.Script.FieldBase { - - protected - - } - - */ - } } |
