skia2/modules/skottie/skottie.gni

81 lines
2.5 KiB
Plaintext
Raw Normal View History

# Copyright 2018 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Things are easiest for everyone if these source paths are absolute.
_src = get_path_info("src", "abspath")
_include = get_path_info("include", "abspath")
skia_skottie_public = [
"$_include/Skottie.h",
"$_include/SkottieProperty.h",
]
skia_skottie_sources = [
"$_src/Adapter.h",
[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 21:46:04 +00:00
"$_src/Animator.cpp",
"$_src/Animator.h",
"$_src/Camera.cpp",
"$_src/Camera.h",
"$_src/Composition.cpp",
[skottie] 3D layer parenting refinements Observed AE layer parenting semantics: * layers are flagged as either 2D or 3D * camera applies to 3D layers, but not to 2D layers * parented 3D layers treat their ancestor transform chain as 3D (SkMatrix44) * parented 2D layers treat their ancestor transform chain as 2D (SkMatrix, ignoring 3D components) This means that for a given layer, we may need to build two distinct transform chains - depending on the type of descendant layer being considered. Furthermore, transforms are animatable and their animators are scoped to a layer controller. Since we're potentially building two version of the transform node, we need to ensure all animators for both of them are transferred to controller object (we still want to only instantiate a single layer controller and render tree to avoid duplication). IOW, all dependent layer transforms need to be considered before "sealing off" a given layer controller. In order to avoid a layer dependency/topological sort, we can split off the transform tree construction into a separate pass. High-level changes: -- replace existing LayerAttachContext with CompositionBuilder (holds LayerBuilders and other Composition-wide state) -- replace LayerRec with LayerBuilder (holds Layer-wide state and also caches transform nodes) -- pass 1: for each LayerBuilder, transitively build and cache a transform chain of a type (2d/3d) determined by the leaf (entry point) layer -- pass 2: for each LayerBuilder, build the actual layer content render tree and instantiate the layer controller objects Bug: skia:8914 Change-Id: I9f7efcf4819424282fd3dda98f5621ba12fd001b Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251001 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-10-28 17:57:12 +00:00
"$_src/Composition.h",
"$_src/Layer.cpp",
[skottie] 3D layer parenting refinements Observed AE layer parenting semantics: * layers are flagged as either 2D or 3D * camera applies to 3D layers, but not to 2D layers * parented 3D layers treat their ancestor transform chain as 3D (SkMatrix44) * parented 2D layers treat their ancestor transform chain as 2D (SkMatrix, ignoring 3D components) This means that for a given layer, we may need to build two distinct transform chains - depending on the type of descendant layer being considered. Furthermore, transforms are animatable and their animators are scoped to a layer controller. Since we're potentially building two version of the transform node, we need to ensure all animators for both of them are transferred to controller object (we still want to only instantiate a single layer controller and render tree to avoid duplication). IOW, all dependent layer transforms need to be considered before "sealing off" a given layer controller. In order to avoid a layer dependency/topological sort, we can split off the transform tree construction into a separate pass. High-level changes: -- replace existing LayerAttachContext with CompositionBuilder (holds LayerBuilders and other Composition-wide state) -- replace LayerRec with LayerBuilder (holds Layer-wide state and also caches transform nodes) -- pass 1: for each LayerBuilder, transitively build and cache a transform chain of a type (2d/3d) determined by the leaf (entry point) layer -- pass 2: for each LayerBuilder, build the actual layer content render tree and instantiate the layer controller objects Bug: skia:8914 Change-Id: I9f7efcf4819424282fd3dda98f5621ba12fd001b Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251001 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-10-28 17:57:12 +00:00
"$_src/Layer.h",
"$_src/Path.cpp",
"$_src/Skottie.cpp",
"$_src/SkottieJson.cpp",
"$_src/SkottieJson.h",
"$_src/SkottiePriv.h",
"$_src/SkottieProperty.cpp",
"$_src/SkottieValue.cpp",
"$_src/SkottieValue.h",
"$_src/Transform.cpp",
"$_src/Transform.h",
"$_src/effects/DropShadowEffect.cpp",
"$_src/effects/Effects.cpp",
"$_src/effects/Effects.h",
"$_src/effects/FillEffect.cpp",
"$_src/effects/GaussianBlurEffect.cpp",
"$_src/effects/GradientEffect.cpp",
"$_src/effects/HueSaturationEffect.cpp",
"$_src/effects/InvertEffect.cpp",
"$_src/effects/LevelsEffect.cpp",
"$_src/effects/LinearWipeEffect.cpp",
"$_src/effects/MotionBlurEffect.cpp",
"$_src/effects/MotionBlurEffect.h",
"$_src/effects/MotionTileEffect.cpp",
"$_src/effects/RadialWipeEffect.cpp",
"$_src/effects/ShiftChannelsEffect.cpp",
"$_src/effects/TintEffect.cpp",
"$_src/effects/TransformEffect.cpp",
"$_src/effects/TritoneEffect.cpp",
"$_src/effects/VenetianBlindsEffect.cpp",
"$_src/layers/ImageLayer.cpp",
"$_src/layers/NullLayer.cpp",
"$_src/layers/PrecompLayer.cpp",
"$_src/layers/SolidLayer.cpp",
"$_src/layers/TextLayer.cpp",
"$_src/layers/shapelayer/Ellipse.cpp",
"$_src/layers/shapelayer/FillStroke.cpp",
"$_src/layers/shapelayer/Gradient.cpp",
"$_src/layers/shapelayer/MergePaths.cpp",
"$_src/layers/shapelayer/Polystar.cpp",
"$_src/layers/shapelayer/Rectangle.cpp",
"$_src/layers/shapelayer/Repeater.cpp",
"$_src/layers/shapelayer/RoundCorners.cpp",
"$_src/layers/shapelayer/ShapeLayer.cpp",
"$_src/layers/shapelayer/ShapeLayer.h",
"$_src/layers/shapelayer/TrimPaths.cpp",
"$_src/text/RangeSelector.cpp",
"$_src/text/RangeSelector.h",
"$_src/text/SkottieShaper.cpp",
"$_src/text/SkottieShaper.h",
"$_src/text/TextAdapter.cpp",
"$_src/text/TextAdapter.h",
"$_src/text/TextAnimator.cpp",
"$_src/text/TextAnimator.h",
"$_src/text/TextValue.cpp",
"$_src/text/TextValue.h",
]