Unify SkNamedTransferFnExt::kSRGB and SkNamedTransferFn::kSRGB
These two constants historically had slightly different values. Inline the value for SkNamedTransferFnExt::kSRGB into gfx::ColorSpace. A follow-on change will unify that (and update tests). Bug: 376758571 Change-Id: Ie10645b4306fe50d39cc6f9efbbb3ed6603b4e5d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6011217 Commit-Queue: ccameron chromium <ccameron@chromium.org> Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org> Reviewed-by: ccameron chromium <ccameron@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org> Cr-Commit-Position: refs/heads/main@{#1382856}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
aa8ea88e6b
commit
e8283d52a7
@ -58,11 +58,9 @@ static constexpr skcms_TransferFunction kSMPTE_ST_240 = {2.222222222222f,
|
||||
// IEC 61966-2-4, value 11, same as kRec709 (but is explicitly extended).
|
||||
static constexpr skcms_TransferFunction kIEC61966_2_4 = kRec709;
|
||||
|
||||
// IEC 61966-2-1 sRGB, value 13. This is almost equal to
|
||||
// SkNamedTransferFnExt::kSRGB. The differences are rounding errors that
|
||||
// cause test failures (and should be unified).
|
||||
static constexpr skcms_TransferFunction kIEC61966_2_1 = {
|
||||
2.4f, 0.947867345704f, 0.052132654296f, 0.077399380805f, 0.040449937172f};
|
||||
// IEC 61966-2-1 sRGB, value 13.
|
||||
static constexpr skcms_TransferFunction kIEC61966_2_1 =
|
||||
SkNamedTransferFn::kSRGB;
|
||||
|
||||
// Rec. ITU-R BT.2020-2 (10-bit system), value 14.
|
||||
static constexpr skcms_TransferFunction kRec2020_10bit = kRec709;
|
||||
|
@ -679,7 +679,11 @@ sk_sp<SkColorSpace> ColorSpace::ToSkColorSpace(
|
||||
return SkColorSpace::MakeSRGBLinear();
|
||||
}
|
||||
|
||||
skcms_TransferFunction transfer_fn = SkNamedTransferFnExt::kSRGB;
|
||||
// This is almost equal to SkNamedTransferFunction::kSRGB, but has some slight
|
||||
// rounding differences that some tests depend on. These tests should be
|
||||
// updated.
|
||||
skcms_TransferFunction transfer_fn = {2.4f, 0.947867345704f, 0.052132654296f,
|
||||
0.077399380805f, 0.040449937172f};
|
||||
switch (transfer_) {
|
||||
case TransferID::SRGB:
|
||||
break;
|
||||
|
Reference in New Issue
Block a user