Skip to content

perf: Damage Regions - #23526

Merged
ramezgerges merged 67 commits into
masterfrom
dev/dirty-rectangles-rendering
Jul 8, 2026
Merged

ramezgerges merged 67 commits into
masterfrom
dev/dirty-rectangles-rendering

Conversation

@ramezgerges

@ramezgerges ramezgerges commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

GitHub Issue: closes https://github.com/unoplatform/uno-private/issues/2193

PR Type:

What changed? 🚀

PR Checklist ✅

Copilot AI review requested due to automatic review settings June 23, 2026 21:33
@github-actions github-actions Bot added platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform area/skia ✏️ Categorizes an issue or PR as relevant to Skia area/automation Categorizes an issue or PR as relevant to project automation platform/x11 🐧 Categorizes an issue or PR as relevant to X11 labels Jun 23, 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 introduces damage-region (dirty-rectangle) rendering for the Skia rendering pipeline, enabling partial redraws and optional visualization of repainted regions, and updates multiple Skia platform renderers to support retained composition surfaces.

Changes:

  • Add damage accumulation/plumbing through Visual painting, CompositionTarget, and SkiaRenderHelper to support damage-region rendering and an optional overlay.
  • Introduce retained-layer composition surfaces for several Skia backends (Win32 GL, X11 GL/EGL, WebGL, macOS Metal, Android GL, DRM/framebuffer) to preserve prior frame contents.
  • Add SamplesApp manual test pages for validating damage-region behavior (movement, opacity, scroll, shadows, disjoint regions, acrylic/effects), plus a toggle in the sample chooser.

PR description note: the PR template’s “GitHub Issue: closes #” is currently missing an issue number/link; per repo rules, this needs a real issue URL (or an explicit “No related issue…” note).

Reviewed changes

