Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Uno.UI/UI/Xaml/Media/CompositionTarget.Rendering.skia.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public partial class CompositionTarget
private float _lastRasterizationScale = 1;
private static SKPath? _lastScaledNativeClipPath;

// Returned as the native-element clip path when there's no recorded frame yet. The clip path is
// borrowed read-only by hosts (never mutated or disposed), so a single shared instance is safe.
private static readonly SKPath _emptyPath = new();

// only set on the UI thread and under _frameGate, only read under _frameGate
private (IntPtr frame, SKPath nativeElementClipPath)? _lastRenderedFrame;
// only set and read under _xamlRootBoundsGate
Expand Down Expand Up @@ -155,7 +159,7 @@ private SKPath Draw(SKCanvas? canvas, Func<Size, SKCanvas> resizeFunc)

if (lastRenderedFrameNullable is not { } lastRenderedFrame)
{
return new SKPath();
return _emptyPath;
}
else
{
Expand Down
Loading