Cleanup error message for null binding address.

Only print the debug if script debugging is enabled.

Change-Id: I72b9c2a73d49987a73b354442e9defec02b93bc6

Implement inner utiliy class to specify surface formats.
Remove boxed bitmap upload functions.

Change-Id: I3ff5ca59e53d02b9d75277afa947ea3d218459eb
This commit is contained in:
Jason Sams
2010-10-10 17:58:25 -07:00
parent 7499a1ca68
commit 2222aa9003
16 changed files with 108 additions and 91 deletions

View File

@@ -372,17 +372,6 @@ public class Allocation extends BaseObj {
return a;
}
static Allocation createFromBitmapBoxed(RenderScript rs, Bitmap b, Element dstFmt, boolean genMips)
throws IllegalArgumentException {
rs.validate();
int id = rs.nAllocationCreateFromBitmapBoxed(dstFmt.mID, genMips, b);
if(id == 0) {
throw new IllegalStateException("Load failed.");
}
return new Allocation(id, rs, null);
}
static public Allocation createFromBitmapResource(RenderScript rs, Resources res, int id, Element dstFmt, boolean genMips)
throws IllegalArgumentException {
@@ -415,24 +404,6 @@ public class Allocation extends BaseObj {
return null;
}
static public Allocation createFromBitmapResourceBoxed(RenderScript rs, Resources res, int id, Element dstFmt, boolean genMips)
throws IllegalArgumentException {
mBitmapOptions.inPreferredConfig = null;
if (dstFmt == rs.mElement_RGBA_8888) {
mBitmapOptions.inPreferredConfig = Bitmap.Config.ARGB_8888;
} else if (dstFmt == rs.mElement_RGB_888) {
mBitmapOptions.inPreferredConfig = Bitmap.Config.ARGB_8888;
} else if (dstFmt == rs.mElement_RGBA_4444) {
mBitmapOptions.inPreferredConfig = Bitmap.Config.ARGB_4444;
} else if (dstFmt == rs.mElement_RGB_565) {
mBitmapOptions.inPreferredConfig = Bitmap.Config.RGB_565;
}
Bitmap b = BitmapFactory.decodeResource(res, id, mBitmapOptions);
return createFromBitmapBoxed(rs, b, dstFmt, genMips);
}
static public Allocation createFromString(RenderScript rs, String str)
throws IllegalArgumentException {
byte[] allocArray = null;