Skip to content

fix(skia): Outset damage clip to cover AA fringe at fractional scales - #24031

Merged
ramezgerges merged 2 commits into
unoplatform:masterfrom
ramezgerges:dev/rara/damage-clip-outset
Aug 11, 2026
Merged

ramezgerges merged 2 commits into
unoplatform:masterfrom
ramezgerges:dev/rara/damage-clip-outset

Conversation

@ramezgerges

Copy link
Copy Markdown
Contributor

GitHub Issue: closes unoplatform/kahua-private#534

PR Type:

🐞 Bugfix

What changed? 🚀

Current behavior: at fractional rasterization scales (e.g. 150% display scale) on GPU-backed Skia hosts, a translate-animated element inside a Popup — with an ancestor clip cutting its damage region and static content drawn above it — leaves stale ≤1px stripe artifacts across the vacated area (see the linked issue: TabBar Slide selection indicator).

Root cause: the per-present damage clip in CompositionTarget.Draw is intentionally non-antialiased (so boundary pixels aren't blended against the retained surface), which means it includes only device pixels whose centers lie inside the damage region. Rendering, however, is antialiased and also writes fringe pixels whose centers lie outside the drawn geometry. The record side already outsets content edges by 2px (OutsetForAntialiasing), but wherever TryGetPaintDamageRegion intersects the damage region with an ancestor clip, the damage edge coincides exactly with an AA-rendered clip edge — zero margin. At integer scales those edges are device-pixel-aligned so no fringe exists (the "regions are pixel-snapped" premise of the original non-AA choice); at fractional scales they land between device pixels, and the written AA fringe is permanently excluded from every replay, accumulating as stripes.

This PR: outsets the present-time damage clip by exactly one device pixel (stroke-and-union, OutsetDamageForPresent). The clip stays non-antialiased, preserving the original rationale; the replayed picture is always the full frame, so over-covering is correct by construction.

Validation: runtime A/B on a 150%-scale machine with a real GPU (Win32 GlRenderer): stripes reproduce with the raw clip and disappear with the outset applied, in the same binary with the outset toggled.

PR Checklist ✅

  • 🧪 Added Runtime tests, UI tests, or a manual test sample (for bug fixes / features, if applicable) — not applicable: the repro requires a real GPU at fractional display scale, which CI test environments don't provide; validated manually as described above (existing DirtyRectangles_* manual samples cover the damage-region pipeline)
  • 📚 Docs have been added/updated following the documentation template (for bug fixes / features) — not applicable, internal rendering fix
  • 🖼️ Validated PR Screenshots Compare Test Run results.
  • ❗ Contains NO breaking changes

🤖 Generated with Claude Code

The per-present damage clip is intentionally non-antialiased so
boundary pixels aren't blended against the retained surface, but that
makes it include only device pixels whose centers lie inside the damage
region, while AA rendering also writes pixels whose centers lie outside
the geometry. The record-side 2px outset protects content edges, yet
wherever the damage region is intersected with an ancestor clip its
edge coincides exactly with an AA-rendered clip edge with no margin. At
fractional rasterization scales (e.g. 150%) those edges land between
device pixels, so the written AA fringe is permanently excluded from
replay and accumulates as stale stripe artifacts under translate
animations (popup + clipped track + static overlay).

Outset the present clip by one device pixel (stroke-and-union, still
non-AA). The replayed picture is the full frame, so over-covering is
always correct.

Runtime-validated A/B on a 150%-scale GPU machine: stripes reproduce
with the raw clip and disappear with the outset applied.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI lite review requested due to automatic review settings August 10, 2026 16:02
@github-actions github-actions Bot added the area/skia ✏️ Categorizes an issue or PR as relevant to Skia label Aug 10, 2026

Copilot AI 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.

Pull request overview

This PR addresses GPU-backed Skia rendering artifacts at fractional rasterization scales by expanding the present-time damage clip so antialiased fringe pixels are also repainted, preventing stale 1px stripe accumulation (notably in Popup scenarios with ancestor clipping).

Changes:

  • Added OutsetDamageForPresent to expand the damage clip by ~1 device pixel via stroke-and-union.
  • Updated the Skia Draw path to clip using the out-set damage region (still non-antialiased).

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 226774 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 2348, wasm: 11

Details
  • skia-linux-screenshots: 57 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • Buttons.png-dark
    • Buttons.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • DisplayInformation.png-dark
    • ImageIconPage.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Examples.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
  • skia-windows-screenshots: 2348 changed over 2394

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AppBar_KeyBoard.png
    • AppWindowClosing.png
    • AppWindowPresenters.png-dark
    • Arrange_Performance01.png
    • AutoBorderStretchwithrightmargin.png-dark
    • AutoSuggestBox_BitmapIcon.png-dark
    • BadgeNotificationTests.png
    • BasicThemeResources.png-dark
    • BitmapIcon_Generic.png
    • BitmapIcon_Monochromatic.png-dark
    • BorderTopwithmargins.png
    • BorderVersusPanelClipping.png-dark
    • Border_CornerRadius_Clipping2.png-dark
    • Border_CornerRadius_Clipping2.png
    • Border_Simple_No_Background_With_Content_Border_With_Background.png-dark
    • Border_Simple_No_Background_With_Content_Border_With_Background.png
    • Buttons.png-dark
    • Buttons.png
    • CenteredGridinGridwiththreefixedsizechildren.png-dark
    • CenteredGridinGridwiththreefixedsizechildren.png
  • wasm: 11 changed over 1076

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_EnableDevTools
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • UITests.Uno_Web.Http.CookieManagerTests

Copilot AI review requested due to automatic review settings August 10, 2026 19:45

Copilot AI 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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 226834 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 2348, wasm: 11

Details
  • skia-linux-screenshots: 57 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ClipboardTests.png-dark
    • DisplayInformation.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • Examples.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • Focus_FocusVisual_Properties.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Buttons.png
    • ImageIconPage.png-dark
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
  • skia-windows-screenshots: 2348 changed over 2394

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AppBarButtonTest.png
    • AppWindowClosing.png-dark
    • AppWindowPresenters.png-dark
    • Arrange_Performance01.png-dark
    • AutoBorderStretchwithbottommargin.png
    • AutomationProperties_Name.png-dark
    • AutoSuggestBox_Icons.png-dark
    • BasicAutoSuggestBox.png
    • Battery.png-dark
    • Battery.png
    • BitmapImage_vs_SvgImageSource.png
    • BorderBottomwithmargins.png-dark
    • Border_Simple_with_Opacity.png
    • Border_Simple_with_Uniform_Thickness.png-dark
    • Buttons.png
    • Buttons_Native.png-dark
    • CenteredGridinGridwiththreefixedsizechildren.png-dark
    • CenteredGridinGridwiththreefixedsizechildren.png
    • Circle.png-dark
    • Circle.png
  • wasm: 11 changed over 1076

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_EnableDevTools
    • UITests.Uno_Web.Http.CookieManagerTests
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation

@mergify

mergify Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@ramezgerges
ramezgerges merged commit 87fd773 into unoplatform:master Aug 11, 2026
48 checks passed
@ajpinedam

Copy link
Copy Markdown
Contributor

@Mergifyio backport release/stable/6.7

@mergify

mergify Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

backport release/stable/6.7

✅ Backports have been created

Details

kazo0 added a commit that referenced this pull request Aug 28, 2026
…6.7/pr-24031

fix(skia): Outset damage clip to cover AA fringe at fractional scales (backport #24031)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/skia ✏️ Categorizes an issue or PR as relevant to Skia

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants