d5c42c8c03
Currently, property animators use lambda captures (std::function<>) to push values to adapters and then to the scene graph. Some downsides: * complex lambda captures are expensive in terms of object code size * adapters with multiple animated properties don't synchronize/quiesce: each individual property tick triggers a SG synchronization, possibly with inconsistent state (as animator running order is unspecified) * there is no enforced scoping, resulting in fragile constructs when SG fragments are discarded This CL introduces a simplified and more robust animator pattern: * property animators are scoped to explicit containers * instead of capturing arbitrary value functors, animators only capture a pointer to the target value Some implementation details: * keyframe/interpolation logic is pretty much unchanged (just relocated) * introduced AnimatablePropertyContainer - a base class for animatable adapters * legacy binding functions are refactored based on the new mechanism (they now/transitionally inject adapter objects) * converted a handful of effects, to exercise trivial refactoring patterns * converted the text animator goo, to exercise non-trivial refactoring: - detecting value changes is now trickier (no more lambda magic) - value adjustments must be hoisted into adapter logic (no more lambda magic) - all dependent animated values (selectors, etc) must be scoped to the text adapter to avoid lifetime issues TBR= Change-Id: Ia5821982f251de0de58fd3f87812219ff7fcc726 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263938 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Reed <reed@google.com> |
||
---|---|---|
animations | ||
bench | ||
bin | ||
build/fuchsia | ||
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.