Refine ColorSpace restrictions for Bitmaps
Bug: 123377741 Bug: 120870651 Bug: 121001670 Bug: 123374456 Bug: 124052364 Test: I90adb511c8fdefe016028da4fd53b079d8367bf6 RGBA_F16 is no longer restricted to particular ColorSpaces. (Previously, it was LINEAR_EXTENDED_SRGB when decoded, and EXTENDED_SRGB when created.) Instead, F16 is now EXTENDED if there is an EXTENDED variant, but is otherwise not special. It defaults to SRGB (but EXTENDED), but can be created or decoded to other ColorSpaces. Likewise, smaller Configs use the non-EXTENDED variant, when the EXTENDED variant was requested. ALPHA_8 always has a null ColorSpace. Add TransferParameters to EXTENDED_SRGB. This seems to be a relic from a time before Skia treated SkColorSpaces as non-bounded. Make it have the same parameters as SRGB, so that it can be used in native code. e.g. now we can draw to/from it. Fix a bug getting the ColorSpace for gray image. ImageDecoder's info previously reported that a gray image's ColorSpace is null. (Though it correctly decoded it with the proper ColorSpace.) Allow setColorSpace to request SRGB on an EXTENDED_SRGB F16 Bitmap. (It has no visible effect.) Do *not* allow setting a ColorSpace on an ALPHA_8 Bitmap (throw an Exception). Other attempts to create a Bitmap with ALPHA_8 and a non-null ColorSpace silently use null, for backwards compatibility. Copying *from* an ALPHA_8 to another Config returns a Bitmap with SRGB. Change-Id: Ied0426f6deff354df5998691703a18ddd33ccd3d
Loading
Please register or sign in to comment