skia2/include
Leon Scroggins III 81886e8f94 Switch SkCodec to use skcms
Bug: skia:6839
Bug: skia:8052

Create an skcms_Profile instead of an SkColorSpace when creating an
SkCodec. Eventually we'll move the SkImageInfo (and its SkColorSpace)
entirely to clients (e.g. SkAndroidCodec, SkCodecImageGenerator), but
for now, create it with SkEncodedInfo::makeImageInfo.

Create new SkEncodedInfo::Colors for the special PNG cases that we
want to map to specific SkColorTypes.

SkEncodedInfo:
- Add ICCProfile, which owns an skcms_ICCProfile
 - FIXME: maybe we should have a single instance for
  SRGB like SkColorSpace?
- Add kXAlpha_Color, for kAlpha_8. Since I'm not longer creating
  an SkImageInfo (at least in SkPngCodec), it needs a way to pass
  this info to the caller.
- Add k565_Color, for the same reason. Matt originally had this in
  https://codereview.chromium.org/2212563003/#ps120001, but didn't
  land that version. I like it though. Mike didn't like the bits
  per component for 565, but it seems like a sensible hack, much
  like the existing one for kAlpha_8
- Add width and height. These were removed for redundancy with
  SkImageInfo, but it makes sense to have them here without it.
BUILD.gn:
- Build the new SkEncodedInfo.cpp
SkCodec:
- Remove the constructor with an SkImageInfo. Edit the other one
  to drop width and height (now in SkEncodedInfo) and take a RHS
  reference to SkEncodedInfo
- Create the SkImageInfo from fEncodedInfo (for now)
- Consolidate choosing skcms_AlphaFormat for Transform here
- Call conversionSupported from initializeColorXform, with a new
  parameter for whether there is a color Xform, allowing SkJpegCodec
  and SkHeifCodec to override that method instead of having another
  method.
SkBmpCodec (etc)
- Adapt to the changes above
- Create a new SkEncodedInfo w/o profile for the swizzler.
SkPngCodec:
- use the new SkEncodedInfo::Colors rather than a custom SkImageInfo
SkRawCodec:
- Remove SkEncodedInfo from SkDngImage, which doesn't actually need it.
  This is helpful since we don't know all the info yet.
- Rewrite gAdobeRGB_toXYZD50 as an skcms_Matrix3x3
SkWebpCodec:
- Remove premul_step computation, and simplify to just rely on
  the base class' handling of applying the transform.
SkSwizzler:
- Add cases for the new SkEncodedInfo::Colors

TBR=reed@google.com
No public API changes. Only private/public members of SkCodec.h are
modified.

Change-Id: Ic0d3bb752b03f13be886b80331987aa5a5713fc0
Reviewed-on: https://skia-review.googlesource.com/136062
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-08-22 18:16:20 +00:00
..
android Alternate between two SkBitmaps in SkAnimatedImage 2018-05-23 20:49:42 +00:00
atlastext Move op memory storage to GrContext (take 2) 2018-06-19 19:51:20 +00:00
c C API: document sk_matrix_t 2017-03-21 18:04:34 +00:00
codec Switch SkCodec to use skcms 2018-08-22 18:16:20 +00:00
config remove unused parts of SkTypes.h 2018-06-08 23:53:57 +00:00
core Remove occluder parameter from SkMaskFilter::MakeBlur factory 2018-08-22 15:59:29 +00:00
effects move patheffect virtuals to protected and rename 2018-08-16 17:47:22 +00:00
encode Move SkNoncopyable to include/private. 2018-07-17 21:39:51 +00:00
gpu Add unfold_short_circuit_as_ternary workaround 2018-08-22 16:54:26 +00:00
pathops fixup winding contours 2018-08-17 14:01:51 +00:00
ports Expose public factories for platform decoders 2018-06-26 17:30:52 +00:00
private Switch SkCodec to use skcms 2018-08-22 18:16:20 +00:00
svg Add a SkWStream-based SkSVGCanvas factory 2017-09-19 20:33:19 +00:00
utils added optimizations to speed up skinning 2018-08-15 15:52:29 +00:00