From b62f50cf763279fa0d0aa2f80624de02c7a1c2fb Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Thu, 12 Jul 2018 14:44:27 -0400 Subject: Replace nearly all kRespect with kIgnore - Encoders and decoders always assume kIgnore. - They are less opinionated about F16 and color space, we just trust the color space that's passed in, and put that directly in the image (no sRGB encoding). - SkBitmap and SkPixmap read/write pixels functions were defaulting to kResepct, those are now always kIgnore. - Many other bits of plumbing are simplified, and I added a default of kIgnore to SkImage::makeColorSpace, so we can phase out that argument entirely. - Still need to add defaults to other public APIs that take SkTransferFunctionBehavior. - This makes gold think that we've dramatically changed the contents of all F16 images, but that's because it doesn't understand the (now linear) color space that's embedded. Once we triage them all once, they will work fine (and they'll look perfect in the browser). Bug: skia: Change-Id: I62fa090f96cae1b67d181ce14bd91f34ff2ed747 Reviewed-on: https://skia-review.googlesource.com/140570 Commit-Queue: Brian Osman Reviewed-by: Mike Klein --- gm/encode-platform.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'gm/encode-platform.cpp') diff --git a/gm/encode-platform.cpp b/gm/encode-platform.cpp index a9eaae6128..9f94597fa7 100644 --- a/gm/encode-platform.cpp +++ b/gm/encode-platform.cpp @@ -72,9 +72,7 @@ static sk_sp encode_data(SkEncodedImageFormat type, const SkBitmap& bitm #else switch (type) { case SkEncodedImageFormat::kPNG: { - SkPngEncoder::Options options; - options.fUnpremulBehavior = SkTransferFunctionBehavior::kIgnore; - bool success = SkPngEncoder::Encode(&buf, src, options); + bool success = SkPngEncoder::Encode(&buf, src, SkPngEncoder::Options()); return success ? buf.detachAsData() : nullptr; } case SkEncodedImageFormat::kJPEG: { @@ -82,9 +80,7 @@ static sk_sp encode_data(SkEncodedImageFormat type, const SkBitmap& bitm return success ? buf.detachAsData() : nullptr; } case SkEncodedImageFormat::kWEBP: { - SkWebpEncoder::Options options; - options.fUnpremulBehavior = SkTransferFunctionBehavior::kIgnore; - bool success = SkWebpEncoder::Encode(&buf, src, options); + bool success = SkWebpEncoder::Encode(&buf, src, SkWebpEncoder::Options()); return success ? buf.detachAsData() : nullptr; } default: -- cgit v1.2.3