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

Commit fb3221bf authored by Mike Cleron's avatar Mike Cleron Committed by Android (Google) Code Review
Browse files

Merge "Assume ARGB_8888 for unknown configs. Bug #3327175" into honeycomb

parents 17bf5e3c feeea8f0
Loading
Loading
Loading
Loading
+18 −2
Original line number Diff line number Diff line
@@ -464,8 +464,24 @@ public final class Bitmap implements Parcelable {
        Rect srcR = new Rect(x, y, x + width, y + height);
        RectF dstR = new RectF(0, 0, width, height);

        final Config newConfig = source.getConfig() == Config.ARGB_8888 ||
                source.getConfig() == Config.ARGB_4444 ? Config.ARGB_8888 : Config.RGB_565;
        Config newConfig = Config.ARGB_8888;
        final Config config = source.getConfig();
        // GIF files generate null configs, assume ARGB_8888
        if (config != null) {
            switch (config) {
                case RGB_565:
                    newConfig = Config.RGB_565;
                    break;
                case ALPHA_8:
                    newConfig = Config.ALPHA_8;
                    break;
                case ARGB_4444:
                case ARGB_8888:
                default:
                    newConfig = Config.ARGB_8888;
                    break;
            }
        }

        if (m == null || m.isIdentity()) {
            bitmap = createBitmap(neww, newh, newConfig, source.hasAlpha());