New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 706833 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Feature

Blocking:
issue 706850



Sign in to add a comment

Fix SkColorSpaceXform::apply returning false when using Rec2020 and P3

Project Member Reported by zakerinasab@chromium.org, Mar 30 2017

Issue description


When 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").
 
ColorSpaceConversionTest.cpp
4.4 KB View Download
Blocking: 706850
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.
Status: Fixed (was: Assigned)
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