SkJpegMetadataDecoderImpl: Clean up Apple gainmap rendering

Change SkJpegMetadataDecoderImpl::findGainmapImage to parse the Exif
metadata of the base image in search of the Apple MakerNote that
indicates the HDR headroom to be used for rendering the image. Only
accept gainmap images if the Apple MakerNote was present in the base
image Exif.

There exists a class of Apple gainmap images that have a rotation
baked into the base image but not the gainmap image (and therefore
have the gainmap oriented incorrectly). These images appear not to have
the Apple MakerNote Exif data. This will happen to fix the bug where
these would be rendered with an inappropriately rotated gainmap (by
not checking for the gainmap).

Resurrect the deprecated SkGainmapInfo::Type enum, and use it to
indicate if an image has an Apple gainmap. Add a new path in
SkGainmapShader to support transcoding Apple gainmaps to Adobe
gainmaps on the fly.

Add tests for extracting the Apple MakerNote HDR headroom parameter.
Add tests for newer iPhone images.
Add tests for the new shader path.

Bug: b/338342146
Bug: b/338299886
Change-Id: Ifbdcd4adabd470a30ddbf7cd740d75e97174bf6f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/849738
Commit-Queue: Christopher Cameron <ccameron@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: ccameron chromium <ccameron@chromium.org>
Reviewed-by: Christopher Cameron <ccameron@google.com>
9 files changed