Skip to content

[Impeller] SDF convex path prototype - #183961

Closed
flar wants to merge 3 commits into
flutter:masterfrom
flar:impeller-sdf-convex-path-prototype
Closed

flar wants to merge 3 commits into
flutter:masterfrom
flar:impeller-sdf-convex-path-prototype

Conversation

@flar

@flar flar commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Prototypes a solution for #183960

Work in Impeller is ongoing to develop SDF shaders for various primitives such as Circle, RoundRect, etc. These specific solutions will not work for arbitrary paths. This PR is a prototype for using the existing ShaderGeometry code to produce geometry meshes hinted with SDF parameters to render antialiased versions of convex paths.

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].

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 engine flutter/engine related. See also e: labels. e: impeller Impeller rendering backend issues and features requests labels Mar 20, 2026
@flar

flar commented Mar 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Note that there are a very large number of diffs for shadow_path_geometry.cc - the algorithm was not changed (one minor tweak in one place where I fat-fingered a condition from the original Skia source), it's all name changes to acknowledge that it is no longer only used for shadows.

I probably shouldn't have bothered until I had the prototype up and running, but it felt odd requesting data for a "shadow" that wasn't a shadow. If this prototype lands, the entire PolygonInfo class should be moved and renamed to something less shadow-specific. (Indeed these classes are in the Skia code as "Poly utils" and only refer to insets and outsets.)

@Piinks

Piinks commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Greetings from stale PR triage! 👋
Is this change still on your radar?

@flar

flar commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Greetings from stale PR triage! 👋 Is this change still on your radar?

@walley892 is currently working on SDF paths, I'll donate this PR to their effort...

@Piinks

Piinks commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Welcome back to stale triage! How is this going? :)

@flar

flar commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

One of many solutions being pursued for #185117, this PR can be reopened if the others don't pan out.

@flar flar closed this Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants