aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2018-07-12 14:44:27 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-12 20:54:14 +0000
commitb62f50cf763279fa0d0aa2f80624de02c7a1c2fb (patch)
treea4aba5466ff7e3136bd97c35718a678354b430ea /dm
parent5bc4fc8f3f26e9e14cccee4d200309e4b500b8d3 (diff)
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 <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
Diffstat (limited to 'dm')
-rw-r--r--dm/DM.cpp1
-rw-r--r--dm/DMSrcSink.cpp4
2 files changed, 0 insertions, 5 deletions
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 5b3642ac84..e66621d7c2 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -1042,7 +1042,6 @@ static bool dump_png(SkBitmap bitmap, const char* path, const char* md5) {
options.fComments = SkDataTable::MakeCopyArrays((const void**)comments, lengths, 4);
options.fFilterFlags = SkPngEncoder::FilterFlag::kNone;
options.fZLibLevel = 1;
- options.fUnpremulBehavior = SkTransferFunctionBehavior::kIgnore;
return SkPngEncoder::Encode(&dst, pm, options);
}
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 25b87b376e..d524b1bea2 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -473,8 +473,6 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
SkAutoMalloc pixels(safeSize);
SkCodec::Options options;
- options.fPremulBehavior = canvas->imageInfo().colorSpace() ?
- SkTransferFunctionBehavior::kRespect : SkTransferFunctionBehavior::kIgnore;
if (kCodecZeroInit_Mode == fMode) {
memset(pixels.get(), 0, size.height() * rowBytes);
options.fZeroInitialized = SkCodec::kYes_ZeroInitialized;
@@ -1397,8 +1395,6 @@ static bool encode_png_base64(const SkBitmap& bitmap, SkString* dst) {
SkPngEncoder::Options options;
options.fFilterFlags = SkPngEncoder::FilterFlag::kAll;
options.fZLibLevel = 9;
- options.fUnpremulBehavior = pm.colorSpace() ? SkTransferFunctionBehavior::kRespect
- : SkTransferFunctionBehavior::kIgnore;
SkDynamicMemoryWStream wStream;
if (!SkPngEncoder::Encode(&wStream, pm, options)) {