diff options
author | Mike Klein <mtklein@chromium.org> | 2018-05-10 11:29:15 -0400 |
---|---|---|
committer | Mike Klein <mtklein@chromium.org> | 2018-05-10 18:26:22 +0000 |
commit | ce4cf72e3487f661e53f6d0c3416c9b58da4fd00 (patch) | |
tree | 5e8a5b884c787a095ea25ea93070569731e937a1 /src/images | |
parent | 024615e9752d93c842ad3cad597fd65382ddb678 (diff) |
non-linear blending first steps
Code:
- Add a non-linear blending bit and makeNonlinearBlending()
to SkColorSpace
- remove enough F16=linear checks to make it possible to
create surfaces and encode pngs with nonlinear F16
Testing:
- add "esrgb" software config to DM, run it
- add "srgbnl" software config, run it
- deemphasize importance of "srgb" config on bots
- update unit tests to reflect relaxed F16 constraints
- add a new unit test file with _really_ basic tests,
and a new unit test that's not working yet
Bug: skia:7942
Change-Id: I8ac042bdf9f3d791765393b68fd9256375184d83
Reviewed-on: https://skia-review.googlesource.com/127325
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/images')
-rw-r--r-- | src/images/SkJpegEncoder.cpp | 2 | ||||
-rw-r--r-- | src/images/SkPngEncoder.cpp | 2 | ||||
-rw-r--r-- | src/images/SkWebpEncoder.cpp | 4 |
3 files changed, 2 insertions, 6 deletions
diff --git a/src/images/SkJpegEncoder.cpp b/src/images/SkJpegEncoder.cpp index 305152d978..606b553537 100644 --- a/src/images/SkJpegEncoder.cpp +++ b/src/images/SkJpegEncoder.cpp @@ -118,7 +118,7 @@ bool SkJpegEncoderMgr::setParams(const SkImageInfo& srcInfo, const SkJpegEncoder numComponents = 1; break; case kRGBA_F16_SkColorType: - if (!srcInfo.colorSpace() || !srcInfo.colorSpace()->gammaIsLinear() || + if (!srcInfo.colorSpace() || SkTransferFunctionBehavior::kRespect != options.fBlendBehavior) { return false; } diff --git a/src/images/SkPngEncoder.cpp b/src/images/SkPngEncoder.cpp index c7952df57a..19fc27e4a6 100644 --- a/src/images/SkPngEncoder.cpp +++ b/src/images/SkPngEncoder.cpp @@ -106,7 +106,7 @@ bool SkPngEncoderMgr::setHeader(const SkImageInfo& srcInfo, const SkPngEncoder:: int bitDepth = 8; switch (srcInfo.colorType()) { case kRGBA_F16_SkColorType: - SkASSERT(srcInfo.colorSpace() && srcInfo.colorSpace()->gammaIsLinear()); + SkASSERT(srcInfo.colorSpace()); sigBit.red = 16; sigBit.green = 16; sigBit.blue = 16; diff --git a/src/images/SkWebpEncoder.cpp b/src/images/SkWebpEncoder.cpp index a7809b2fa0..ee13563ea7 100644 --- a/src/images/SkWebpEncoder.cpp +++ b/src/images/SkWebpEncoder.cpp @@ -88,10 +88,6 @@ static transform_scanline_proc choose_proc(const SkImageInfo& info, case kGray_8_SkColorType: return transform_scanline_gray; case kRGBA_F16_SkColorType: - if (!info.colorSpace() || !info.colorSpace()->gammaIsLinear()) { - return nullptr; - } - switch (info.alphaType()) { case kOpaque_SkAlphaType: case kUnpremul_SkAlphaType: |