7d1153fc4c
Bug: skia:10914 Bug: b/163595585 In a WebP image, it is possible to combine animation with an EXIF orientation. While SkAndroidCodec attempts to handle orientation itself by decoding into temporary memory and then drawing through a matrix, this doesn't work directly when compositing a P-frame into a prior frame. SkAnimatedImage already uses an SkMatrix to handle cropping and scaling, so update that matrix to include the orientation. Make SkAnimatedImage a friend of SkAndroidCodec. This allows the former to have the same ExifOrientationBehavior specified by the latter, and to recreate the latter so it does not try to handle the orientation itself. Clip SkAnimatedImage to its bounds. Android's AnimatedImageDrawable performs its own clip, but this makes a crop rect work for other clients. Update getCurrentFrame to take cropping, scaling, and orientation into account. This method is used by CanvasKit, which does not use cropping or scaling, but will now properly orient an animation with an EXIF orientation. Add a GM that exercises the various combinations of ways SkAnimatedImage can be used: - via newPictureSnapshot (as in Android) versus getCurrentFrame - scaling down to a dimension that can be output from the SkAndroidCodec, versus up, which SkAnimatedImage scales - with a crop rect - with a post processor Change-Id: If1854e9aea23fc4afddf75d39132b38e3fbc6071 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333223 Commit-Queue: Leon Scroggins <scroggo@google.com> Reviewed-by: Derek Sollenberger <djsollen@google.com> |
||
---|---|---|
animations | ||
bazel | ||
bench | ||
bin | ||
build/fuchsia | ||
build_overrides | ||
client_utils/android | ||
demos.skia.org | ||
dm | ||
docker | ||
docs/examples | ||
example | ||
experimental | ||
fuzz | ||
gm | ||
gn | ||
include | ||
infra | ||
modules | ||
platform_tools | ||
resources | ||
samplecode | ||
site | ||
specs | ||
src | ||
tests | ||
third_party | ||
tools | ||
.bazelignore | ||
.clang-format | ||
.clang-tidy | ||
.gitignore | ||
.gn | ||
AUTHORS | ||
BUILD.bazel | ||
BUILD.gn | ||
codereview.settings | ||
CONTRIBUTING | ||
CQ_COMMITTERS | ||
DEPS | ||
go.mod | ||
go.sum | ||
LICENSE | ||
OWNERS | ||
PRESUBMIT.py | ||
public.bzl | ||
README | ||
README.chromium | ||
RELEASE_NOTES.txt | ||
whitespace.txt | ||
WORKSPACE.bazel |
Skia is a complete 2D graphic library for drawing Text, Geometries, and Images. See full details, and build instructions, at https://skia.org.