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

Commit 7f2e4efa authored by Michael Jurka's avatar Michael Jurka Committed by Android Git Automerger
Browse files

am c24b1448: Merge "Don\'t mark recycled bitmaps as immutable"

# Via Android (Google) Code Review (1) and Michael Jurka (1)
* commit 'c24b1448':
  Don't mark recycled bitmaps as immutable
parents d0351a67 c24b1448
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -384,7 +384,7 @@ static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding,
        return nullObjectReturn("Got null SkPixelRef");
    }

    if (!isMutable) {
    if (!isMutable && !useExistingBitmap) {
        // promise we will never change our pixels (great for sharing and pictures)
        pr->setImmutable();
    }
+7 −5
Original line number Diff line number Diff line
@@ -49,12 +49,14 @@ public class BitmapFactory {
         * If set, decode methods that take the Options object will attempt to
         * reuse this bitmap when loading content. If the decode operation cannot
         * use this bitmap, the decode method will return <code>null</code> and
         * will throw an IllegalArgumentException. The
         * current implementation necessitates that the reused bitmap be of the
         * same size as the source content and in jpeg or png format (whether as a
         * resource or as a stream). The {@link android.graphics.Bitmap.Config
         * will throw an IllegalArgumentException. The current implementation
         * necessitates that the reused bitmap be mutable and of the same size as the
         * source content. The source content must be in jpeg or png format (whether as
         * a resource or as a stream). The {@link android.graphics.Bitmap.Config
         * configuration} of the reused bitmap will override the setting of
         * {@link #inPreferredConfig}, if set.
         * {@link #inPreferredConfig}, if set. The reused bitmap will continue to
         * remain mutable even when decoding a resource which would normally result
         * in an immutable bitmap.
         *
         * <p>You should still always use the returned Bitmap of the decode
         * method and not assume that reusing the bitmap worked, due to the