From 12d966fc4f0019a180999a93bd18d862e6b54ded Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Fri, 24 Aug 2018 17:36:50 +0000 Subject: [PATCH] Reland "match sRGB primaries with skcms" This reverts commit 3dfc752622d524921ab141b487c6b99a472be9bf. Reason for revert: Re-landing now that chrome is guarded. Original change's description: > Revert "match sRGB primaries with skcms" > > This reverts commit 66567d870fd1ef8ae4aa0d848b3fe1371d5bd051. > > Reason for revert: will reland after guarding Chromium. > > Original change's description: > > match sRGB primaries with skcms > > > > This should prevent lots of conversions between the two > > gamuts when the matrix is nearly but not quite identity. > > > > Change-Id: Icb6ba35d763e9fbd2d7fc6343d49fe2c542ec2ec > > Reviewed-on: https://skia-review.googlesource.com/148990 > > Commit-Queue: Mike Klein > > Commit-Queue: Brian Osman > > Auto-Submit: Mike Klein > > Reviewed-by: Brian Osman > > TBR=mtklein@google.com,brianosman@google.com > > Change-Id: If511843bdfc7cdef2a3b68eb992e684123e806de > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://skia-review.googlesource.com/149080 > Reviewed-by: Mike Klein > Commit-Queue: Mike Klein TBR=mtklein@google.com,brianosman@google.com Change-Id: I0117bf28b12c784fa05088e3ea611f415f2d4711 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/149260 Reviewed-by: Brian Osman Commit-Queue: Brian Osman --- src/core/SkColorSpacePriv.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/SkColorSpacePriv.h b/src/core/SkColorSpacePriv.h index 278a6a47d2..7df6c97966 100644 --- a/src/core/SkColorSpacePriv.h +++ b/src/core/SkColorSpacePriv.h @@ -15,9 +15,17 @@ #define SkColorSpacePrintf(...) static constexpr float gSRGB_toXYZD50[] { +#ifdef SK_LEGACY_SRGB_GAMUT 0.4360747f, 0.3850649f, 0.1430804f, // Rx, Gx, Bx 0.2225045f, 0.7168786f, 0.0606169f, // Ry, Gy, By 0.0139322f, 0.0971045f, 0.7141733f, // Rz, Gz, Bz +#else + // These are taken from skcms, and there originally from 16-bit fixed point. + // For best results, please keep them exactly in sync with skcms. + 0.436065674f, 0.385147095f, 0.143066406f, + 0.222488403f, 0.716873169f, 0.060607910f, + 0.013916016f, 0.097076416f, 0.714096069f, +#endif }; static constexpr float gAdobeRGB_toXYZD50[] {