Copilot reviewed 65 out of 65 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/Uno.UI/UI/Xaml/UIElement.mux.cs Switch global clip computation to use total clip path bounds for visibility checks.
src/Uno.UI/UI/Xaml/Media/CompositionTarget.Rendering.skia.cs Track/consume damage regions; add overlay drawing; add ICompositionTarget.AddDamage.
src/Uno.UI/UI/Xaml/Controls/TextBlock/TextVisual.skia.cs Update Paint to return SKPath? per new damage-path contract.
src/Uno.UI/Helpers/SkiaRenderHelper.skia.cs Plumb damage path into root visual rendering; add FPS panel damage bounds helper.
src/Uno.UI/Helpers/RetainedLayer.skia.cs New helper for a retained SKSurface and presentation into swapchain surface.
src/Uno.UI/Graphics/SKCanvasVisual.skia.cs Update Paint signature (now returns a path) for damage tracking.
src/Uno.UI/FeatureConfiguration.cs Add FeatureConfiguration.Rendering.DamageRegionOverlay toggle.
src/Uno.UI.Runtime.Skia.X11/Rendering/X11Renderer.cs Add retained-layer option and presentation path for X11 renderers.
src/Uno.UI.Runtime.Skia.X11/Rendering/X11OpenGLRenderer.cs Enable retained-layer usage and dispose it during renderer disposal.
src/Uno.UI.Runtime.Skia.X11/Rendering/X11EGLRenderer.cs Enable retained-layer usage and dispose it during renderer disposal.
src/Uno.UI.Runtime.Skia.Win32/Rendering/Win32WindowWrapper.Rendering.OpenGl.cs Add swapchain surface + retained layer surface for GL backend.
src/Uno.UI.Runtime.Skia.WebAssembly.Browser/Rendering/WebGlBrowserRenderer.cs Render into retained layer, then present into WebGL swapchain surface.
src/Uno.UI.Runtime.Skia.MacOS/UI/Xaml/Window/MacOSWindowHost.cs Render into retained layer for Metal path; keep software path as-is.
src/Uno.UI.Runtime.Skia.Linux.FrameBuffer/Rendering/SoftwareRenderer.cs Refactor output presentation into PresentToOutput (cursor draw after ReadPixels).
src/Uno.UI.Runtime.Skia.Linux.FrameBuffer/Rendering/FrameBufferRenderer.cs Stop clearing every frame; introduce PresentToOutput abstraction and cursor helper.
src/Uno.UI.Runtime.Skia.Linux.FrameBuffer/Rendering/DRMRenderer.cs Add GL framebuffer surface + retained composition surface, present composition into framebuffer.
src/Uno.UI.Runtime.Skia.AppleUIKit/UI/Xaml/Window/RootViewController.cs Pass nullable canvas + resize func through to OnNativePlatformFrameRequested.
src/Uno.UI.Runtime.Skia.AppleUIKit/Rendering/UnoSKMetalView.cs Render into retained layer and present into Metal swapchain surface.
src/Uno.UI.Runtime.Skia.Android/Rendering/UnoSKCanvasView.cs Render into retained layer for HW accel, present into GL-backed surface; improve cleanup.
src/Uno.UI.Composition/Composition/Visual.skia.cs Add clip accumulation in root coordinates; integrate damage contribution and Paint path caching.
src/Uno.UI.Composition/Composition/Visual.Damage.skia.cs New damage computation logic (bounds/path-based) including shadow/effect margins.
src/Uno.UI.Composition/Composition/Visual.cs Ensure opacity-to-0 damages last rendered region so vacated area is repainted.
src/Uno.UI.Composition/Composition/Uno/Visual.PaintingSession.skia.cs Add SKPath? Damage to painting session factory/session.
src/Uno.UI.Composition/Composition/SpriteVisual.skia.cs Update Paint signature; forward brush damage sampling margin.
src/Uno.UI.Composition/Composition/SkiaAcrylicBrush.skia.cs Add damage sampling margin for blur padding and reuse constant.
src/Uno.UI.Composition/Composition/ShapeVisual.skia.cs Return own content path and compute local content bounds for better damage regions.
src/Uno.UI.Composition/Composition/RedirectVisual.skia.cs Update Paint signature for new path-returning contract.
src/Uno.UI.Composition/Composition/ICompositionTarget.cs Add AddDamage(SKRect) and AddDamage(SKPath) for Skia targets.
src/Uno.UI.Composition/Composition/DamageRegionExtensions.skia.cs Add helpers for unioning/clamping SKPaths efficiently (thread-static scratch paths).
src/Uno.UI.Composition/Composition/ContainerVisual.skia.cs Damage removed children’s last-rendered region; propagate recursive damage on removal.
src/Uno.UI.Composition/Composition/Compositor.skia.cs Pass damage accumulator into root visual rendering.
src/Uno.UI.Composition/Composition/CompositionSpriteShape.skia.cs Add render bounds/path extraction for precise damage in ShapeVisual/BorderVisual.
src/Uno.UI.Composition/Composition/CompositionNineGridBrush.skia.cs Forward damage sampling margin from source brush.
src/Uno.UI.Composition/Composition/CompositionMaskBrush.skia.cs Combine damage sampling margins from source/mask brushes.
src/Uno.UI.Composition/Composition/CompositionEffectBrush.skia.cs Track backdrop blur sigma for damage sampling margin; reset on filter rebuild.
src/Uno.UI.Composition/Composition/CompositionBrushWrapper.skia.cs Forward repaint/damage sampling properties from wrapped brush.
src/Uno.UI.Composition/Composition/CompositionBrush.skia.cs Add DamageRegionSamplingMargin base property.
src/Uno.UI.Composition/Composition/BorderVisual.skia.cs Return own content path and provide damage sampling margin for border/background.
src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Controls/SampleChooserControl.xaml Add menu item toggle for damage region overlay.
src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Presentation/SampleChooserViewMode.Properties.cs Expose DamageRegionOverlay flag via FeatureConfiguration.Rendering.
src/SamplesApp/SamplesApp.Samples/Windows_UI_Composition/DamageRegion/DamageRegion_Static.xaml(.cs) Manual sample: static baseline scene.
src/SamplesApp/SamplesApp.Samples/Windows_UI_Composition/DamageRegion/DamageRegion_SmallUpdate.xaml(.cs) Manual sample: small in-place updating element.
src/SamplesApp/SamplesApp.Samples/Windows_UI_Composition/DamageRegion/DamageRegion_ShadowChildShape.xaml(.cs) Manual sample: shadow caster + overflowing child shape motion.
src/SamplesApp/SamplesApp.Samples/Windows_UI_Composition/DamageRegion/DamageRegion_ShadowChildPaintingCaster.xaml(.cs) Manual sample: self-painting caster + moving overflowing child.
src/SamplesApp/SamplesApp.Samples/Windows_UI_Composition/DamageRegion/DamageRegion_ShadowChild.xaml(.cs) Manual sample: moving child under a shadow caster.
src/SamplesApp/SamplesApp.Samples/Windows_UI_Composition/DamageRegion/DamageRegion_Shadow.xaml(.cs) Manual sample: moving elevated element across static background.
src/SamplesApp/SamplesApp.Samples/Windows_UI_Composition/DamageRegion/DamageRegion_Scroll.xaml(.cs) Manual sample: scroll viewer content moved by ChangeView.
src/SamplesApp/SamplesApp.Samples/Windows_UI_Composition/DamageRegion/DamageRegion_Rounded.xaml(.cs) Manual sample: rounded border + ellipse repainting.
src/SamplesApp/SamplesApp.Samples/Windows_UI_Composition/DamageRegion/DamageRegion_Opacity.xaml(.cs) Manual sample: repeated opacity-to-0 transitions.
src/SamplesApp/SamplesApp.Samples/Windows_UI_Composition/DamageRegion/DamageRegion_MovedElement.xaml(.cs) Manual sample: element translating over static background.
src/SamplesApp/SamplesApp.Samples/Windows_UI_Composition/DamageRegion/DamageRegion_Disjoint.xaml(.cs) Manual sample: two far-apart elements updated together.
src/SamplesApp/SamplesApp.Samples/Windows_UI_Composition/DamageRegion/DamageRegion_Acrylic.xaml(.cs) Manual sample: acrylic/effect brush validation with moving backdrop element.
src/AddIns/Uno.WinUI.Graphics3DGL/GLCanvasElement.cs Update Visual paint signature to return SKPath?.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 219525 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) 🚨🚨
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • Examples.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • ImageIconPage.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • DisplayInformation.png-dark
    • Buttons.png-dark
  • skia-windows-screenshots: 2348 changed over 2388

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_ScreenReader.png
    • AndroidWindowInsets.png
    • Attributed_text_FontSize_Changing.png-dark
    • ApplicationViewSizing.png
    • AutoBorderStretchwithtopmargin.png
    • AppWindowPresenters.png-dark
    • AutoSuggestBoxChosenSuggestion.png-dark
    • Attributed_text_FontSize_Changing.png
    • AutoSuggestBox_SoftKeboard.png
    • AutoBorderStretchwithtopmargin.png-dark
    • Basics.png-dark
    • AutoSizedPathCentered.png-dark
    • BezierSegment.png-dark
    • AutoSuggestBox_Reason.png-dark
    • BorderCenteredwithmargins.png
    • BasicThemeResources.png
    • BorderRightwithmargins.png-dark
    • BitmapImage_vs_SvgImageSource.png
    • BorderRightwithmargins.png
    • BorderBottomwithmargins.png-dark
  • wasm: 11 changed over 1076

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

