Repository navigation
feat(composition): Support composition-based Lottie in AnimatedVisualPlayer - #24056
Conversation
|
Claude finished @MartinZikmund's task in 7m 39s —— View job PR Review —
|
| # | File | Severity | Issue |
|---|---|---|---|
| 1 | CompositionShape.skia.cs:41-46 |
Style | Comment continuation and two statements over-indented by one tab level (5 tabs vs surrounding 4); looks like a copy-paste artefact in the diff |
| 2 | ColorKeyFrameAnimation.cs:13 |
Style | #if !__APPLE_UIKIT__ is always true in Uno.UI.Composition (project forces UnoRuntimeIdentifier=Skia); should use #if __SKIA__ to match PathKeyFrameAnimation.cs and signal intent clearly |
| 3 | Given_CompositionGeometry.cs:20-22 |
Style | #if !__SKIA__ around [Ignore] — prefer [PlatformCondition(ConditionMode.Include, RuntimeTestPlatforms.Skia*)] per project convention |
| 4 | ExpressionAnimation.cs:43-47 |
Accuracy | Comment says "across every target this animation is started on" but CloneAnimation() is called before Start() in CompositionObject.StartAnimation, so no instance is ever started on more than one target; the real benefit is parse-tree reuse across stop/restart cycles on the same target |
Cross-cutting observations:
CompositionAnimation.Stop()LIFO removal — the comment documents the Start/Stop-are-balanced assumption, which holds becauseExpressionAnimationis cloned per target andKeyFrameAnimationis started once per property-owner pair. The assumption is correct but fragile; worth a tracked TODO if multi-target KFAs are ever needed.- Win2D types made public — the sequencing note ("those two must ship in the same release") is critical and well-called out. Ensure it is captured in a tracked issue/release checklist item outside this PR.
StrokeDashArraylazy-init — the??=in the getter means the internal setter can null it out (viaSetProperty(ref _strokeDashArray, null)), losing previously added items. Internal-only setter so not a public-API concern, but worth documenting in the setter if that path can be triggered.- Test coverage is solid: red-before/green-after for the transform-order fix, end-to-end render validation for all three LottieGen test assets, and regression coverage for StrokeDashArray/Rectangle geometry.
WinAppSDK sync generator drift detected on
|
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-24056/docs/index.html |
|
The build 227224 found UI Test snapshots differences: Details
|
|
Claude finished @MartinZikmund's task in 7m 35s —— View job PR Review —
|
| # | File | Severity | Issue |
|---|---|---|---|
| 1 | CompositionShape.skia.cs:41–46 |
Style | Comment continuation and two statements over-indented by one tab (copy-paste artefact) |
| 2 | ColorKeyFrameAnimation.cs:13 |
Style | #if !__APPLE_UIKIT__ is always-true in this Skia-only project; remove or change to #if __SKIA__ to match PathKeyFrameAnimation.cs |
| 3 | CompositionAnimation.cs:81–84 |
Style | #if __SKIA__ around Compositor.RegisterAnimation is always-true; inconsistent with the unguarded _startedObjects.Add above it |
| 4 | CompositionAnimation.cs:99–102 |
Style | Same as #3 in Stop() — PR author flagged this themselves in a review comment |
| 5 | Given_CompositionGeometry.cs:20–22 |
Style | #if !__SKIA__ wrapping [Ignore] — prefer [PlatformCondition] per runtime-test convention |
| 6 | ExpressionAnimation.cs:43–47 |
Accuracy | Comment says "across every target" but StartAnimation always clones first, so no instance is started on more than one target; the real benefit is parse-tree reuse on stop/restart cycles |
| 7 | PathKeyFrameAnimation.cs:110 |
Accuracy | Conic morph uses from path's weight only; valid given topology-identical constraint, but the assumption is undocumented |
Cross-cutting observations worth tracking:
CompositionAnimation.Stop()LIFO assumption — correct given thatExpressionAnimationis cloned per target andKeyFrameAnimationis started once per property-owner pair. Fragile if either invariant breaks; a tracked TODO would help.- Win2D types made public — the sequencing note ("must ship in same release") is critical and well-called out. Ensure it's tracked in a release checklist item outside this PR, as noted in the description.
StrokeDashArraylazy init —_strokeDashArray ??= new()in the getter means the internal setter can null it out, losing previously added items. Internal-only path so not a public-API concern, but worth a note in the setter.PathKeyFrameAnimation._skPathCache— no eviction; acceptable sincePathKeyFrameAnimationis short-lived, but worth noting if lifetime assumptions change.
There was a problem hiding this comment.
Pull request overview
This PR completes the Composition surface area needed for composition-based (LottieGen) animated visuals to run through AnimatedVisualPlayer, and migrates ProgressRing to WinUI’s generated Composition visuals (removing the Uno.UI.Lottie add-in requirement). It also adds targeted runtime-test coverage for the newly supported Composition behaviors and fixes several Composition rendering/animation gaps that previously caused generated Lottie sources to throw or render incorrectly.
Changes:
- Implement missing Composition animation/rendering primitives (keyframe animations, expression functions, gradient/geometry animation, trim semantics, controller playback behavior) required by unmodified LottieGen output.
- Switch
ProgressRingto WinUI-aligned generated Composition visuals and update color theming to useIAnimatedVisualSource2.SetColorProperty. - Add runtime tests validating trimmed-ellipse origin, rectangle geometry expression bindings, generated-Lottie end-to-end rendering, and ProgressRing transform-order behavior.
Reviewed changes
Copilot reviewed 89 out of 97 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Uno.UI/UI/Xaml/Shapes/Shape.cs | Update stroke dash propagation to match non-null Composition dash collection semantics. |
| src/Uno.UI/UI/Xaml/Hosting/ElementCompositionPreview.cs | Document that SetElementChildVisual accepts null to remove the child visual. |
| src/Uno.UI/UI/Xaml/FrameworkElement.cs | Revert framework-wide hit-test gating change (now scoped elsewhere). |
| src/Uno.UI/UI/Xaml/Controls/ProgressRing/ProgressRing.cs | Replace Lottie-asset-based ProgressRing with generated Composition visuals and update theming hooks. |
| src/Uno.UI/UI/Xaml/Controls/ProgressRing/AnimatedVisuals/ProgressRingIndeterminate.cs | Add generated Composition visual source for indeterminate ProgressRing. |
| src/Uno.UI/UI/Xaml/Controls/ProgressRing/AnimatedVisuals/ProgressRingDeterminate.cs | Add generated Composition visual source for determinate ProgressRing. |
| src/Uno.UI/UI/Xaml/Controls/AnimatedVisualPlayer/ILottieVisualSourceProvider.cs | Add/clarify public XML docs for Uno.UI.Lottie provider contract. |
| src/Uno.UI/UI/Xaml/Controls/AnimatedVisualPlayer/IAnimatedVisualSource.cs | Add local partial interface stub for sync generator + XML docs. |
| src/Uno.UI/UI/Xaml/Controls/AnimatedVisualPlayer/AnimatedVisualPlayer.mux.cs | Fix play-duration handling for async source resolution; add missing public XML docs. |
| src/Uno.UI/UI/Xaml/Controls/AnimatedVisualPlayer/AnimatedVisualPlayer.h.mux.cs | Add m_playDuration field to match WinUI structure. |
| src/Uno.UI/UI/Xaml/Controls/AnimatedVisualPlayer/AnimatedVisualPlayer.cs | Scope hit-testing behavior to AnimatedVisualPlayer via composition-child visual presence. |
| src/Uno.UI/UI/Xaml/Automation/Peers/AnimatedVisualPlayerAutomationPeer.cs | Add constructor XML docs. |
| src/Uno.UI/Generated/3.0.0.0/Microsoft.UI.Xaml.Controls/IAnimatedVisualSource.cs | Correct generator output guard for a working interface (#if false pattern). |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Composition/Given_CompositionSpriteShape.cs | Add regression test for ellipse trim origin; improve stroke-thickness measurement for HiDPI. |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Composition/Given_CompositionGeometry.cs | Add tests for rectangle Size/Offset animatability and non-null StrokeDashArray behavior. |
| src/Uno.UI.RuntimeTests/Tests/Microsoft_UI_Xaml_Controls/AnimatedVisuals/Given_ProgressRing_Visuals.cs | Add regression test for transform order so ProgressRing arcs remain on-screen during rotation. |
| src/Uno.UI.RuntimeTests/Tests/Microsoft_UI_Xaml_Controls/AnimatedVisuals/Given_Generated_Lottie.cs | Add end-to-end runtime test validating unmodified LottieGen sources load/scrub/render. |
| src/Uno.UI.RuntimeTests/Directory.Build.targets | Exclude HotReload HRUnoLib bin/obj from compilation inputs. |
| src/Uno.UI.Composition/Win2D/Microsoft/Graphics/Canvas/ICanvasResourceCreator.cs | Make Win2D surface API public for LottieGen -Public compilation. |
| src/Uno.UI.Composition/Win2D/Microsoft/Graphics/Canvas/Geometry/CanvasSweepDirection.cs | Publicize Win2D enum for generated sources. |
| src/Uno.UI.Composition/Win2D/Microsoft/Graphics/Canvas/Geometry/CanvasPathBuilder.cs | Publicize Win2D path builder for generated sources. |
| src/Uno.UI.Composition/Win2D/Microsoft/Graphics/Canvas/Geometry/CanvasGeometry.cs | Publicize Win2D geometry for generated sources. |
| src/Uno.UI.Composition/Win2D/Microsoft/Graphics/Canvas/Geometry/CanvasFilledRegionDetermination.cs | Publicize Win2D enum for generated sources. |
| src/Uno.UI.Composition/Win2D/Microsoft/Graphics/Canvas/Geometry/CanvasFigureSegmentOptions.cs | Publicize Win2D enum for generated sources. |
| src/Uno.UI.Composition/Win2D/Microsoft/Graphics/Canvas/Geometry/CanvasFigureLoop.cs | Publicize Win2D enum for generated sources. |
| src/Uno.UI.Composition/Win2D/Microsoft/Graphics/Canvas/Geometry/CanvasFigureFill.cs | Publicize Win2D enum for generated sources. |
| src/Uno.UI.Composition/Win2D/Microsoft/Graphics/Canvas/Geometry/CanvasArcSize.cs | Publicize Win2D enum for generated sources. |
| src/Uno.UI.Composition/Win2D/Microsoft/Graphics/Canvas/CanvasDevice.cs | Publicize Win2D CanvasDevice for generated sources. |
| src/Uno.UI.Composition/Generated/3.0.0.0/Microsoft.UI.Composition/PathKeyFrameAnimation.cs | Switch generated stub to “already declared” pattern for implemented members. |
| src/Uno.UI.Composition/Generated/3.0.0.0/Microsoft.UI.Composition/Compositor.cs | Remove stale NotImplemented stubs for implemented compositor factory methods. |
| src/Uno.UI.Composition/Generated/3.0.0.0/Microsoft.UI.Composition/ColorKeyFrameAnimation.cs | Switch generated stub to “already declared” pattern for implemented members. |
| src/Uno.UI.Composition/Composition/SubPropertyHelpers.cs | Add scalar-to-vector broadcast semantics for whole-vector assignments. |
| src/Uno.UI.Composition/Composition/KeyFrameAnimations/PathKeyFrameAnimation.cs | Implement path keyframes + Skia morphing for LottieGen path animations. |
| src/Uno.UI.Composition/Composition/KeyFrameAnimations/ColorKeyFrameAnimation.cs | Implement color keyframes and color-space interpolation options. |
| src/Uno.UI.Composition/Composition/KeyFrameAnimation.cs | Ensure playback rate set before Start() applies once evaluator is created. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/TanFloatFunctionSpecification.cs | Add Tan function support for expression animations. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/SqrtFloatFunctionSpecification.cs | Add Sqrt function support for expression animations. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/SinFloatFunctionSpecification.cs | Add Sin function support for expression animations. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/RoundFloatFunctionSpecification.cs | Add Round function support for expression animations. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/QuaternionCreateFromAxisAngleVector3FloatFunctionSpecification.cs | Add Quaternion factory support used by generated expressions. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/ModFloatFloatFunctionSpecification.cs | Add Mod support used by generated expressions. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/Matrix4x4FunctionSpecification.cs | Add Matrix4x4 constructor form used by LottieGen. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/Matrix4x4CreateTranslationVector3FunctionSpecification.cs | Add Matrix4x4 translation factory support. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/Matrix4x4CreateScaleVector3FunctionSpecification.cs | Add Matrix4x4 scale factory support. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/Matrix4x4CreateFromTranslationVector3FunctionSpecification.cs | Add Matrix4x4 “CreateFromTranslation” support. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/Matrix4x4CreateFromScaleVector3FunctionSpecification.cs | Add Matrix4x4 “CreateFromScale” support. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/Matrix4x4CreateFromAxisAngleVector3FloatFunctionSpecification.cs | Add Matrix4x4 axis-angle factory support. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/Matrix3x2FunctionSpecification.cs | Add Matrix3x2 constructor form used by LottieGen. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/Matrix3x2CreateTranslationVector2FunctionSpecification.cs | Add Matrix3x2 translation factory support. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/Matrix3x2CreateSkewFloatFloatVector2FunctionSpecification.cs | Add Matrix3x2 skew factory support. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/Matrix3x2CreateScaleVector2FunctionSpecification.cs | Add Matrix3x2 scale factory support. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/Matrix3x2CreateRotationFloatFunctionSpecification.cs | Add Matrix3x2 rotation factory support. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/Matrix3x2CreateFromTranslationVector2FunctionSpecification.cs | Add Matrix3x2 “CreateFromTranslation” support. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/Matrix3x2CreateFromScaleVector2FunctionSpecification.cs | Add Matrix3x2 “CreateFromScale” support. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/LogFloatFunctionSpecification.cs | Add Log support for expression animations. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/Log10FloatFunctionSpecification.cs | Add Log10 support for expression animations. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/FloorFloatFunctionSpecification.cs | Add Floor support for expression animations. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/ExpFloatFunctionSpecification.cs | Add Exp support for expression animations. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/CosFloatFunctionSpecification.cs | Add Cos support for expression animations. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/CeilFloatFunctionSpecification.cs | Add Ceil support for expression animations. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/AtanFloatFunctionSpecification.cs | Add Atan support for expression animations. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/AsinFloatFunctionSpecification.cs | Add Asin support for expression animations. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/FunctionSpecifications/AcosFloatFunctionSpecification.cs | Add Acos support for expression animations. |
| src/Uno.UI.Composition/Composition/ExpressionAnimationParser/AnimationFunctionCallSyntax.cs | Register new expression function specifications needed by LottieGen output. |
| src/Uno.UI.Composition/Composition/ExpressionAnimation.cs | Cache parsed expression tree per instance and defer disposal until fully stopped. |
| src/Uno.UI.Composition/Composition/Compositor.cs | Add factories for Color/Path keyframe animations and add missing XML docs. |
| src/Uno.UI.Composition/Composition/CompositionVisualSurface.skia.cs | Fix clip rect height bug (was clipping Y to width). |
| src/Uno.UI.Composition/Composition/CompositionSpriteShape.skia.cs | Fix trim handling (TrimOffset + wrap semantics) and dash array access. |
| src/Uno.UI.Composition/Composition/CompositionSpriteShape.cs | Make StrokeDashArray non-null and lazily created to match WinUI behavior. |
| src/Uno.UI.Composition/Composition/CompositionShape.skia.cs | Fix transform composition order so rotation/scale apply in local space before TransformMatrix. |
| src/Uno.UI.Composition/Composition/CompositionRectangleGeometry.cs | Make Size/Offset animatable for expression animation bindings. |
| src/Uno.UI.Composition/Composition/CompositionRadialGradientBrush.cs | Make radial gradient properties animatable. |
| src/Uno.UI.Composition/Composition/CompositionPropertySet.cs | Add missing XML docs for Insert* APIs (surface parity). |
| src/Uno.UI.Composition/Composition/CompositionPathGeometry.skia.cs | Expose built SKPath for path-morphing keyframes. |
| src/Uno.UI.Composition/Composition/CompositionPathGeometry.cs | Make Path animatable for PathKeyFrameAnimation. |
| src/Uno.UI.Composition/Composition/CompositionLinearGradientBrush.cs | Make linear gradient properties animatable. |
| src/Uno.UI.Composition/Composition/CompositionGradientBrush.cs | Make gradient brush transforms animatable (Offset/CenterPoint/Scale/Rotation/TransformMatrix). |
| src/Uno.UI.Composition/Composition/CompositionGeometry.skia.cs | Fix ellipse path origin (12 o’clock) for trim semantics. |
| src/Uno.UI.Composition/Composition/CompositionColorGradientStop.cs | Make gradient stop Offset/Color animatable. |
| src/Uno.UI.Composition/Composition/CompositionAnimation.cs | Track started targets for safer teardown + support clone-on-start semantics. |
| src/Uno.UI.Composition/Composition/AnimationController.cs | Implement playback rate clamp and update docs to match WinUI semantics. |
| src/SamplesApp/SamplesApp.Samples/AnimatedVisualPlayerPlayground/GeneratedAnimationsPlayground.xaml.cs | Add sample playground page to interactively test generated animations. |
| src/SamplesApp/SamplesApp.Samples/AnimatedVisualPlayerPlayground/GeneratedAnimationsPlayground.xaml | Add XAML UI for the generated animations playground. |
| src/SamplesApp/SamplesApp.Samples/AnimatedVisualPlayerPlayground/Animations/HamburgerArrow.cs | Add LottieGen-generated sample animation (Skia-only) to exercise public Win2D surface. |
| src/AddIns/Uno.UI.Lottie/LottieVisualSourceBase.cs | Add missing XML docs; narrow internal helper visibility per intended extensibility seam. |
| src/AddIns/Uno.UI.Lottie/LottieVisualSource.reference.cs | Remove dead reference-only file that can’t compile in current build topology. |
| specs/056-animatedvisual-reconciliation/decisions.md | Add reconciliation decision log/spec notes for provenance and merge rationale. |
| build/PackageDiffIgnore.xml | Add ignore entry for removed LottieVisualSourceBase.Measure(Size) member. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
Claude finished @MartinZikmund's task in 9m 27s —— View job PR Review —
|
| # | File | Severity | Issue |
|---|---|---|---|
| 1 | Shape.cs:368 |
Performance | _shape.StrokeDashArray.Clear() forces lazy-init of CompositionStrokeDashArray for every shape that renders without dashes. Pre-PR code was _shape.StrokeDashArray = null (internal setter, InternalsVisibleTo permits it from Uno.UI); revert restores zero-allocation path. |
| 2 | PathKeyFrameAnimation.cs:109 |
Documentation | Conic morph uses only fromIt.ConicWeight(), silently discarding the to path's weight. Correct under the topology-identical invariant WinUI enforces, but the assumption is undocumented. |
Cross-cutting observations (no new inline comments; pre-existing or by design):
Given_ProgressRing_Visuals.csandGiven_Generated_Lottie.csuse file-level#if __SKIA__rather than class-level[PlatformCondition]. Acceptable here because the contained generated animation types are Skia-only and wouldn't compile on other platforms without the#ifguard.TryCreateTrimPathEffectis invoked twice perPaint()(once for fill, once for stroke), computing the same geometry values both times. Minor redundancy on the hot path; not worth fixing until profiling shows it matters.- The
Animation_StoppedLIFO assumption inAnimationControllerandCompositionAnimation.Stop()remains correct given the clone-per-target guarantee forExpressionAnimationand the start-once-per-property-owner guarantee for keyframe animations. Worth a tracked TODO if either invariant is ever relaxed. StrokeDashArrayinternal-setter-null interaction: setting it tonullvia the internal setter is safe and consistent with how_strokeDashArray is { Count: > 0 }guards in the Skia paint path. No null-deref risk.
WinAppSDK sync generator drift detected on
|
Replace the Uno.UI.Lottie add-in dependency with the LottieGen-generated ProgressRingDeterminate / ProgressRingIntdeterminate composition sources, matching WinUI. Theme colors now flow through IAnimatedVisualSource2. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013qU5HCCPxoXpvPLHzVi2BD
Cover the Composition gaps LottieGen output depends on (rectangle-geometry expression targets, mutable StrokeDashArray, quarter-trim orientation, stroke thickness by coverage integral) and add end-to-end tests plus a SamplesApp playground driving unmodified LottieGen sources. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013qU5HCCPxoXpvPLHzVi2BD
Path morphing built its result with the SKPath mutation APIs, which are obsolete-as-error on the SkiaSharp version used by this base. Build through SKPathBuilder like the rest of the Composition geometry code. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013qU5HCCPxoXpvPLHzVi2BD
The runtime tests glob the HRUnoLib folder, so once that project has been built its obj/ assembly-attribute files are compiled a second time into the test assembly (CS0579). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013qU5HCCPxoXpvPLHzVi2BD
Carries the per-unit provenance for what was taken from which branch and why, plus the public-surface audit of the port. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013qU5HCCPxoXpvPLHzVi2BD
ProgressRingDeterminate and ProgressRingIndeterminate are now ports of WinUI's own generated C++ animated visuals (controls/dev/ProgressRing/AnimatedVisuals/*.cpp) rather than Uno's LottieGen-from-JSON C# output. The WinUI visuals are built entirely from Composition primitives -- ellipse geometries with TrimStart/TrimEnd, container shapes, color brushes and key-frame/expression animations -- so they carry no Microsoft.Graphics.Canvas (Win2D) types at all. That removes the last Win2D dependency from the ProgressRing control. Both nested visuals implement IAnimatedVisual2. The C++ starts each progress-bound animation inline while building the tree; those starts are hoisted into CreateAnimations() (and mirrored in DestroyAnimations()) in the C++'s original construction order, which the lazily-created easing functions and the root progress expression depend on. TryCreateAnimatedVisual calls CreateAnimations immediately, so creation-time behavior is unchanged. Fixes the long-standing "Intdeterminate" typo in the type name; the embedded ProgressRingIntdeterminate.json asset and its FeatureConfiguration URI keep their spelling as public API. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013qU5HCCPxoXpvPLHzVi2BD
A CompositionShape composed TransformMatrix first, so Scale and RotationAngle acted in the already-transformed space. LottieGen fuses a layer's offset and scale into TransformMatrix and leaves rotation animated, so any rotating group with a translating matrix orbited the origin instead of spinning in place. The indeterminate ProgressRing drew nothing at all at progress 0.25 and 0.5, its arcs having left the visual entirely. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013qU5HCCPxoXpvPLHzVi2BD
The (Stream, long?, CancellationToken) overload of ReadAnimationJsonAsync was newly introduced by the AnimatedVisualPlayer port and was never part of the shipped contract, so protected exposed a derivation seam nothing needs. Its only call site is the sibling (IInputStream, CancellationToken) overload in the same class, which stays protected as the real extensibility seam for LoadAndObserveAnimationData overriders. Also adds the missing PackageDiffIgnore entry for the removed LottieVisualSourceBase.Measure(Size), whose seven siblings from the same legacy source-driven block already had one. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013qU5HCCPxoXpvPLHzVi2BD
Adds the 37 missing XML doc blocks identified by the public-surface audit (specs/056-animatedvisual-reconciliation/public-surface-audit.md, section 4A) across the AnimatedVisualPlayer control, its automation peer, the Lottie source base, and the Composition types the port introduced, and amends the SetElementChildVisual param doc to cover the null-clears-the-child-visual contract (section 4C). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013qU5HCCPxoXpvPLHzVi2BD
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013qU5HCCPxoXpvPLHzVi2BD
Drop the always-true platform guards now that Uno.UI.Composition is Skia-only, fix the CompositionShape comment indentation, correct the animation-sharing comments, and use PlatformCondition for the WinUI skip. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01JkdNnkD4aBrMA8WRnKZBw8
Clearing via the public getter allocated a CompositionStrokeDashArray for every dash-less shape, defeating the lazy initialization. Also document the conic-weight assumption in path morphing and the keyframe-sharing gap. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01JkdNnkD4aBrMA8WRnKZBw8
CompositionStrokeDashArray.Clear() mutates the list silently, so clearing it left the shape unrepainted. Drop the array through SetProperty instead, and stop the paint path from materializing one via the public getter. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01JkdNnkD4aBrMA8WRnKZBw8
Compositor.GetSharedCompositor is Uno-specific, so the new Given_CompositionGeometry tests failed to compile on the WinAppSDK head. Take the compositor off a loaded element's visual instead, matching the pattern already used by Given_AnimationController. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GP2BeVCQzY3sQB7QBv173u
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GP2BeVCQzY3sQB7QBv173u
ClearStrokeDashArray relied on [CallerMemberName], so SetProperty removed the context entry under "ClearStrokeDashArray" while the setter had added it under "StrokeDashArray". The stale entry made a cached, later-mutated array repaint a shape that no longer uses it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GP2BeVCQzY3sQB7QBv173u
The temporary CompositionPathGeometry built to convert a keyframe path is now disposed once its SKPath has been copied, instead of waiting on the finalizer. Paths already backed by a SkiaGeometrySource2D are adopted by reference rather than rebuilt, so those are left alone. Also aligns the keyframe lookup on the same literal form. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GP2BeVCQzY3sQB7QBv173u
Adds summaries to the geometry enums and their values, and type-level summaries to the four Win2D types this PR makes public. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GP2BeVCQzY3sQB7QBv173u
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GP2BeVCQzY3sQB7QBv173u
The Microsoft.Graphics.Canvas shim has always been internal, and every in-repo consumer of it (Uno.UI, Uno.UI.RuntimeTests, the SamplesApp heads) is covered by InternalsVisibleTo. Publishing these 10 types would be the first public Microsoft.Graphics.Canvas surface in Uno.UI.Composition, and they are slated to move to the standalone Uno Win2D repository -- shipping them public here first would make that move binary-breaking, and would collide with the same types once that package exists. The generated Lottie fixtures that use them are #if __SKIA__ only, so no customer-facing scenario depends on the public surface today. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Xn8SQpybcpmMCwFmbCzSWt
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01JYMvLUeJ6ihoSq4rKS3KfL
3e01187 to
033ddf5
Compare
|
Claude encountered an error after 1s —— View job I'll analyze this and get back to you. |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24056/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-24056/docs/index.html |
|
The build 229714 found UI Test snapshots differences: Details
|
ca89649
into
feature/breakingchanges
Master removed the Lottie .reference.cs code with unoplatform#23999/unoplatform#24056; the branch brought it back. It is excluded from the Skia-only Uno.UI build and nothing references it. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XsQppKuZgijApgJxaTZt81
GitHub Issue: closes #21176
Follow-up to #23889, which ported the
AnimatedVisualPlayercontrol itself. That port landed theplayer but not the Composition features its content depends on, so LottieGen-generated sources still
threw at runtime. This PR fills those gaps, corrects a few things in #23889, and brings
ProgressRingonto the same path.
PR Type:
✨ Feature
What changed? 🚀
Composition engine — makes generated Lottie actually run
LottieGenoutput targets the fullMicrosoft.UI.Compositionsurface. Several pieces were missing orthrew, so unmodified generated sources compiled but failed at runtime:
parser: scalar maths (
Sqrt/Sin/Cos/Tan/Asin/Acos/Atan/Ceil/Floor/Round/Mod/Log/Log10/Exp), theMatrix3x2andMatrix4x4constructors and factories, andQuaternion.CreateFromAxisAngle.ColorKeyFrameAnimationandPathKeyFrameAnimation— both were throwing[NotImplemented]stubs. Generated sources emit the first for every animated fill or stroke colour, and the second for
shape morphs.
Offset/CenterPoint/Scale/RotationAngle/TransformMatrix,start and end points, ellipse centre and radius, and gradient-stop offset and colour.
AnimationController— one controller now drives many animations, which is how generatedsources at
WinUIVersion 3.0are emitted. AddsPlaybackRatewith WinUI's documented −16..16range, and separates scrubbing a paused controller from repositioning a running one.
TrimOffsetwas ignored entirely; ellipse geometries started at 3o'clock instead of 12;
CompositionVisualSurfaceclipped its height against the width; rectanglegeometry
Size/Offsetwere not animatable;StrokeDashArrayreturned null where WinUI returns alive collection that generated code mutates directly.
A shape transform-order bug
CompositionShapecomposedTransformMatrixbeforeScaleandRotationAngle, so those acted in thealready-transformed space.
LottieGenfuses a layer's offset and scale intoTransformMatrixandleaves rotation animated, so any rotating group with a translating matrix orbited the origin instead
of spinning in place.
This was not theoretical: the indeterminate
ProgressRingdrew nothing at all at progress 0.25 and0.5, its arcs having left the visual entirely, and was clipped against the right edge at 0.75.
Confirmed by rendering frames before and after, with a regression test that fails on the old order.
ProgressRing
Now renders through generated Composition visuals ported 1:1 from WinUI's own C++
(
controls/dev/ProgressRing/AnimatedVisuals/ProgressRing{Determinate,Indeterminate}.cpp) rather thanthrough a Lottie JSON asset. Two consequences worth calling out:
ProgressRingno longer requires theUno.UI.Lottieadd-in, and no longer raisesUNOX0001.Microsoft.Graphics.Canvastypes — so thiscontrol no longer contributes a Win2D dependency. (Uno.UI as a whole is not yet Win2D-free: the 8
AnimatedIcongenerated visuals andAcrylicBrushstill use it.)The animation itself is now WinUI's: an 80×80 two-arc trim/opacity crossfade over 2s, rather than the
previous 36×36 single-arc spin. Both theme colours are still driven through
SetColorProperty, soonly geometry and timing change visibly.
Corrections to #23889
AnimationPlayconstructor (cpp:22-27) and declaresm_playDurationin the header (.h:76); the port computed a local inStart()and omitted thefield. Restored, with a recompute only when the constructor-time value was zero, since Uno resolves
animated visual sources asynchronously and a
PlayAsyncissued before the source loads wouldotherwise self-complete through the
<20msfast path. Marked// TODO Uno:.FrameworkElement.IsViewHit()repo-wide to depend onHasCompositionChildVisual. Reverted and scoped toAnimatedVisualPlayer, matching where WinUI setsits transparent background (
cpp:391-395). The general change is worth making, but on its ownevidence.
IAnimatedVisualSource's type-level[NotImplemented]guard had beenflipped from
#if falseto#if __SKIA__, tagging a working interface and firingUno0001at everyimplementor. Restored.
AnimationController.Min/MaxPlaybackRateusedfloat.MinValue/MaxValue,which made its own
Math.Clampa no-op. Set to WinUI's documented ±16.LottieVisualSource.reference.cscould never compile (the csproj isUnoRuntimeIdentifier=Skia, andUno.CrossTargetting.targetsstrips*.reference.cs).LottieVisualSourceBase.ReadAnimationJsonAsync(Stream, long?, CancellationToken)was introduced as
protectedon a public abstract class in a shipped add-in. It has a single callsite in the same class; narrowed to
private. The siblingIInputStreamoverload staysprotected,as that is the real extensibility seam.
PackageDiffIgnoreentry for the removedLottieVisualSourceBase.Measure(Size); its seven siblings from the same block already had one.<summary>blocks across the public surface the port introduced,sourced from Microsoft Learn.
Both kinds of Lottie
Neither this branch nor #23889 supports both on its own; together they do.
.jsonruntime (Skottie).jsonruntime comes from AnimatedVisualPlayer: Port WinUI implementation #23889'sUno.UI.Lottierework and is untouched here — covered byGiven_AnimatedVisualPlayer.When_Production_Lottie_Source_Loads_And_RendersandGiven_DynamicReloadedLottieAnimatedVisualSource.Given_Generated_Lottie.When_Generated_Source_Loads_And_Rendersover unmodified LottieGen output(
Watermelon,Gradient_shapes,LottieLogo2), plusProgressRingitself, which now exercises thepath in-box with no add-in at all.
Validation
Skia Desktop runtime tests,
SamplesApp.Skia.Generic:Given_AnimatedVisualPlayer+Given_ProgressRing+AnimatedVisuals— 62/62 pass, includingevery
.jsonSkottie test (When_Production_Lottie_Source_Loads_And_Renders,When_Lottie_SetSourceAsync_Completes_Source_Is_Ready,When_Real_Lottie_Source_Swaps_Uri_Player_Reloads,When_Real_Lottie_Source_Fails_Player_Shows_Fallback_Content,When_Real_Lottie_Source_Retries_Same_Uri_After_Failure_It_Loads,When_Lottie_AppData_Uri_Escapes_Its_Declared_Root_Load_Is_Blocked) and the generated-Lottie tests.Windows_UI_Xaml_Shapes— 61/70. The 9When_StrokeThickness_*failures are pre-existing;confirmed by stashing the composition change and re-running, which reproduces the identical 9.
Given_ProgressRing_Visuals, which renders the indeterminate ring atfour progress values and asserts the arcs stay on the ring. It fails on the old order (0 drawn pixels
at progress 0.25 and 0.5).
Not validated here: the WinAppSDK head (
SamplesApp.csproj) cannot build on this machine, so the newsamples have not been compiled against native WinUI — that will surface first on Windows CI.
Sequencing note for reviewers
This PR makes 10
Microsoft.Graphics.Canvastypes public inUno.UI.Compositionso unmodifiedLottieGen -Publicoutput compiles. A planned follow-up extracts them intoUno.WinUI.Graphics.Win2D. Those two must ship in the same release — landing them separately isbinary-breaking for anyone who binds to the intermediate state.
PR Checklist ✅
Screenshots Compare Test Runresults.Breaking changes
ProgressRingno longer requires theUno.UI.Lottieadd-in, and its indeterminate animation is nowWinUI's rather than Uno's previous one. Apps that replaced the ring's template or relied on the old
timing will see a visual difference.
LottieVisualSourceBase.ReadAnimationJsonAsync(Stream, long?, CancellationToken)isprivate; it wasintroduced in AnimatedVisualPlayer: Port WinUI implementation #23889 and has not shipped in a release.
AnimationController.PlaybackRatenow clamps to ±16, matching WinUI.