Skip to content

Conversation

@tdenniston
Copy link

@tdenniston tdenniston commented Nov 17, 2025

Skia does not have a consistent policy for handling "inverted" shapes (rects, rrects, ovals): some Skia APIs check or flip the bounds, some do not. In general, Skia treats inverted shapes as undefined behavior and doesn't want to commit to an explicit contract for handling them. Further, this undefined behavior is actually soon going to change (to different undefined behavior; parent bug is skbug.com/454646294).

One instance where reliance on this undefined Skia behavior impacts flutter is mentioned in flutter/engine#42556. This PR applies the same fix to drawPath(), removing its dependence on undefined Skia behavior.

Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.

List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

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.

@github-actions github-actions bot added the engine flutter/engine related. See also e: labels. label Nov 17, 2025
Skia does not have a consistent policy for handling "inverted" shapes
(rects, rrects, ovals): some Skia APIs check or flip the bounds, some do
not. In general, Skia treats inverted shapes as undefined behavior and
doesn't want to commit to an explicit contract for handling them.
Further, this undefined behavior is actually soon going to change (to
different undefined behavior; parent bug is skbug.com/454646294).

One instance where reliance on this undefined Skia behavior impacts
flutter is mentioned in flutter/engine#42556.
This PR applies the same fix to drawPath(), removing its dependence on
undefined Skia behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine flutter/engine related. See also e: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant