Skip to content

[web] Preserve fill rules from path operations - #195971

Merged
auto-submit[bot] merged 9 commits into
flutter:masterfrom
jamesblasco:fix/canvaskit-path-combine-fill-rule
Nov 24, 2026
Merged

auto-submit[bot] merged 9 commits into
flutter:masterfrom
jamesblasco:fix/canvaskit-path-combine-fill-rule

Conversation

@jamesblasco

@jamesblasco jamesblasco commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #195968.

Preserve the fill rule produced by path operations so subtracting nested rectangles keeps the center empty. CanvasKit currently replaces the operation result's fill type with the first operand's. The lazy EnginePath layer overwrites it again, and the Skwasm C++ bridge has the same overwrite.

This change preserves the CanvasKit and Skwasm operation results and lets combined EnginePaths adopt the backend fill rule lazily. Explicit fillType assignments continue to take precedence.

Adds 12 geometry regression cases covering difference, reverse difference, and XOR with both operand fill types, plus lifecycle tests for copying, collection, and explicit fill-type overrides.

Validation:

  • The new tests reproduce six geometry failures per CanvasKit variant and a lifecycle failure against the unmodified Dart sources.
  • With the fix, all 47 test/ui/path_test.dart tests pass in Chrome with both full and Chromium CanvasKit variants; all 3 test/engine/engine_path_test.dart tests pass. Tests use Dart sources from this checkout and engine binaries published for the base main revision.
  • Dart analysis with --fatal-infos, Dart formatting, and git diff --check pass.
  • Skwasm tests compile. Running against the unmodified main Skwasm binaries reproduces the same six geometry failures. The C++ fix has not been rebuilt locally and needs CI validation.

Prepared with AI assistance; kept in draft for contributor review under the AI contribution guidelines.

Pre-launch Checklist

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.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

This pull request targets the main branch, but the primary branch for this repository is master.

Please change the base branch of this pull request to master.

See: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-base-branch-of-a-pull-request

@github-actions github-actions Bot added engine flutter/engine related. See also e: labels. platform-web Web applications specifically team-web Owned by Web platform team labels Nov 4, 2026
@jamesblasco
jamesblasco changed the base branch from main to master November 4, 2026 12:23
@jamesblasco
jamesblasco marked this pull request as ready for review November 4, 2026 15:54

@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 updates the Flutter Web engine to ensure that combined paths dynamically inherit the fill rule resulting from the backend path operation instead of inheriting the fill type of the first operand, unless an explicit fill type is set. New tests have been added to verify this behavior across copies, collections, and various nested path operations. There are no review comments, and I have no additional feedback to provide.

@flutter-zl
flutter-zl requested a review from mdebbar November 4, 2026 19:15

@mdebbar mdebbar 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.

Thanks for contributing this fix!

I also confirmed that #124675 and #149743 are fixed by this PR. So I'll mark them as duplicates.

file.mp4
file2.mp4

@mdebbar mdebbar added the CICD Run CI/CD label Nov 6, 2026
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Nov 10, 2026
@mdebbar mdebbar added the CICD Run CI/CD label Nov 10, 2026
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Nov 10, 2026
mdebbar
mdebbar previously approved these changes Nov 10, 2026
@mdebbar mdebbar added the CICD Run CI/CD label Nov 10, 2026
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Nov 12, 2026
@harryterkelsen harryterkelsen added the CICD Run CI/CD label Nov 12, 2026
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Nov 12, 2026
@auto-submit

auto-submit Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

auto label is removed for flutter/flutter/195971, Failed to enqueue flutter/flutter/195971 with HTTP 400: Pull request Required status check "Check Code Freeze" is expected..

@harryterkelsen harryterkelsen added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 14, 2026
@auto-submit

auto-submit Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

auto label is removed for flutter/flutter/195971, Failed to enqueue flutter/flutter/195971 with HTTP 400: Pull request Required status check "Check Code Freeze" is expected..

@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 14, 2026
@harryterkelsen harryterkelsen added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 14, 2026
@auto-submit

auto-submit Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

auto label is removed for flutter/flutter/195971, Failed to enqueue flutter/flutter/195971 with HTTP 400: Pull request Required status check "Check Code Freeze" is expected..

@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 14, 2026
@harryterkelsen harryterkelsen added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 14, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 14, 2026
@auto-submit

auto-submit Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

auto label is removed for flutter/flutter/195971, Failed to enqueue flutter/flutter/195971 with HTTP 400: Pull request Required status check "Check Code Freeze" is expected..

@harryterkelsen harryterkelsen added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 14, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 14, 2026
@auto-submit

auto-submit Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

auto label is removed for flutter/flutter/195971, Failed to enqueue flutter/flutter/195971 with HTTP 400: Pull request Required status check "Check Code Freeze" is expected..

@harryterkelsen harryterkelsen added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 14, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 14, 2026
@auto-submit

auto-submit Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

auto label is removed for flutter/flutter/195971, Failed to enqueue flutter/flutter/195971 with HTTP 400: Pull request Required status check "Check Code Freeze" is expected..

@harryterkelsen harryterkelsen added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 14, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 14, 2026
@auto-submit

auto-submit Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

auto label is removed for flutter/flutter/195971, Failed to enqueue flutter/flutter/195971 with HTTP 400: Pull request Required status check "Check Code Freeze" is expected..

@harryterkelsen harryterkelsen added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 14, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 14, 2026
@auto-submit

auto-submit Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

auto label is removed for flutter/flutter/195971, Failed to enqueue flutter/flutter/195971 with HTTP 400: Pull request Required status check "Check Code Freeze" is expected..

@harryterkelsen harryterkelsen added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 14, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 14, 2026
@auto-submit

auto-submit Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

auto label is removed for flutter/flutter/195971, Failed to enqueue flutter/flutter/195971 with HTTP 400: Pull request Required status check "Check Code Freeze" is expected..

@auto-submit

auto-submit Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/195971, because - The status or check suite Presubmit has failed. Please fix the issues identified (or deflake) before re-applying this label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD engine flutter/engine related. See also e: labels. platform-web Web applications specifically team-web Owned by Web platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[web] CanvasKit Path.combine(difference) replaces result fill rule and fills the hole

3 participants