Add jpeg encoder alpha handling option
authorMatt Sarett <msarett@google.com>
Tue, 9 May 2017 16:46:50 +0000 (12:46 -0400)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Tue, 9 May 2017 18:32:04 +0000 (18:32 +0000)
commit2e61b182dad86e592d12c8a73ffcc7555a6e11a2
tree323281b163e71f8058eab694c9562a2c1b007b67
parentee2d9df087c5225c9f3ba0fb98d237905f2d650c
Add jpeg encoder alpha handling option

This instructs us on how to encode jpegs when the src
image has alpha.  The original behavior is to ignore
the alpha channel.  This CL adds the option to blend
the pixels onto opaque black.

Note that kBlendOnBlack and kIgnore are identical
unless the input alpha type is kUnpremul.

Bug: 713862
Bug: skia:1501
Change-Id: I4891c70bb0ccd83f7974c359bd40a2143b5c49ac
Reviewed-on: https://skia-review.googlesource.com/15817
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
gm/encode-alpha-jpeg.cpp [new file with mode: 0644]
gn/gm.gni
resources/rainbow-gradient.png [new file with mode: 0644]
src/images/SkImageEncoderFns.h
src/images/SkJpegEncoder.cpp
src/images/SkJpegEncoder.h