From a76b7a9ded28ea36a00fc1a59d6e9aec5bd4f29c Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Wed, 18 Jul 2018 14:36:43 -0400 Subject: More color space improvements to DM Added P3 configs (tagged surface and SkColorSpaceXformCanvas) Added logic to tag the output PNGs when using a xform canvas, so the images look correct in Chrome (and work correctly with skdiff). We don't use the gamma_correct tag for much in gold, but only set it for outputs with a linear transfer function. Change-Id: Iee713682e5010b0bd3212538a6dcb201ae4e8592 Reviewed-on: https://skia-review.googlesource.com/142170 Reviewed-by: Greg Daniel Commit-Queue: Brian Osman --- dm/DM.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'dm/DM.cpp') diff --git a/dm/DM.cpp b/dm/DM.cpp index 5e21e896ff..83a9f17035 100644 --- a/dm/DM.cpp +++ b/dm/DM.cpp @@ -946,6 +946,9 @@ static sk_sp rgb_to_gbr() { static Sink* create_via(const SkString& tag, Sink* wrapped) { #define VIA(t, via, ...) if (tag.equals(t)) { return new via(__VA_ARGS__); } VIA("gbr", ViaCSXform, wrapped, rgb_to_gbr(), true); + VIA("p3", ViaCSXform, wrapped, + SkColorSpace::MakeRGB(SkColorSpace::kSRGB_RenderTargetGamma, + SkColorSpace::kDCIP3_D65_Gamut), false); VIA("lite", ViaLite, wrapped); VIA("pipe", ViaPipe, wrapped); #ifdef TEST_VIA_SVG @@ -1182,10 +1185,9 @@ struct Task { const char* ext, SkStream* data, size_t len, const SkBitmap* bitmap) { - bool gammaCorrect = false; - if (bitmap) { - gammaCorrect = SkToBool(bitmap->info().colorSpace()); - } + bool gammaCorrect = bitmap && + bitmap->info().colorSpace() && + bitmap->info().colorSpace()->gammaIsLinear(); JsonWriter::BitmapResult result; result.name = task.src->name(); -- cgit v1.2.3