Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10442203 authored by Romain Guy's avatar Romain Guy Committed by Android Git Automerger
Browse files

am 5a14271a: am d6f7f225: Merge "Load bitmaps in the correct format." into gingerbread

Merge commit '5a14271a'

* commit '5a14271a':
  Load bitmaps in the correct format.
parents 4077d7a7 5a14271a
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -395,6 +395,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);
    }