Repository navigation
feat(drawing)!: Factory seams, Skottie in the Skia backend, Svg/Lottie docs - #25117
MartinZikmund merged 8 commits into
Conversation
Uno.WinUI.Svg and Uno.WinUI.Lottie still described themselves as "Support for Svg/Lottie on Uno.WinUI", which reads as required and backend-neutral. SVG now renders without the package through the managed engine, and the Lottie player, its sources and a managed Lottie engine live in Uno.WinUI; each package only swaps in a SkiaSharp renderer (Svg.Skia, Skottie). The package descriptions and the SVG, Lottie and Uno.Sdk feature docs now say which renderer is used when, what each covers, and how each draws on the Skia and WebGPU backends. The package IDs are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Every drawing seam is now created the same way, Skia vs managed: each backend assembly has one public static *Backend entry class whose Create* factories return the neutral seam, and the implementations are internal. - New ManagedBackend (geometry, fonts, image decoding, SVG, Lottie) and WebGpuBackend (graphics provider). - SkiaBackend.CreateGraphicsProvider is public, with an overload for the preferred context kinds. - The Svg.Skia and Skottie add-ins extend SkiaBackend with CreateSvgRenderer / CreateLottieRenderer (C# 14 static extension members, so those two projects compile as C# 14). They replace SvgBackend and LottieBackend; Svg.Skia, previously internal, can now be registered on a trimmed or AOT head. Both add-in packages depend on Uno.WinUI.Composition.Skia, which carries SkiaBackend. - The host builder resolves every default through these factories, so explicit registration and the default reach the same code. The managed font provider is now found too: its only constructor has an optional parameter, which the parameterless lookup never matched. None of the types made internal or removed has shipped in a release. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The SVG and Lottie pages show how to register each renderer through its factory, and when that is required (trimmed or AOT heads). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Skottie is part of SkiaSharp's native library and its managed wrapper is small, so it no longer needs an add-in: SkiaBackend.CreateLottieRenderer() now lives in Uno.UI.Composition.Skia and the host builder resolves it whenever the Skia backend is present. The Uno.WinUI.Lottie package is removed, and the Uno.Sdk no longer references it. SVG stays a separate add-in. BREAKING CHANGE: the Uno.WinUI.Lottie package is removed; Lottie needs no package on Uno Platform targets. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
The build 238181 found UI Test snapshots differences: Details
|
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25117/docs/index.html |
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Lottie is built into Uno.WinUI and Skottie comes with the Skia backend, so the feature did nothing on Uno targets. On WinAppSDK it only added SkiaSharp.Views.WinUI, which Lottie there never used; it never added CommunityToolkit.WinUI.Lottie. A listed 'lottie' is now ignored, like 'nativerenderer'. Svg no longer adds SkiaSharp.Views.WinUI on WinAppSDK either, where the OS renders SVG. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
WinAppSDK renders with WinUI, yet the implied 'skia' gave every Windows head SkiaSharp.Views.WinUI, Uno.WinUI.Graphics2DSK and, with Toolkit, Uno.Toolkit.Skia.WinUI. A Windows head now gets them only when UnoFeatures lists Skia. 'skiarenderer' is mapped to 'skia' instead of stripped, so a legacy entry still keeps Skia on Windows. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25117/docs/index.html |
|
The build 238235 found UI Test snapshots differences: Details
|
The Uno.WinUI.Lottie add-in and its buildTransitive Skia check are gone, so the test imported a missing file. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
The build 238283 found UI Test snapshots differences: Details
|
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25117/docs/index.html |
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
- Moves past dev.1664, where unoplatform/uno#25117 folds Lottie into Uno.UI and drops the Uno.WinUI.Lottie package and the Lottie Uno feature - Same version Hot Design consumes Themes with (unoplatform/uno.hotdesign#8261) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- Uno 7.0.0-dev.1664 removed the feature (unoplatform/uno#25117): LottieVisualSource now ships in Uno.UI under the same namespace, so the ProgressRing XAML resolves unchanged - On dev.2285 the declaration was already a silent no-op; the restored package graph is identical with and without it - Consumers no longer get Uno.WinUI.Lottie transitively from Uno.Material.WinUI / Uno.Cupertino.WinUI (it does not exist past dev.1664) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- Toolkit 11.0.0-dev.140 and Themes 9.0.0-dev.41 depend on Uno.WinUI.Lottie. The XAML generator compiles a call to the GlobalStaticResources of every referenced XAML assembly, so Navigation.Toolkit.WinUI and Reactive.WinUI hard-referenced Uno.UI.Lottie. - Uno.Sdk 7.0.0-dev.89 apps no longer ship that assembly (Lottie is part of Uno.WinUI since unoplatform/uno#25117), so they failed with FileNotFoundException before any window. - Move Toolkit and Themes to the versions Uno.Sdk 7.0.0-dev.89 pins, and Uno.Sdk.Private to 7.0.0-dev.2428, the Uno.WinUI that SDK uses (both packages require >= 7.0.0-dev.2285). Fixes unoplatform#3262 Co-Authored-By: Claude Opus 5.5 <[email protected]>
GitHub Issue: closes unoplatform/uno-private#2401
PR Type:
✨ Feature
What changed? 🚀
Three related changes to how the SVG and Lottie renderers (and the other drawing seams) are packaged, described and registered.
1. Every drawing seam is reached through a factory
Until now, implementations were exposed three different ways:
SkiaBackend.CreateFontProvider()and the other Skia seams, andLottieBackend.CreateLottieRenderer().new SkiaGraphicsProvider(),new WebGpuGraphicsProvider(), andnew ManagedSvgRenderer()and the other managed engines.SvgBackend.CreateSvgRenderer()was internal, so a trimmed or AOT head (iOS, tvOS), which can't use the automatic lookup, had no way to use it.Now it's Skia vs managed: each backend assembly has one public static entry class, whose
Create…()factories return the neutral seam, and the implementations are internal. The Svg.Skia add-in extendsSkiaBackendwith its renderer's factory instead of having an entry class of their own.Uno.UI.Composition.SkiaSkiaBackendCreateGraphicsProvider()(+ an overload taking the preferred context kinds),CreateFontProvider(),CreateImageDecoder(),CreateGeometryFactory(),CreateLottieRenderer()(Skottie, see 2.)Uno.UI.Svg(Svg.Skia add-in)SkiaBackendCreateSvgRenderer()(Svg.Skia could not be registered before)Uno.UI.Composition.WebGpuWebGpuBackend(new)CreateGraphicsProvider()Uno.UI.Composition.ManagedManagedBackend(new)CreateGeometryFactory(),CreateFontProvider()(+ an overload taking a bundled default font),CreateImageDecoder(),CreateSvgRenderer(),CreateLottieRenderer()UnoPlatformHostBuildercreates every default through these factories, by name, so registering explicitly and relying on the default can't diverge.ManagedBackend.CreateFontProvider()fixes that.SkiaBackend: it's a C# 14 static extension member, so the SVG add-in project compiles as C# 14 (the rest of the repo stays at 13). An app writesSkiaBackend.CreateSvgRenderer()(C# 14, the default from .NET 10), and code on an older language version calls the extension class (SkiaBackendSvgExtensions.CreateSvgRenderer()).Uno.WinUI.Svgnow depends onUno.WinUI.Composition.Skia, which carriesSkiaBackend, and CI stamps that dependency's version likeUno.WinUI's.SvgBackendandLottieBackendare gone.SkottieLottieRenderer.CreateLottieRenderer,ManagedLottieRenderer.CreateLottieRenderer).DrawingBackendConfigurationregisters through the factories. Its iOS/tvOS block now registers the Svg.Skia renderer as well as Skottie, since those heads ship the add-in but couldn't use it.Compatibility:
SvgBackendandLottieBackendare removed, and seven public types become internal:SkiaGraphicsProvider,WebGpuGraphicsProvider, and the fiveManaged*seam implementations. None of these exists onrelease/stable/6.6orrelease/stable/6.7, so no released API changes, and the package-diff baseline doesn't contain them.2. Skottie ships in the Skia backend
Skottie is part of SkiaSharp's native library, and its managed wrapper plus Uno's renderer are about 80 KB, so it no longer needs an add-in. The Svg.Skia closure is about 1.4 MB managed, so SVG stays a separate add-in behind the
Svgfeature.SkottieLottieRenderermoves fromAddIns/Uno.UI.LottieintoUno.UI.Composition.Skia, andUno.WinUI.Composition.Skianow depends onSkiaSharp.Skottie. TheUno.UI.Lottieproject and its stale build-time Skottie check are removed.Uno.WinUI.Lottiepackage is removed. TheUno.Sdkno longer references it or injectsSkiaSharp.Skottie, its entry is gone from the SDK'spackages.json, and the solution templates no longer reference it. The 7.0 migration guide lists the removal.LottieUno Feature is removed. It did nothing on Uno Platform targets. On WinAppSDK it only addedSkiaSharp.Views.WinUI, which Lottie there doesn't use; it never addedCommunityToolkit.WinUI.Lottie. A listedlottieis stripped silently, likenativerenderer.Svgalso stops addingSkiaSharp.Views.WinUIon WinAppSDK, where the OS renders SVG. Checked by evaluatingUno.Features.targetsand the WinAppSDK targets withLottie; Svg;Materialandwebgpu;lottie;svg.Skiais implied only on Uno Platform targets. WinAppSDK renders with WinUI, but the impliedskiagave every Windows headSkiaSharp.Views.WinUI,Uno.WinUI.Graphics2DSKand, withToolkit,Uno.Toolkit.Skia.WinUI. A Windows head now gets them only whenUnoFeatureslistsSkia; shared code that usesSKCanvasElementor Toolkit Skia controls (ShadowContainer) on Windows has to list it, as the 7.0 migration guide says.skiarendereris now mapped toskiarather than stripped, as the docs already claimed, so a legacy entry keeps Skia on Windows. Checked by evaluating the SDK targets fornet10.0-windows10.0.19041andnet10.0-desktopwith no features,Toolkit,Skia;Toolkit,SkiaRenderer;ToolkitandWebGpu: desktop is unchanged, and Windows gets the three packages only withSkiaorSkiaRenderer.SkiaSharp.Skottie.dll, notUno.UI.Lottie.dll.3. Package descriptions and docs
Uno.WinUI.SvgandUno.WinUI.Lottiestill described themselves as "Support for Svg/Lottie on Uno.WinUI". That suggests both are required and work the same on every backend, and neither is true anymore.Uno.WinUI.AnimatedVisualPlayer,LottieVisualSource,ThemableLottieVisualSourceand a managed Lottie engine all ship inUno.WinUI.Uno.WinUI.Svgonly swaps in the Svg.Skia renderer, and Skottie now comes with the Skia backend.Package description:
Uno.WinUI.Svg: replaces the managed SVG engine with the Svg.Skia renderer, for SVG features the managed engine doesn't cover. Uno.WinUI renders SVG without it. Requires SkiaSharp.Docs:
svg.md:Svgfeature switches to Svg.Skia, and only applies to apps using the Skia renderer.SkiaBackend.CreateSvgRenderer()/ManagedBackend.CreateSvgRenderer(), and when registration is required (trimmed or AOT heads).Lottie.md:SkiaBackend.CreateLottieRenderer()/ManagedBackend.CreateLottieRenderer().using-the-uno-sdk.md: theSvgandLottiefeature rows now match what the SDK targets do.migrating-to-uno-7.md: theUno.WinUI.LottieandLottiefeature removal is listed under Packages, the feature is gone from theUno.Sdkfeatures table, andupdating-to-winui3.mdnotes it next to the oldUno.UI.Lottierename.Skottieis added to the cspell word list.The
Uno.WinUI.Svgpackage ID is unchanged, as the issue requests.Uno.WinUI.Lottieis removed rather than redescribed, since nothing is left in it.Validation:
UNO_WEBGPU=1, coveringGiven_UnoPlatformHostBuilder_DrawingSeams,Given_AnimatedVisualPlayerandGiven_ManagedLottie.Given_SvgImageSource_ManagedEngine.Uno.UI.Composition.Skia;Uno.UI.UnitTests. Before the move, the Skia, WebGPU and managed backends,Uno.UI, both add-ins (net10.0 and net11.0) and the runtime tests built with analyzers on. A C# 14 app compiled against the built assemblies callsSkiaBackend.CreateSvgRenderer(),SkiaBackend.CreateLottieRenderer()andSkiaBackend.CreateFontProvider()side by side.nuget pack), and the solution templates; CI covers them.Uno.Sdkfeature conditions). markdownlint and cspell (repo configs) pass on the changed docs. The DocFX site build was not run locally.PR Checklist ✅
Screenshots Compare Test Runresults.Uno.WinUI.Lottiepackage and theLottieUno Feature are removed, andSkiais no longer implied on WinAppSDK (all listed in the 7.0 migration guide). The types made internal never shipped.🤖 Generated with Claude Code