SkImageEncoder: Be more lenient on inputs
authorMatt Sarett <msarett@google.com>
Wed, 5 Apr 2017 21:36:04 +0000 (17:36 -0400)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Wed, 5 Apr 2017 22:56:37 +0000 (22:56 +0000)
commit7abfb5e1547bcbf626b2078991a9fe31c24b5d10
treea49a9092113724118589802260e854cf812e5791
parent3dbef9f184cfecadf14d4c424cf02ee2e8f68d44
SkImageEncoder: Be more lenient on inputs

(1) Some clients want us to write ICC profiles, even though they
    have not opted into linear unpremultiplication.  This CL allows
    that behavior.

(2) We should not assert that the transfer function must be linear
    or srgb.  Particularly in non-linear blending modes, skia is
    willing to support a larger set of transfer functions.

(3) We still need to require linear or srgb when in kRespect transfer
    function mode.  We have not yet implemented linear unpremultiplies
    for arbitrary transfer functions.

Bug: skia:
Change-Id: Idce9f07c3d36eca4d78ede5e2650b2cab412904c
Reviewed-on: https://skia-review.googlesource.com/11349
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
src/images/SkJPEGImageEncoder.cpp
src/images/SkPNGImageEncoder.cpp
src/images/SkWEBPImageEncoder.cpp
tests/CodecTest.cpp