@ramezgerges ramezgerges changed the title Dev/dirty rectangles rendering perf: Damage Regions Jun 29, 2026
@ramezgerges
ramezgerges force-pushed the dev/dirty-rectangles-rendering branch from 18eda86 to f8eb3fe Compare June 29, 2026 17:02
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 220153 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) 🚨🚨
    • CalendarView_Theming.png-dark
    • ClipboardTests.png-dark
    • Examples.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ImageIconPage.png-dark
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • Buttons.png-dark
    • Buttons.png
    • DisplayInformation.png-dark
  • skia-windows-screenshots: 2348 changed over 2390

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AppBarButtonWithIconTest.png
    • Arrange_Performance01.png-dark
    • AutoBorderStretchwithleftmargin.png
    • AutoSuggestBox_BitmapIcon.png-dark
    • Basics Pivot Test.png
    • BenchmarkDotNet.png-dark
    • BitmapImage_vs_SvgImageSource.png
    • BorderLeftwithmargins.png
    • Border_CornerRadius.png
    • Border_CornerRadius_Alignments.png-dark
    • Border_LinearGradientBrush.png
    • Border_Simple.png-dark
    • Border_With_ScaleTransform.png
    • Border_With_TranslateTransform.png-dark
    • Button_IsEnabled_Automated.png-dark
    • Button_IsEnabled_Automated.png
    • ChatBox.png-dark
    • ChatBox.png
    • ComboBox_ComboBoxItem_Selection.png-dark
    • ComboBox_ComboBoxItem_Selection.png
  • wasm: 11 changed over 1076

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

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 65 out of 65 changed files in this pull request and generated 7 comments.

