diff options
author | Jason Sams <rjsams@android.com> | 2009-07-28 12:02:16 -0700 |
---|---|---|
committer | Jason Sams <rjsams@android.com> | 2009-07-28 12:02:16 -0700 |
commit | b0ec1b46d6f5b5612e33fe43a828abea79b87a00 (patch) | |
tree | 3bf6193634273ec0cbf2e6a024f8afb315fb2f61 /graphics/java/android | |
parent | 8af858e9b6577d074c5427e601b6418d288fdb9d (diff) | |
download | frameworks_base-b0ec1b46d6f5b5612e33fe43a828abea79b87a00.zip frameworks_base-b0ec1b46d6f5b5612e33fe43a828abea79b87a00.tar.gz frameworks_base-b0ec1b46d6f5b5612e33fe43a828abea79b87a00.tar.bz2 |
Add "boxed" bitmap uploads which simply place a non-pow2 bitmap into the smallest larger pow texture. The added space is filled black.
Diffstat (limited to 'graphics/java/android')
-rw-r--r-- | graphics/java/android/renderscript/RenderScript.java | 8 |
1 files changed, 7 insertions, 1 deletions
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); } |