Implement allocation resizing.

Change-Id: Ie38d42419d595cec730a8721cc1321c5edb6b4d6
This commit is contained in:
Jason Sams
2010-10-05 13:32:49 -07:00
parent 2a2a38db16
commit 5edc608a07
8 changed files with 163 additions and 4 deletions

View File

@@ -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) {