Go to file
Leon Scroggins 1340dbde91 Reland "SkAndroidCodec: Support decoding all frames"
This is a reland of fc4fdc5b25

Original change's description:
> SkAndroidCodec: Support decoding all frames
>
> Bug: b/160984428
> Bug: b/163595585
>
> Add support to SkAndroidCodec for decoding all frames with an
> fSampleSize, so that an entire animation can be decoded to a smaller
> size.
>
> dm/:
> - Test scaled + animated decodes
>
> SkAndroidCodec:
> - Make AndroidOptions inherit from SkCodec::Options. This allows
>   SkAndroidCodec to use fFrameIndex. (It also combines the two versions
>   of fSubset, which is now const for both.)
> - Respect fFrameIndex, and call SkCodec::handleFrameIndex to decode
>   the required frame.
> - Disallow decoding with kRespect + fFrameIndex > 0 if there is a
>   non-default orientation. As currently written (except without
>   disabling this combination), SkPixmapPriv::Orient would draw the new
>   portion of the frame on top of uninitialized pixels, instead of the
>   prior frame. This could be fixed by
>   - If SkAndroidCodec needs to decode the required frame, it could do so
>     without applying the orientation, then decode fFrameIndex, and then
>     apply the orientation.
>   - If the client provided the required frame, SkAndroidCodec would need
>     to un-apply the orientation to get the proper starting state, then
>     decode and apply.
>   I think it is simpler to force the client to handle the orientation
>   externally.
>
> SkCodec:
> - Allow SkAndroidCodec to call its private method handleFrameIndex. This
>   method handles decoding a required frame, if necessary. When called by
>   SkAndroidCodec, it now uses the SkAndroidCodec to check for/decode the
>   required frame, so that it will scale properly.
> - Call rewindIfNeeded inside handleFrameIndex. handleFrameIndex calls a
>   virtual method which may set some state (e.g. in SkJpegCodec). Without
>   this change, that state would be reset by rewindIfNeeded.
> - Simplify handling a kRestoreBGColor frame. Whether provided or not,
>   take the same path to calling zero_rect.
> - Updates to zero_rect:
>   - Intersect after scaling, which will also check for empty.
>   - Round out instead of in - this ensures we don't under-erase
>   - Use kFill_ScaleToFit, which better matches the intent.
>
> Change-Id: Ibe1951980a0dca8f5b7b1f20192432d395681683
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333225
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>

Bug: b/160984428
Bug: b/163595585
Change-Id: I7c1e79e0f92c75b4840eef65c8fc2b8497189e81
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334842
Auto-Submit: Leon Scroggins <scroggo@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2020-11-16 16:55:48 +00:00
animations first cut at a checkbox 2009-10-21 19:41:10 +00:00
bazel bazel baby steps 2020-09-14 15:18:32 +00:00
bench Reland "add ERMS (enhanced rep mov/sto) SkOpts slice" 2020-11-12 18:00:39 +00:00
bin bin/try: automatically set 'git cl issue' when not found 2020-06-25 17:44:01 +00:00
build/fuchsia [fuchsia] Fix fidlc command. 2020-06-10 03:29:24 +00:00
build_overrides Port to ANGLE's GN files 2020-09-11 15:22:34 +00:00
client_utils/android Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'. 2020-09-03 03:41:26 +00:00
demos.skia.org [canvaskit] Remove Sk from nearly all function/type names. 2020-10-07 21:01:32 +00:00
dm Reland "SkAndroidCodec: Support decoding all frames" 2020-11-16 16:55:48 +00:00
docker [canvaskit,pathkit] Update to emsdk 2.0 2020-08-20 14:55:50 +00:00
docs/examples Only expose isConvex on path publicly. 2020-08-28 16:56:29 +00:00
example Reland "Remove use of legacy display globals." 2020-10-05 19:13:58 +00:00
experimental Deprecate some debugger bindings in favor of ones that better serve the lit html debugger 2020-11-12 23:01:56 +00:00
fuzz Move GrShaderCaps from Program::Settings to Compiler 2020-11-04 19:38:33 +00:00
gm Allow gpu_blur_utils* GMs to run with *ooprddl configs 2020-11-16 16:15:36 +00:00
gn Convert remaining Metal tests to golden outputs. 2020-11-16 16:32:56 +00:00
include Reland "SkAndroidCodec: Support decoding all frames" 2020-11-16 16:55:48 +00:00
infra [infra] Mac VMs running NativeFonts tasks were updated 2020-11-16 16:36:47 +00:00
modules [skottie] Initial direction for text shaping 2020-11-13 20:57:03 +00:00
platform_tools Skottie perf metric improvements 2020-11-13 19:03:15 +00:00
resources Handle EXIF orientation in SkAnimCodecPlayer 2020-11-12 14:43:47 +00:00
samplecode [svg] Allow clients to pass a custom SkFontMgr 2020-11-11 01:51:44 +00:00
site add M88 release notes 2020-11-13 07:47:01 +00:00
specs Fix CanvasKit generated documentation to work with emscripten 1.39.16. 2020-05-27 12:23:32 +00:00
src Reland "SkAndroidCodec: Support decoding all frames" 2020-11-16 16:55:48 +00:00
tests Reland "SkAndroidCodec: Support decoding all frames" 2020-11-16 16:55:48 +00:00
third_party [canvaskit] Add support for woff2 fonts 2020-11-10 15:07:26 +00:00
tools Add activation events to sk_app. 2020-11-16 16:44:08 +00:00
.bazelignore bazel baby steps 2020-09-14 15:18:32 +00:00
.clang-format Disable BinPackParameters in .clang-format 2020-03-27 14:32:40 +00:00
.clang-tidy Disable ClangTidy namespace comments for short blocks. 2020-08-24 14:01:22 +00:00
.gitignore bazel baby steps 2020-09-14 15:18:32 +00:00
.gn Basic standalone GN configs. 2016-07-21 12:25:45 -07:00
AUTHORS Fix issues with latest GN 2020-11-07 13:55:45 +00:00
BUILD.bazel bazel baby steps 2020-09-14 15:18:32 +00:00
BUILD.gn Reland "SkAndroidCodec: Support decoding all frames" 2020-11-16 16:55:48 +00:00
codereview.settings Make uploading to Gerrit the default for Skia 2016-11-09 19:07:56 +00:00
CONTRIBUTING Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
CQ_COMMITTERS Moved committer list to chrome-infra-auth and deleted it from the repo 2015-09-02 13:37:54 -07:00
DEPS Reland "SkAndroidCodec: Support decoding all frames" 2020-11-16 16:55:48 +00:00
go.mod Update Go Deps 2020-11-02 12:13:02 +00:00
go.sum Update Go Deps 2020-11-02 12:13:02 +00:00
LICENSE LICENSE file: clean up 2019-11-22 21:59:03 +00:00
OWNERS add OWNERS file 2017-12-01 19:50:19 +00:00
PRESUBMIT.py Generate SkSL golden output files from test inputs during the build. 2020-09-14 14:54:12 +00:00
public.bzl Reland "SkAndroidCodec: Support decoding all frames" 2020-11-16 16:55:48 +00:00
README Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
README.chromium Update README.chromium. 2015-06-11 13:19:24 -07:00
RELEASE_NOTES.txt Remove SkBaseDevice::flush 2020-11-16 15:26:06 +00:00
whitespace.txt Whitespace change to re-trigger Mac/iOS tests 2020-02-23 20:55:01 +00:00
WORKSPACE.bazel bazel baby steps 2020-09-14 15:18:32 +00:00

Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.

See full details, and build instructions, at https://skia.org.