f51e1fd37d
The gist here is to use saveLayer() to create a buffer to draw each subframe into, but not actually use it to draw anything at restore() time, hence, canvas->clear(0). (SkCanvas sniffs out cleverer approaches like 0 alpha or SkBlendMode::kDst.) Instead, we accessTopLayerPixels() and slurp the subframe out into a 16-bit accumulator, then when all subframes have drawn and accumulated there, one more saveLayer() and accessTopLayerPixels() lets us put them back, shifting back down to 8-bit. The hot parts of the profile are drawing the frames themselves, then the accumulate / repack code in renderToRaster8888Pow2Samples(). $ time out/skottie_tool -i ~/Downloads/mb/data.json -w bar Before: 28.39user 1.14system 0:29.54elapsed After: 22.08user 1.12system 0:23.21elapsed I'm not proud of it. ... ... ... I am a bit! Now using one layer. Change-Id: I241529fad4c5b55c6abc55793f2d9c9693a03c18 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242853 Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org> |
||
---|---|---|
animations | ||
bench | ||
bin | ||
build_overrides | ||
dm | ||
docker | ||
docs/examples | ||
example | ||
experimental | ||
fuzz | ||
gm | ||
gn | ||
include | ||
infra | ||
modules | ||
platform_tools | ||
resources | ||
samplecode | ||
site | ||
specs | ||
src | ||
tests | ||
third_party | ||
tools | ||
.clang-format | ||
.clang-tidy | ||
.gitignore | ||
.gn | ||
AUTHORS | ||
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 |
Skia is a complete 2D graphic library for drawing Text, Geometries, and Images. See full details, and build instructions, at https://skia.org.