From 1946366ee0099c93635cafefe3e9c07125de8085 Mon Sep 17 00:00:00 2001 From: Florin Malita Date: Thu, 24 Sep 2020 20:15:13 +0000 Subject: [PATCH] Revert "[skottie] Reduce CompositionBuilder stack footprint" This reverts commit 3f751f29adf938e41b006b54c6551c880416d6b9. Reason for revert: build errors Original change's description: > [skottie] Reduce CompositionBuilder stack footprint > > LayerBuilder has grown to be pretty chunky. Using inline storage > SkSTArray<64> in stack-allocated CompositionBuilders is excessive > (and unnecessary). > > -fstack-usage before: > AnimationBuilder::attachPrecompLayer() 7536 > > -fstack-usage after: > AnimationBuilder::attachPrecompLayer() 368 > > > Change-Id: Ia905d58e02519d9251620f3eeedbbdc434e3392d > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319342 > Reviewed-by: Mike Klein > Reviewed-by: Ben Wagner > Commit-Queue: Florin Malita > Commit-Queue: Florin Malita TBR=mtklein@google.com,bungeman@google.com,fmalita@chromium.org,fmalita@google.com Change-Id: Ie488318d8da5f568f7869041105e53ceb2bf2ccb No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319401 Reviewed-by: Florin Malita Commit-Queue: Florin Malita --- modules/skottie/src/Composition.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/modules/skottie/src/Composition.h b/modules/skottie/src/Composition.h index a0356fdf31..740997cea6 100644 --- a/modules/skottie/src/Composition.h +++ b/modules/skottie/src/Composition.h @@ -10,11 +10,10 @@ #include "modules/skottie/src/SkottiePriv.h" +#include "include/private/SkTArray.h" #include "include/private/SkTHash.h" #include "modules/skottie/src/Layer.h" -#include - namespace skottie { namespace internal { @@ -32,16 +31,16 @@ private: friend class LayerBuilder; - const SkSize fSize; + const SkSize fSize; - std::vector fLayerBuilders; - SkTHashMap fLayerIndexMap; // Maps layer "ind" to layer builder index. + SkSTArray<64, LayerBuilder> fLayerBuilders; + SkTHashMap fLayerIndexMap; // Maps layer "ind" to layer builder index. - sk_sp fCameraTransform; + sk_sp fCameraTransform; - size_t fMotionBlurSamples = 1; - float fMotionBlurAngle = 0, - fMotionBlurPhase = 0; + size_t fMotionBlurSamples = 1; + float fMotionBlurAngle = 0, + fMotionBlurPhase = 0; }; } // namespace internal