Comment thread src/Uno.UI/UI/Xaml/UIElement.mux.cs Resolved
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 220437 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) 🚨🚨
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.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
    • ContextRequested.png-dark
    • ContextRequested.png
    • DisplayInformation.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Buttons.png-dark
    • Buttons.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • Focus_FocusVisual_Properties.png-dark
  • skia-windows-screenshots: 2348 changed over 2390

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedIconPage.png-dark
    • AppBar_KeyBoard.png
    • AnimatedIconPage.png
    • AppWindowClosing.png-dark
    • AppBarButtonWithIconTest.png-dark
    • ApplicationViewSpanningRectsPage.png
    • ApplicationViewSpanningRectsPage.png-dark
    • Attributed_text_Simple.png
    • Attributed_text_Simple.png-dark
    • AppWindowTitleBar Properties.png
    • AppWindowTitleBar Properties.png-dark
    • AutomationProperties_AutomationId.png-dark
    • AutoSizedPathCentered.png
    • AutoBorderStretchwithbottommargin.png-dark
    • AuthenticationBroker_Demo.png-dark
    • AutoSuggestBox_Keyboard.png-dark
    • BadgeNotificationTests.png-dark
    • AutomationProperties_Name.png
    • AutomationProperties_AutomationId.png
    • BasicAcrylicBrushTest.png
  • wasm: 11 changed over 1076

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

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 220437 has failed on Uno.UI - CI.

@MartinZikmund

Copy link
Copy Markdown
Member

It seems the dirty invalidation has some issues with the setting icon (it should rotate):

Recording.2026-07-02.173404.mp4

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 220719 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) 🚨🚨
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • DisplayInformation.png-dark
    • ContextRequested.png-dark
    • ContextRequested.png
    • ImageIconPage.png-dark
    • ClipboardTests.png-dark
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • Examples.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • ElementLevelTheme.png-dark
  • skia-windows-screenshots: 2348 changed over 2390

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_ScreenReader.png-dark
    • ArcSegment.png
    • AutoBorderStretchwithtopmargin.png
    • AutoSuggestBox_BitmapIcon.png-dark
    • BasicEnability.png-dark
    • BenchmarkDotNet.png
    • BitmapImage_vs_SvgImageSource.png
    • BorderTopwithmargins.png-dark
    • Border_AntiAlias.png-dark
    • Border_AntiAlias.png
    • Border_CornerRadius_Gradient.png-dark
    • Border_CornerRadius_Gradient.png
    • Border_Simple_with_non_Uniform_Thickness.png-dark
    • Border_Simple_with_non_Uniform_Thickness.png
    • Buttons_Native.png-dark
    • Buttons_Native.png
    • Canvas_ZIndex.png-dark
    • Canvas_ZIndex.png
    • ClosedFigure.png-dark
    • ClosedFigure.png
  • wasm: 11 changed over 1076

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

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 220719 has failed on Uno.UI - CI.

Copilot AI review requested due to automatic review settings July 6, 2026 15:01
@ramezgerges
ramezgerges force-pushed the dev/dirty-rectangles-rendering branch from bed9892 to f202749 Compare July 6, 2026 15:01
ramezgerges and others added 14 commits July 8, 2026 19:30
The shadow branch of TryGetLocalContentBounds hard-coded the caster's Size rect
as its own-content seed, but Size only bounds a visual's painting when
PaintsWithinOwnSize is true (the non-shadow path returns false otherwise).
Mirror that logic — and WalkShadowSilhouette's own-contribution bound — instead:
empty when the caster paints nothing, Size when it paints within Size, else fall
back to the clip. Guard the now-reachable empty silhouette so ExpandForShadow
doesn't inflate an empty rect into a spurious region.

