skia2/modules/sksg/include
Florin Malita d5c42c8c03 [skottie] Refactor property animators
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>
2020-01-16 22:43:12 +00:00
..
SkSGClipEffect.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
SkSGColorFilter.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
SkSGDraw.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
SkSGEffectNode.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
SkSGGeometryNode.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
SkSGGeometryTransform.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
SkSGGradient.h [skottie] Use SkColor4f for gradient color stops 2019-11-05 18:26:22 +00:00
SkSGGroup.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
SkSGImage.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
SkSGInvalidationController.h [skottie] Expose SG inval controller on seek() 2019-07-22 16:33:15 +00:00
SkSGMaskEffect.h [skottie] Luma matte support 2019-10-16 13:17:51 +00:00
SkSGMerge.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
SkSGNode.h [skottie] Caching motion tile 2019-07-10 19:13:41 +00:00
SkSGOpacityEffect.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
SkSGPaint.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
SkSGPath.h remove dead code around old SkPath enums 2019-12-14 01:58:10 +00:00
SkSGPlane.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
SkSGRect.h Revert "Reland "Revert "Use flat version of path-direction enum""" 2019-11-22 19:09:54 +00:00
SkSGRenderEffect.h Update skottie/sksg to use new filter factories 2019-08-02 14:51:42 +00:00
SkSGRenderNode.h [skottie] Harden motion blur 2019-08-27 00:21:12 +00:00
SkSGRoundEffect.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
SkSGScene.h [skottie] Refactor property animators 2020-01-16 22:43:12 +00:00
SkSGText.h Use SkFontHinting instead of macros. 2019-05-08 12:16:37 +00:00
SkSGTransform.h Make converting from 4x4 to 3x3 explicit 2020-01-16 22:15:30 +00:00
SkSGTrimEffect.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00