Skip to content

Rect constructors for circle bounds (MakeCircle/EllipseBounds)#185110

Merged
auto-submit[bot] merged 10 commits into
flutter:masterfrom
flar:impeller-rect-center-radius
Apr 18, 2026
Merged

Rect constructors for circle bounds (MakeCircle/EllipseBounds)#185110
auto-submit[bot] merged 10 commits into
flutter:masterfrom
flar:impeller-rect-center-radius

Conversation

@flar

@flar flar commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

There were a number of places in the code that stumbled over creating a Rect for the bounds of a circle or circular region. This PR adds new constructors that take a center and the radii of the circle or ellipse that the Rectangle should cover, simplifying a number of bounds calculations and making them more readable.

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools.
  • 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].

If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@flar flar added the CICD Run CI/CD label Apr 15, 2026
@github-actions github-actions Bot added engine flutter/engine related. See also e: labels. e: impeller Impeller rendering backend issues and features requests and removed CICD Run CI/CD labels Apr 15, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces MakeCenterRadius and MakeCenterRadii helper methods to the TRect class and refactors multiple components to use these new constructors for improved readability. Review feedback highlights a potential compilation error due to missing definitions in the DlRect class and suggests using the template's Type for parameters while handling negative radii to ensure the resulting rectangles are not inverted.

Comment thread engine/src/flutter/display_list/dl_builder.cc Outdated
Comment thread engine/src/flutter/impeller/geometry/rect.h Outdated
Comment thread engine/src/flutter/impeller/geometry/rect.h Outdated
Comment thread engine/src/flutter/impeller/geometry/rect.h Outdated
Comment thread engine/src/flutter/impeller/geometry/rect.h Outdated
@flar flar added the CICD Run CI/CD label Apr 15, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 15, 2026
@flar flar added the CICD Run CI/CD label Apr 15, 2026
Comment thread engine/src/flutter/impeller/display_list/paint.cc
Comment thread engine/src/flutter/impeller/display_list/paint.cc Outdated
@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 16, 2026
@flar flar added the CICD Run CI/CD label Apr 16, 2026
@flar flar requested a review from b-luk April 16, 2026 20:25
Comment thread engine/src/flutter/impeller/display_list/paint.cc
@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 16, 2026
@flar flar requested a review from b-luk April 16, 2026 22:15
@flar flar added the CICD Run CI/CD label Apr 16, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 16, 2026
@flar flar added the CICD Run CI/CD label Apr 16, 2026
b-luk
b-luk previously approved these changes Apr 16, 2026
@flar flar changed the title Rect constructors for circle bounds (MakeRectRadi*) Rect constructors for circle bounds (MakeCircle/EllipseBounds) Apr 17, 2026
@flar flar added CICD Run CI/CD and removed CICD Run CI/CD labels Apr 17, 2026
@fluttergithubbot

Copy link
Copy Markdown
Contributor

An existing Git SHA, 5d928c7e378c6dcd4c9b892adf7898e301957259, was detected, and no actions were taken.

To re-trigger presubmits after closing or re-opeing a PR, or pushing a HEAD commit (i.e. with --force) that already was pushed before, push a blank commit (git commit --allow-empty -m "Trigger Build") or rebase to continue.

@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 17, 2026
@flar flar added the CICD Run CI/CD label Apr 17, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 17, 2026
@flar flar added the CICD Run CI/CD label Apr 17, 2026
@flar flar requested a review from b-luk April 17, 2026 21:21
@flar flar added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 18, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Apr 18, 2026
Merged via the queue into flutter:master with commit 887a049 Apr 18, 2026
199 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Apr 18, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 18, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 18, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 19, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 19, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Apr 20, 2026
flutter/flutter@8e8a194...2844af6

2026-04-19 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from bWoigpGIb60B6C7hD... to aDbXQm6WA0wFCAUp-... (flutter/flutter#185253)
2026-04-18 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from di3JdYrdE9OFu8Iyl... to bWoigpGIb60B6C7hD... (flutter/flutter#185231)
2026-04-18 rmolivares@renzo-olivares.dev Fix: text selection context menu should reappear after a non-fling scroll on Android and iOS (flutter/flutter#185054)
2026-04-18 flar@google.com Rect constructors for circle bounds (MakeCircle/EllipseBounds) (flutter/flutter#185110)
2026-04-17 97480502+b-luk@users.noreply.github.com Change uber SDF to get pixel size (for AA) using euclidean distance rather than manhattan distance. (flutter/flutter#184984)
2026-04-17 engine-flutter-autoroll@skia.org Roll Dart SDK from 7c2564c18770 to 9648f446f131 (7 revisions) (flutter/flutter#185223)
2026-04-17 47866232+chunhtai@users.noreply.github.com Rewrites no-response workflow to work with pr as well (flutter/flutter#185163)
2026-04-17 15619084+vashworth@users.noreply.github.com Only use LLDB breakpoint in debug mode (flutter/flutter#185158)
2026-04-17 flar@google.com add playground to test SDF primitive rendering under transforms (flutter/flutter#185010)
2026-04-17 30870216+gaaclarke@users.noreply.github.com Adds sdf rrects (and fixes opacity + color source) (flutter/flutter#184999)
2026-04-17 matt.kosarek@canonical.com Implementation of popup windows for Win32 (flutter/flutter#184516)
2026-04-17 engine-flutter-autoroll@skia.org Roll Fuchsia Test Scripts from R2EllDf4DgBXVNuiN... to dQ4PjIJB5kZFU8Y32... (flutter/flutter#185207)
2026-04-17 chris@bracken.jp [iOS] Update previousCompositionOrder to return Obj-C type (flutter/flutter#185136)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC boetger@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
…r#11531)

flutter/flutter@8e8a194...2844af6

2026-04-19 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from bWoigpGIb60B6C7hD... to aDbXQm6WA0wFCAUp-... (flutter/flutter#185253)
2026-04-18 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from di3JdYrdE9OFu8Iyl... to bWoigpGIb60B6C7hD... (flutter/flutter#185231)
2026-04-18 rmolivares@renzo-olivares.dev Fix: text selection context menu should reappear after a non-fling scroll on Android and iOS (flutter/flutter#185054)
2026-04-18 flar@google.com Rect constructors for circle bounds (MakeCircle/EllipseBounds) (flutter/flutter#185110)
2026-04-17 97480502+b-luk@users.noreply.github.com Change uber SDF to get pixel size (for AA) using euclidean distance rather than manhattan distance. (flutter/flutter#184984)
2026-04-17 engine-flutter-autoroll@skia.org Roll Dart SDK from 7c2564c18770 to 9648f446f131 (7 revisions) (flutter/flutter#185223)
2026-04-17 47866232+chunhtai@users.noreply.github.com Rewrites no-response workflow to work with pr as well (flutter/flutter#185163)
2026-04-17 15619084+vashworth@users.noreply.github.com Only use LLDB breakpoint in debug mode (flutter/flutter#185158)
2026-04-17 flar@google.com add playground to test SDF primitive rendering under transforms (flutter/flutter#185010)
2026-04-17 30870216+gaaclarke@users.noreply.github.com Adds sdf rrects (and fixes opacity + color source) (flutter/flutter#184999)
2026-04-17 matt.kosarek@canonical.com Implementation of popup windows for Win32 (flutter/flutter#184516)
2026-04-17 engine-flutter-autoroll@skia.org Roll Fuchsia Test Scripts from R2EllDf4DgBXVNuiN... to dQ4PjIJB5kZFU8Y32... (flutter/flutter#185207)
2026-04-17 chris@bracken.jp [iOS] Update previousCompositionOrder to return Obj-C type (flutter/flutter#185136)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC boetger@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD e: impeller Impeller rendering backend issues and features requests engine flutter/engine related. See also e: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants