Skip to content

Commit

Permalink
fix: Properly fallback on Skia AcrylicBrush
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Feb 9, 2021
1 parent 38dcd9a commit 7451979
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Uno.UI/UI/Xaml/Controls/Border/BorderLayerRenderer.skia.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ private static IDisposable InnerCreateLayer(UIElement owner, LayoutState state)
{
adjustedArea = CreateImageLayer(compositor, disposables, borderThickness, adjustedArea, backgroundShape, adjustedArea, imgBackground);
}
else if (background is AcrylicBrush acrylicBrush)
{
Brush.AssignAndObserveBrush(acrylicBrush, color => backgroundShape.FillBrush = compositor.CreateColorBrush(color))
.DisposeWith(disposables);
}
else
{
backgroundShape.FillBrush = null;
Expand Down Expand Up @@ -197,6 +202,14 @@ private static IDisposable InnerCreateLayer(UIElement owner, LayoutState state)
{
backgroundArea = CreateImageLayer(compositor, disposables, borderThickness, adjustedArea, backgroundShape, backgroundArea, imgBackground);
}
else if (background is AcrylicBrush acrylicBrush)
{
Brush.AssignAndObserveBrush(acrylicBrush, c => backgroundShape.FillBrush = compositor.CreateColorBrush(c))
.DisposeWith(disposables);

Disposable.Create(() => backgroundShape.FillBrush = null)
.DisposeWith(disposables);
}
else
{
backgroundShape.FillBrush = null;
Expand Down

0 comments on commit 7451979

Please sign in to comment.