Update allocation from bitmap.

GL attribute cleanup in type.

Change-Id: I504dcf6744ad13d65e068e784b6608c999ab48c6
This commit is contained in:
Alex Sakhartchouk
2010-10-11 12:35:15 -07:00
parent 3e6fee857a
commit 26ae3904e8
9 changed files with 113 additions and 10 deletions

View File

@@ -90,6 +90,18 @@ public class Allocation extends BaseObj {
subData1D(0, mType.getElementCount(), d);
}
public void updateFromBitmap(Bitmap b)
throws IllegalArgumentException {
mRS.validate();
if(mType.getX() != b.getWidth() ||
mType.getY() != b.getHeight()) {
throw new IllegalArgumentException("Cannot update allocation from bitmap, sizes mismatch");
}
mRS.nAllocationUpdateFromBitmap(mID, b);
}
public void subData(int xoff, FieldPacker fp) {
int eSize = mType.mElement.getSizeBytes();
final byte[] data = fp.getData();