fix: Avoid InvalidateRender in UIElement#21235
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the rendering invalidation mechanism in Uno's Skia-based platforms by avoiding direct InvalidateRender calls within UIElement and introducing a more centralized approach to picture recording and rendering.
- Removes the workaround
InvalidateRendercall from the layout update cycle inUIElement - Introduces
SetEntireSubtreeDirtymethod and centralizes picture recording logic inSkiaRenderHelper - Consolidates rendering logic across all Skia platforms to use shared helper methods
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| UIElement.cs | Removes workaround InvalidateRender call and adds SetEntireSubtreeDirty method |
| XamlIslandRootScale.mux.cs | Enables the previously commented SetEntireSubtreeDirty call |
| SkiaRenderHelper.skia.cs | Refactors and consolidates picture recording and rendering logic |
| Various platform-specific files | Updates all Skia platforms to use centralized rendering approach |
| using Windows.Win32.Graphics.Gdi; | ||
| using Windows.Win32.UI.HiDpi; | ||
| using Windows.Win32.UI.WindowsAndMessaging; | ||
| using System.Runtime.InteropServices.JavaScript; |
There was a problem hiding this comment.
The System.Runtime.InteropServices.JavaScript import appears to be incorrect for a Win32 platform. This namespace is typically used for WebAssembly interop.
| using System.Runtime.InteropServices.JavaScript; |
| using Microsoft.UI.Xaml.Controls; | ||
| using SkiaSharp; | ||
| using Uno.UI.Xaml.Core; | ||
| using static Uno.UI.Helpers.SkiaRenderHelper; |
There was a problem hiding this comment.
Using a static import for the same class being defined creates a circular reference and is unnecessary. This line should be removed.
| using static Uno.UI.Helpers.SkiaRenderHelper; |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21235/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21235/docs/index.html |
|
|
22ddf92 to
a366937
Compare
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21235/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21235/docs/index.html |
|
|
a366937 to
97f62e4
Compare
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21235/docs/index.html |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21235/wasm-skia-net9/index.html |
|
|
|
This change is included in #21299 |
Depends on #21189
PR Type: 🐞 Bugfix
What is the current behavior? 🤔
What is the new behavior? 🚀
PR Checklist ✅
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Runresults.Other information ℹ️