From a3e9df35aa023bd55c0f87397b53c0eb9cd074c1 Mon Sep 17 00:00:00 2001 From: Tong Mu Date: Wed, 26 Feb 2025 01:59:05 -0800 Subject: [PATCH] [Engine] Remove dead code for RoundedSuperellipse (#164163) Remove dead code that occurred during development and I forgot to remove. ## Pre-launch Checklist - [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [ ] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [ ] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md --- .../geometry/round_superellipse_param.cc | 21 ------------------- .../geometry/round_superellipse_param.h | 6 ------ 2 files changed, 27 deletions(-) diff --git a/engine/src/flutter/impeller/geometry/round_superellipse_param.cc b/engine/src/flutter/impeller/geometry/round_superellipse_param.cc index 26c5e84c26..243040813c 100644 --- a/engine/src/flutter/impeller/geometry/round_superellipse_param.cc +++ b/engine/src/flutter/impeller/geometry/round_superellipse_param.cc @@ -164,8 +164,6 @@ RoundSuperellipseParam::Octant ComputeOctant(Point center, .se_n = n, .se_max_theta = asin(sin_thetaJ), - .ratio = ratio, - .circle_start = pointJ, .circle_center = circle_center, .circle_max_angle = circle_max_angle, @@ -318,23 +316,4 @@ bool RoundSuperellipseParam::Contains(const Point& point) const { CornerContains(bottom_left, point) && CornerContains(top_left, point); } -void RoundSuperellipseParam::SuperellipseBezierArc( - Point* output, - const RoundSuperellipseParam::Octant& param) { - Point start = {param.se_center.x, param.edge_mid.y}; - const Point& end = param.circle_start; - constexpr Point start_tangent = {1, 0}; - Point circle_start_vector = param.circle_start - param.circle_center; - Point end_tangent = - Point{-circle_start_vector.y, circle_start_vector.x}.Normalize(); - - Scalar start_factor = LerpPrecomputedVariable(0, param.ratio); - Scalar end_factor = LerpPrecomputedVariable(1, param.ratio); - - output[0] = start; - output[1] = start + start_tangent * start_factor * param.se_a; - output[2] = end + end_tangent * end_factor * param.se_a; - output[3] = end; -} - } // namespace impeller diff --git a/engine/src/flutter/impeller/geometry/round_superellipse_param.h b/engine/src/flutter/impeller/geometry/round_superellipse_param.h index a4b70b869d..6318255588 100644 --- a/engine/src/flutter/impeller/geometry/round_superellipse_param.h +++ b/engine/src/flutter/impeller/geometry/round_superellipse_param.h @@ -45,8 +45,6 @@ struct RoundSuperellipseParam { // used in the curve's parametric equation. Scalar se_max_theta; - Scalar ratio; - // The coordinate of the top left end of the circular arc, relative to the // `offset` point. Point circle_start; @@ -123,10 +121,6 @@ struct RoundSuperellipseParam { // Experiments indicate that the gap is linear with respect to the corner // radius on that dimension. static constexpr Scalar kGapFactor = 0.29289321881f; // 1-cos(pi/4) - - static void SuperellipseBezierArc( - Point* output, - const RoundSuperellipseParam::Octant& param); }; } // namespace impeller