From b0ec1b46d6f5b5612e33fe43a828abea79b87a00 Mon Sep 17 00:00:00 2001 From: Jason Sams Date: Tue, 28 Jul 2009 12:02:16 -0700 Subject: Add "boxed" bitmap uploads which simply place a non-pow2 bitmap into the smallest larger pow texture. The added space is filled black. --- graphics/java/android/renderscript/RenderScript.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'graphics/java/android') diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java index f829b08..2b9e448 100644 --- a/graphics/java/android/renderscript/RenderScript.java +++ b/graphics/java/android/renderscript/RenderScript.java @@ -96,6 +96,7 @@ public class RenderScript { native private int nAllocationCreatePredefSized(int predef, int count); native private int nAllocationCreateSized(int elem, int count); native private int nAllocationCreateFromBitmap(int dstFmt, boolean genMips, Bitmap bmp); + native private int nAllocationCreateFromBitmapBoxed(int dstFmt, boolean genMips, Bitmap bmp); native private void nAllocationUploadToTexture(int alloc, int baseMioLevel); native private void nAllocationDestroy(int alloc); @@ -529,7 +530,12 @@ public class RenderScript { } public Allocation allocationCreateFromBitmap(Bitmap b, ElementPredefined dstFmt, boolean genMips) { - int id = nAllocationCreateFromBitmap(dstFmt.mID, genMips, b); + int id = nAllocationCreateFromBitmap(dstFmt.mID, genMips, b); + return new Allocation(id); + } + + public Allocation allocationCreateFromBitmapBoxed(Bitmap b, ElementPredefined dstFmt, boolean genMips) { + int id = nAllocationCreateFromBitmapBoxed(dstFmt.mID, genMips, b); return new Allocation(id); } -- cgit v1.1