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

Commit 08587d45 authored by Romain Guy's avatar Romain Guy
Browse files

Set the color space as nullptr on native bitmaps when sRGB is requested

This regression is a fallout from the recent API council feedback
fallout. The default color space used to be always set to null but
it's now the named SRGB instance. This change passes null to native
when the specified color space is known to be sRGB.

Bug: 37496760
Test: runtest managed-provisioning
Change-Id: Ie933c84e429a682a58ee253b57b77bd61b88ee5e
parent f3ff7b82
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -996,7 +996,9 @@ public final class Bitmap implements Parcelable {
        }

        Bitmap bm;
        if (config != Config.ARGB_8888) {
        // nullptr color spaces have a particular meaning in native and are interpreted as sRGB
        // (we also avoid the unnecessary extra work of the else branch)
        if (config != Config.ARGB_8888 || colorSpace == ColorSpace.get(ColorSpace.Named.SRGB)) {
            bm = nativeCreate(null, 0, width, width, height, config.nativeInt, true, null, null);
        } else {
            if (!(colorSpace instanceof ColorSpace.Rgb)) {