summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-08-20 15:45:09 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-08-20 15:45:09 -0700
commit5a14271aacb932ba0d52978c939f74e4c685f7d6 (patch)
treeac9e2e9bed2f97bcf4479be7e46600bae3e01d70 /graphics
parent485de781f6bd30dfb7aa1e55c4f1efb3d3b11eba (diff)
parentd6f7f225689ecd33dc54699acc01cfafc781c20d (diff)
downloadframeworks_base-5a14271aacb932ba0d52978c939f74e4c685f7d6.zip
frameworks_base-5a14271aacb932ba0d52978c939f74e4c685f7d6.tar.gz
frameworks_base-5a14271aacb932ba0d52978c939f74e4c685f7d6.tar.bz2
am d6f7f225: Merge "Load bitmaps in the correct format." into gingerbread
Merge commit 'd6f7f225689ecd33dc54699acc01cfafc781c20d' into gingerbread-plus-aosp * commit 'd6f7f225689ecd33dc54699acc01cfafc781c20d': Load bitmaps in the correct format.
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/renderscript/Allocation.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java
index 17c0778..b27c7f5 100644
--- a/graphics/java/android/renderscript/Allocation.java
+++ b/graphics/java/android/renderscript/Allocation.java
@@ -363,6 +363,17 @@ public class Allocation extends BaseObj {
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);
}