Skip to content
Commit 3eadfde6 authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

Attach color space after performing a readback

Bug: 78463311
Test: I28713c3e5ce38dea15c75542801f9aef0e5b5b0a

Bitmap::getSkBitmap() is used by Bitmap#compress before encoding. If the
Bitmap has Config HARDWARE, we have to do a readback first. We cannot
necessarily do the readback using the SkColorSpace of the Bitmap, since
that requires creating an SkSurface, which does not support all
SkColorSpaces. Instead, continue using nullptr for the readback, and
then change the info and reattach the SkPixelRef.

This fixes a bug where encoding a non-SRGB HARDWARE Bitmap and then
decoding it results in a Bitmap with the wrong ColorSpace.

Change-Id: If55b2dbfeb17d81ceaf9594b32ed69b6a9058f06
parent e5d97dd6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment