Fix SkColorSpaceXform::apply returning false when using Rec2020 and P3 |
||
Issue descriptionWhen using SkColorSpaceXform::apply() to convert pixels from SRGB to Rec2020 and P3, which are provided by calling gfx::ColorSpace(PrimaryID, TransferID).ToSkColorSpace().get(), the SkColorSpaceXform::apply() returns false. Please see the minimal unit test attached to this description. Running this test by "webkit_unit_tests --gtest_filter=ColorSpaceConversionTest.*" results in two passes (SRGB->SRGB and SRGB->LinearRGB) and two fails (SRGB->Rec2020 and SRGB->P3). (To compile the test, ColorSpaceConversionTest.cpp must be added to "uint_tests" section of "third_party/WebKit/Source/core/BUILD.gn").
,
Mar 30 2017
Taking a look at this. My guess offhand is that kUnpremul_SkAlphaType is the source of the problems, and that we'll need the alpha type to be premultiplied.
,
Mar 30 2017
Oops, disregard #2.
From SkColorSpaceXform.h:
* F16 and F32 are only supported when the color space is linear. This
* function will return false in unsupported cases.
If you change the transfer function to gfx::ColorSpace::TransferID::LINEAR, it passes.
|
||
►
Sign in to add a comment |
||
Comment 1 by zakerinasab@chromium.org
, Mar 30 2017