Merge "Set the color space as nullptr on native bitmaps when sRGB is requested" into oc-dev

am: e53b00c6d1

Change-Id: I03d0cb5717a0f559890aea201f6d7883c5f6c57f
This commit is contained in:
Romain Guy
2017-04-19 21:46:11 +00:00
committed by android-build-merger

View File

@@ -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)) {