No behavior change for the existing shadow casters (Borders: CanPaint and
PaintsWithinOwnSize, so the seed stays the Size rect); removes a latent
under-damage for a hypothetical caster that paints beyond its Size, and tightens
the over-estimate for non-painting container casters.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…e picture

Each path-painting visual (ShapeVisual, BorderVisual) now records its own local
painted geometry in Paint via CacheOwnContentPath, captured when the picture is
(re)recorded and reused for the per-frame damage region. This replaces the
separate per-frame TryGetLocalContentPath reconstruction: the geometry now comes
from the same place that draws it (no drift), and a moved-but-unchanged visual
reuses the cached path instead of rebuilding it every frame (the local path is
invariant under moves; the current TotalMatrix is applied at damage time).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
… call

Change Visual.Paint to return the local content geometry it painted (SKPath?)
rather than each painter calling CacheOwnContentPath. PaintStep caches whatever
Paint returns, so painters just 'return' their geometry and CacheOwnContentPath
becomes a private detail of the caller. Behavior-identical to the previous
commit (same cached value); cleaner contract.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
It always produces the shape's exact geometry; false means nothing is drawn, not
that computing the path failed. Drop the misleading Try prefix and document the
false return.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Paint now returns a fresh per-visual SKPath, so PaintStep just keeps the
reference (_ownContentPath = visual.Paint(...)) instead of copying it into a
rewound path. Removes the [ThreadStatic] build scratch, the CacheOwnContentPath
copy, and the _hasOwnContentPath flag (a null/empty _ownContentPath now signals
no analytic path). The scratch only existed to avoid aliasing a shared buffer;
owning the path per-visual removes that need. Allocation happens only on an
actual repaint (a moved-but-unchanged visual reuses the cached path), not per
frame.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…unds

Compute the visual's own painted bounds once (empty when it paints nothing, its
Size when it paints within Size, else bail to the clip), then branch: with a
shadow, return the silhouette (own content + descendants + shadow); without,
return the own content directly. Removes the duplicated CanPaint/PaintsWithinOwnSize
logic across the two branches.

Behavior-identical except one edge: a degenerate-size (<=0) PaintsWithinOwnSize
shadow caster previously fell back to the clip and now derives its silhouette
from descendants (empty own content), which is tighter and still sound.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
The per-frame damage snapshot was a fresh new SKPath(_pendingDamage) abandoned to
GC each frame, and ReturnFrame dropped a superseded frame's snapshot the same way.
At most a couple of frames are in flight, so recycle their paths through a small
_frameGate-guarded pool instead of allocating (and finalizing) a native path per
frame. Addresses Copilot comments on Rendering.skia.cs.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…nt alloc

BuildOwnContentPath returned a fresh new SKPath() each repaint, abandoning the
previous _ownContentPath. The damage consumer copies it, so rebuilding in place
is safe: give each ShapeVisual/BorderVisual a per-instance buffer reused across
repaints (record-phase/single-thread). Addresses Copilot comments on Visual.skia.cs.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
The WinAppSDK (native WinUI) Samples App build failed on two samples:
- CS1537: 'using Colors = Microsoft.UI.Colors' duplicated a global alias present
  on the WinAppSDK head (absent on Skia). Use 'using Microsoft.UI;' instead, which
  brings Colors into scope on Skia and coexists with the global alias on WinAppSDK.
- CS0108: 'x:Name="Content"' generated a field hiding UserControl.Content on Page.
  Rename the StackPanel to ContentPanel.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
GetGlobalBoundsWithOptions (automation/IsOffscreen) allocated a native SKPath per
call. Reuse a [ThreadStatic] scratch instead (GetTotalClipPath rewinds it at the
root, so no reset needed), keeping the inlined single-use form. Addresses Copilot
review on UIElement.mux.cs.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
CompositionShape.Render applies the shape's Offset and CombinedTransformMatrix
(Scale/Rotation around CenterPoint) to the canvas before painting, but
GetRenderPath/TryGetRenderBounds returned the geometry without that transform.
The damage region is derived from those, so a shape with a non-identity
Offset/Rotation (e.g. an animating AnimatedIcon whose gear shapes rotate about a
centre) damaged the wrong region and never erased the previous/initial frame,
leaving a ghost of the initial image while the rotation played.

