[skottie] Improved pucker/bloat center heuristic

AE appears to use the center of the shape bounding box.

TBR=
Change-Id: I965175dcc28cc9a8903b959a42b108d72767ef28
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302639
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
diff --git a/modules/skottie/src/layers/shapelayer/PuckerBloat.cpp b/modules/skottie/src/layers/shapelayer/PuckerBloat.cpp
index de77095..3691a03 100644
--- a/modules/skottie/src/layers/shapelayer/PuckerBloat.cpp
+++ b/modules/skottie/src/layers/shapelayer/PuckerBloat.cpp
@@ -49,24 +49,15 @@
             return input;
         }
 
+        const auto input_bounds = input.computeTightBounds();
+        const SkPoint center{input_bounds.centerX(), input_bounds.centerY()};
+
         SkPath path;
 
         SkPoint contour_start = {0, 0};
         std::vector<CubicInfo> cubics;
 
         auto commit_contour = [&]() {
-            if (cubics.empty()) {
-                return;
-            }
-
-            // first pass: determine the "center"
-            SkVector center {0,0};
-            for (const auto& c : cubics) {
-                center += c.pt;
-            }
-            center *= 1.f / cubics.size();
-
-            // second pass: adjust points and emit the results
             path.moveTo(lerp(contour_start, center, fAmount));
             for (const auto& c : cubics) {
                 path.cubicTo(lerp(c.ctrl0, center, -fAmount),