Apply Translate(Offset)*CombinedTransformMatrix to the returned geometry/bounds
so the damage geometry matches the painted pixels.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Per review feedback on the PR.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Make the diagnostic overlay's fill/stroke SKPaints static instead of
allocating them per frame. Per review feedback on the PR.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Copilot AI review requested due to automatic review settings July 8, 2026 19:44
@ramezgerges
ramezgerges force-pushed the dev/dirty-rectangles-rendering branch from f202749 to d39b289 Compare July 8, 2026 19:44

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 66 out of 66 changed files in this pull request and generated 4 comments.

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 221401 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
    • ClipboardTests.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • Buttons.png
    • DisplayInformation.png-dark
    • ContextRequested.png-dark
    • ContextRequested.png
    • Examples.png-dark
    • Examples.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
  • skia-windows-screenshots: 2348 changed over 2390

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AppBarButtonWithIconTest.png
    • AppWindowPositionAndSize.png-dark
    • Attributed_text_FontSize_Changing.png
    • AutomationProperties_Name.png
    • BackGesture.png-dark
    • BasicEnability.png
    • BitmapIcon_Foreground.png-dark
    • BorderRightwithmargins.png
    • BorderWithNullBrushAndNonZeroThickness.png
    • Border_AntiAlias.png-dark
    • Border_CornerRadius_with_Opacity.png
    • Border_Corner_Overlap.png-dark
    • Border_With_CompositeTransform.png
    • Border_With_Off_Centre_RotateTransform.png-dark
    • Button_Click_Verify_SynchronizationContext.png-dark
    • Button_Click_Verify_SynchronizationContext.png
    • Canvas_ZIndex.png-dark
    • Canvas_ZIndex.png
    • ClippingRoundedCorners.png-dark
    • ClippingRoundedCorners.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
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • UITests.Uno_Web.Http.CookieManagerTests
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background
    • 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
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems

@ramezgerges
ramezgerges enabled auto-merge July 8, 2026 22:57
@ramezgerges
ramezgerges merged commit 8e8cbb4 into master Jul 8, 2026
50 checks passed
@ramezgerges
ramezgerges deleted the dev/dirty-rectangles-rendering branch July 8, 2026 22:59
MartinZikmund added a commit to ramezgerges/uno that referenced this pull request Sep 21, 2026
BorderVisual, SpriteVisual and CompositionEffectBrush lost their
DamageRegionSamplingMargin overrides, so a backdrop blur was damaged
only over its own bounds. Border/Sprite restored verbatim; the effect
brush ports the max blur sigma onto the neutral EffectNode tree.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01XsQppKuZgijApgJxaTZt81
MartinZikmund added a commit to ramezgerges/uno that referenced this pull request Sep 21, 2026
…3526

Hiding a visual damaged only its own last bounds when the walk next met
it, never its descendants', and a repaint-every-frame visual no longer
kept its ancestors from collapsing it into a cached children picture.
Both restored from master, using the branch's ContributeRemovalDamage.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01XsQppKuZgijApgJxaTZt81
MartinZikmund added a commit to ramezgerges/uno that referenced this pull request Sep 21, 2026
A presented frame went back into the slot with its damage, so the next
frame repainted it again, while an unpresented frame's damage skipped
the frame that replaced it. Ported master's rules: Draw drops presented
damage, Render folds a dropped frame's damage into its replacement.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01XsQppKuZgijApgJxaTZt81
MartinZikmund added a commit to ramezgerges/uno that referenced this pull request Sep 21, 2026
…m#23526

The merge dropped master's two TryGetRenderBounds regression tests
because they used SKRect. Ported to Rect; the GetRenderPath asserts are
gone with the branch's rect-only damage.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01XsQppKuZgijApgJxaTZt81
MartinZikmund added a commit to ramezgerges/uno that referenced this pull request Sep 21, 2026


Two runtime tests for the restored behaviours: hiding a container
damages its descendants' last bounds, and a repaint-every-frame visual
keeps a stable subtree from collapsing. Both fail with the fix undone.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01XsQppKuZgijApgJxaTZt81
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/automation Categorizes an issue or PR as relevant to project automation area/skia ✏️ Categorizes an issue or PR as relevant to Skia platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform platform/x11 🐧 Categorizes an issue or PR as relevant to X11

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants