Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Skia] feat: Implement Composition Effect system and AcrylicBrush #13812

Merged
merged 51 commits into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
757dd57
feat(composition): Initial work on Composition effects
ahmed605 Aug 30, 2023
aa7c067
feat(composition): IGraphicsEffectD2D1Interop + GraphicsEffectPropert…
ahmed605 Aug 31, 2023
545004e
feat(composition): More work on Composition effects + working sample
ahmed605 Sep 1, 2023
2273c1f
feat(composition): Implement grayscale effect + sample
ahmed605 Sep 1, 2023
82b8084
feat(composition): Implement invert effect
ahmed605 Sep 1, 2023
1b3e7e3
feat(composition): Implement HueRotationEffect and TintEffect + Samples
ahmed605 Sep 4, 2023
4bf9313
feat(composition): Implement BlendEffect, CompositeEffect, ColorSourc…
ahmed605 Sep 4, 2023
faf0efd
feat(composition): Implement ContrastEffect (+ Sample) and Arithmetic…
ahmed605 Sep 5, 2023
85b301b
feat(composition): Implement ExposureEffect + Sample
ahmed605 Sep 6, 2023
c290e67
feat(composition): Implement CrossFadeEffect + Sample
ahmed605 Sep 8, 2023
3f976ba
feat(composition): Implement LuminanceToAlphaEffect and LinearTransfe…
ahmed605 Sep 8, 2023
57bcce9
feat(composition): Implement GammaTransferEffect + Sample
ahmed605 Sep 8, 2023
429bf99
feat(composition): Implement Transform2DEffect, BorderEffect, and Sep…
ahmed605 Sep 11, 2023
93643a3
feat(composition): Implement TemperatureAndTintEffect + Sample
ahmed605 Sep 13, 2023
2f4b39d
feat(composition): Implement ColorMatrixEffect + Sample + Performance…
ahmed605 Sep 13, 2023
6a153b5
feat(composition): Implement DistantDiffuseEffect + Sample
ahmed605 Sep 15, 2023
be859be
feat(composition): Implement DistantSpecularEffect and SpotDiffuseEff…
ahmed605 Sep 15, 2023
f53b239
feat(composition): Implement SpotSpecularEffect, PointDiffuseEffect, …
ahmed605 Sep 16, 2023
aefc389
feat(composition): Implement AlphaMaskEffect and SaturationEffect + S…
ahmed605 Sep 18, 2023
3dc1fc2
feat(composition): Implement WhiteNoiseEffect + Sample + Win2D + Refa…
ahmed605 Sep 20, 2023
a375a5c
refactor(composition): Win2D effects refactor
ahmed605 Sep 20, 2023
260ebeb
feat(composition): Implement CompositionBackdropBrush
ahmed605 Sep 22, 2023
2ec862b
feat(composition): Implement AcrylicBrush!
ahmed605 Sep 24, 2023
81146cb
feat(composition): Implement property listener/updater for the Acryli…
ahmed605 Sep 24, 2023
e23366a
refactor(composition): Enable nullable accross Composition Effects cl…
ahmed605 Sep 25, 2023
59a038e
chore(composition): fix formatting issue causing build error
ahmed605 Sep 26, 2023
e11bc65
chore(composition): fix build error on WinUI
ahmed605 Sep 27, 2023
c7b6fc1
chore(composition): fix build error
ahmed605 Sep 27, 2023
58ce7db
chore(composition): Fix build error on Uno Islands
ahmed605 Sep 27, 2023
cb0cbe4
refactor(composition): use Composition constructors for CompositionEf…
ahmed605 Oct 3, 2023
a668ad0
feat(composition): re-add ArithmeticCompositeEffect + Docs
ahmed605 Oct 3, 2023
fc8d6ec
chore: added "Grayscale" as an allowed word
ahmed605 Oct 3, 2023
d98c146
refactor(composition): disable anti-aliasing by default for brushes +…
ahmed605 Oct 4, 2023
3418983
refactor(composition): disable SkSL on CPU + PR feedback
ahmed605 Oct 5, 2023
058894e
refactor(composition): refactor AcrylicBrush code + few bug fixes
ahmed605 Oct 9, 2023
0756b22
refactor(composition): PR feedback
ahmed605 Oct 13, 2023
2ef535d
refactor(composition): Make Win2D effect wrappers internal
ahmed605 Nov 16, 2023
9811da3
refactor(composition): Fix merge conflicts + Few fixes
ahmed605 Jan 23, 2024
51a4971
chore(composition): fix warnings on Composition docs page
ahmed605 Jan 23, 2024
ced60a7
chore(composition): fix build on iOS
ahmed605 Jan 24, 2024
3709238
chore(composition): Fix build on WASDK
ahmed605 Jan 24, 2024
3e11a10
chore(composition): PR feedback
ahmed605 Jan 24, 2024
f9f46e3
chore(composition): PR feedback
ahmed605 Jan 24, 2024
cfe6192
chore(composition): fix package build
ahmed605 Jan 25, 2024
94d7f6e
chore(composition): add runtime test for AcrylicBrush
ahmed605 Jan 26, 2024
2e718fb
chore(composition): fix merge error
ahmed605 Jan 26, 2024
9fedd04
chore(composition): fix runtime test build
ahmed605 Jan 26, 2024
bfed40c
chore(composition): PR feedback
ahmed605 Feb 29, 2024
3febf50
chore(composition): fix CI build issue
ahmed605 Mar 1, 2024
381a63f
docs(composition): add InteractionTracker and ExpressionAnimation in …
ahmed605 Mar 2, 2024
1b50b0a
Merge branch 'master' into ahmed605/composition-effects
ahmed605 Mar 2, 2024
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
2 changes: 2 additions & 0 deletions build/cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"Geolocation",
"globbing",
"Grial",
"Grayscale",
"Gyrometer",
"Hanja",
"hectopascals",
Expand Down Expand Up @@ -118,6 +119,7 @@
"automagically",
"bluetoothdevice",
"commandbar",
"CLSID",
"datatransfer",
"Divio's",
"emcc",
Expand Down
179 changes: 178 additions & 1 deletion doc/articles/composition.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,183 @@ This thread will also be used for [independent animations](https://learn.microso

_There are a few known issues associated with the used of the compositor thread, [make sure to read the section below](#known-issues)._

## Brush Anti-aliasing [Skia Backends]

On Skia targets (GTK and WPF), anti-aliasing is disabled by default for brushes, You can request it to be anti-aliased by setting this in your application's constructor:

```csharp
#if HAS_UNO
Uno.CompositionConfiguration.Configuration |= Uno.CompositionConfiguration.Options.UseBrushAntialiasing;
#endif
```

Or alternatively, if you want to enable all available Composition capabilities:

```csharp
#if HAS_UNO
Uno.CompositionConfiguration.Configuration = Uno.CompositionConfiguration.Options.Enabled;
#endif
```

## Implemented APIs [Skia Backends]

### Windows.UI.Composition

- [CompositionAnimation](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositionanimation)
- [CompositionBackdropBrush](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositionbackdropbrush)
- [CompositionBrush](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositionbrush)
- [CompositionCapabilities](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositioncapabilities)
- [CompositionClip](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositionclip)
- [CompositionColorBrush](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositioncolorbrush)
- [CompositionEffectBrush](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositioneffectbrush)
- [CompositionEffectFactory](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositioneffectfactory)
- [CompositionEffectSourceParameter](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositioneffectsourceparameter)
- [CompositionEllipseGeometry](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositionellipsegeometry)
- [CompositionGeometricClip](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositiongeometricclip)
- [CompositionGeometry](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositiongeometry)
- [CompositionGradientBrush](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositiongradientbrush)
- [CompositionLinearGradientBrush](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositionlineargradientbrush)
- [CompositionLineGeometry](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositionlinegeometry)
- [CompositionMaskBrush](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositionmaskbrush)
- [CompositionNineGridBrush](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositionninegridbrush)
- [CompositionObject](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositionobject)
- [CompositionPath](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositionpath)
- [CompositionPathGeometry](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositionpathgeometry)
- [CompositionPropertySet](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositionpropertyset)
- [CompositionRadialGradientBrush](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositionradialgradientbrush)
- [CompositionRectangleGeometry](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositionrectanglegeometry)
- [CompositionRoundedRectangleGeometry](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositionroundedrectanglegeometry)
- [CompositionShape](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositionshape)
- [CompositionShapeCollection](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositionshapecollection)
- [CompositionSpriteShape](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositionspriteshape)
- [CompositionSurfaceBrush](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositionsurfacebrush)
- [CompositionViewBox](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositionviewbox)
- [CompositionVisualSurface](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositionvisualsurface)
- [Compositor](https://learn.microsoft.com/uwp/api/windows.ui.composition.compositor)
- [ContainerVisual](https://learn.microsoft.com/uwp/api/windows.ui.composition.containervisual)
- [ExpressionAnimation](https://learn.microsoft.com/uwp/api/windows.ui.composition.expressionanimation)
- [InsetClip](https://learn.microsoft.com/uwp/api/windows.ui.composition.insetclip)
- [IVisualElement](https://learn.microsoft.com/uwp/api/windows.ui.composition.ivisualelement)
- [IVisualElement2](https://learn.microsoft.com/uwp/api/windows.ui.composition.ivisualelement2)
- [RectangleClip](https://learn.microsoft.com/uwp/api/windows.ui.composition.rectangleclip)
- [RedirectVisual](https://learn.microsoft.com/uwp/api/windows.ui.composition.redirectvisual)
- [ShapeVisual](https://learn.microsoft.com/uwp/api/windows.ui.composition.shapevisual)
- [SpriteVisual](https://learn.microsoft.com/uwp/api/windows.ui.composition.spritevisual)
- [Visual](https://learn.microsoft.com/uwp/api/windows.ui.composition.visual)
- [VisualCollection](https://learn.microsoft.com/uwp/api/windows.ui.composition.visualcollection)

### Windows.UI.Composition.Interactions

- [InteractionTracker](https://learn.microsoft.com/uwp/api/windows.ui.composition.interactions.interactiontracker)
- [VisualInteractionSource](https://learn.microsoft.com/uwp/api/windows.ui.composition.interactions.visualinteractionsource)

### Windows.Graphics.Effects

- [IGraphicsEffectSource](https://learn.microsoft.com/uwp/api/windows.graphics.effects.igraphicseffectsource)

### Windows.Graphics.Effects.Interop

- [IGraphicsEffectD2D1Interop](https://learn.microsoft.com/en-us/windows/win32/api/windows.graphics.effects.interop/nn-windows-graphics-effects-interop-igraphicseffectd2d1interop)

### Microsoft.Graphics.Canvas.Effects (Win2D/Composition Effects)

- [AlphaMaskEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_AlphaMaskEffect.htm)
- [ArithmeticCompositeEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_ArithmeticCompositeEffect.htm)
- [BlendEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_BlendEffect.htm)
- [BorderEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_BorderEffect.htm)
- [ColorMatrixEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_ColorMatrixEffect.htm)
- [ColorSourceEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_ColorSourceEffect.htm)
- [CompositeEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_CompositeEffect.htm)
- [ContrastEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_ContrastEffect.htm)
- [CrossFadeEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_CrossFadeEffect.htm)
- [DistantDiffuseEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_DistantDiffuseEffect.htm)
- [DistantSpecularEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_DistantSpecularEffect.htm)
- [ExposureEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_ExposureEffect.htm)
- [GammaTransferEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_GammaTransferEffect.htm)
- [GaussianBlurEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_GaussianBlurEffect.htm)
- [GrayscaleEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_GrayscaleEffect.htm)
- [HueRotationEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_HueRotationEffect.htm)
- [InvertEffectEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_InvertEffect.htm)
- [LinearTransferEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_LinearTransferEffect.htm)
- [LuminanceToAlphaEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_LuminanceToAlphaEffect.htm)
- [Matrix5x4](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_Matrix5x4.htm)
- [OpacityEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_OpacityEffect.htm)
- [PointDiffuseEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_PointDiffuseEffect.htm)
- [PointSpecularEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_PointSpecularEffect.htm)
- [SaturationEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_SaturationEffect.htm)
- [SepiaEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_SepiaEffect.htm)
- [SpotDiffuseEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_SpotDiffuseEffect.htm)
- [SpotSpecularEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_SpotSpecularEffect.htm)
- [TemperatureAndTintEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_TemperatureAndTintEffect.htm)
- [TintEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_TintEffect.htm)
- [Transform2DEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_Transform2DEffect.htm)

Note that while Uno Platform implements these effects and [their Win2D wrappers](https://github.com/unoplatform/uno/tree/master/src/Uno.UI.Composition/Win2D/Microsoft/Graphics/Canvas/Effects), the Win2D wrappers are still internal and not exposed to users, but the effects can still be used by temporary implementing the [IGraphicsEffectD2D1Interop](https://learn.microsoft.com/en-us/windows/win32/api/windows.graphics.effects.interop/nn-windows-graphics-effects-interop-igraphicseffectd2d1interop) interface manually until the Win2D wrappers become public, like for example the [GaussianBlurEffect](https://microsoft.github.io/Win2D/WinUI2/html/T_Microsoft_Graphics_Canvas_Effects_GaussianBlurEffect.htm) can be implemented like this:

```csharp
#nullable enable

using System;
using Windows.Graphics.Effects;
using Windows.Graphics.Effects.Interop;

internal class GaussianBlurEffect : IGraphicsEffect, IGraphicsEffectSource, IGraphicsEffectD2D1Interop
{
private string _name = "GaussianBlurEffect";
private Guid _id = new Guid("1FEB6D69-2FE6-4AC9-8C58-1D7F93E7A6A5");

public string Name
{
get => _name;
set => _name = value;
}

public IGraphicsEffectSource? Source { get; set; }

public float BlurAmount { get; set; } = 3.0f;

public Guid GetEffectId() => _id;

public void GetNamedPropertyMapping(string name, out uint index, out GraphicsEffectPropertyMapping mapping)
{
switch (name)
{
case nameof(BlurAmount):
{
index = 0;
mapping = GraphicsEffectPropertyMapping.Direct;
break;
}
default:
{
index = 0xFF;
mapping = (GraphicsEffectPropertyMapping)0xFF;
break;
}
}
}

public object? GetProperty(uint index)
{
switch (index)
{
case 0:
return BlurAmount;
default:
return null;
}
}

public uint GetPropertyCount() => 1;
public IGraphicsEffectSource? GetSource(uint index) => Source;
public uint GetSourceCount() => 1;
}
```

The GUID used in the example above is the Effect CLSID of the [Direct2D Gaussian Blur Effect](https://learn.microsoft.com/windows/win32/direct2d/gaussian-blur). For a list of built-in Direct2D effects and their corresponding CLSIDs, see [Direct2D Built-in Effects](https://learn.microsoft.com/windows/win32/direct2d/built-in-effects).

## Known issues

* When using the compositor thread, the native ripple effect of Android (used in native buttons) does not work.
- [Android] When using the compositor thread, the native ripple effect of Android (used in native buttons) does not work.

- [Skia Backends] Some Composition effects don't render properly (or at all) on software rendering (CPU), to check if Uno is running on the software rendering (CPU) or the hardware rendering (GPU), you can call `CompositionCapabilities.GetForCurrentView().AreEffectsFast()`.
19 changes: 10 additions & 9 deletions doc/articles/features/shapes-and-brushes.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,15 @@ Notes:

## Implemented Brushes / Properties

| Brush | Android | iOS | macOS | Wasm | |
| ---------------------------------- | ------- | ------- | ------- | ---- | -------------------------------------------------------------------------------------------------------------------------- |
| `AcrylicBrush` | Yes (3) | Yes (3) | Yes (3) | Yes | [Documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.acrylicbrush) |
| `ImageBrush` | Yes (1) | Yes (1) | | No | [Documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.imagebrush) |
| `LinearGradientBrush` | Yes (2) | Yes (2) | Yes | Yes | [Documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.lineargradientbrush) |
| `RadialGradientBrush` (WinUI 2.4+) | Yes | Yes | Yes | Yes | [Documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.radialgradientbrush) |
| `RevealBrush` (WinUI 2.0+) | No | No | No | No | [Documentation](https://learn.microsoft.com/windows/winui/api/microsoft.ui.xaml.media.revealbrush) |
| `SolidColorBrush` | Yes | Yes | Yes | Yes | [Documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.solidcolorbrush) |
| Brush | Android | iOS | macOS | Wasm | GTK/WPF | |
| ---------------------------------- | ------- | ------- | ---- | ------------------------------------------------------------ | ---------------------------------- |
| `AcrylicBrush` | Yes (3) | Yes (3) | Yes (3) | Yes | Yes | [Documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.acrylicbrush) |
| `ImageBrush` | Yes (1) | Yes (1) | | No | Yes | [Documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.imagebrush) |
| `LinearGradientBrush` | Yes (2) | Yes (2) | Yes | Yes | Yes | [Documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.lineargradientbrush) |
| `RadialGradientBrush` (WinUI 2.4+) | Yes | Yes | Yes | Yes | Yes | [Documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.radialgradientbrush) |
| `RevealBrush` (WinUI 2.0+) | No | No | No | No | No | [Documentation](https://learn.microsoft.com/windows/winui/api/microsoft.ui.xaml.media.revealbrush) |
| `SolidColorBrush` | Yes | Yes | Yes | Yes | Yes | [Documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.solidcolorbrush) |
| `XamlCompositionBrushBase` | No | No | No | No | Yes | [Documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.xamlcompositionbrushbase) |

Notes:

Expand All @@ -64,7 +65,7 @@ Notes:

## AcrylicBrush

Uno Platform supports the `Backdrop` version of `AcrylicBrush` (blurring in-app content behind element) on all targets except GTK and WPF. In addition, on macOS we support the `HostBackdrop` acrylic (blurring content behind the app window).
Uno Platform supports the `Backdrop` version of `AcrylicBrush` (blurring in-app content behind element) on all targets. In addition, on macOS we support the `HostBackdrop` acrylic (blurring content behind the app window).

The brush currently has an important limitation on Android, iOS, and macOS: it can be used **only on elements which have no children**. Eg., if you wanted to have an acrylic effect in the background of a `Grid` with child content, then you would add a `Border` with no inner child behind the other content in the `Grid` and set the acrylic background on the `Border`, rather than set it directly on the `Grid`:

Expand Down
Binary file added src/SamplesApp/UITests.Shared/Assets/LightMap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/SamplesApp/UITests.Shared/Assets/Uno50x50.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/SamplesApp/UITests.Shared/Assets/WinUI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions src/SamplesApp/UITests.Shared/ItemExclusions.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
<Compile Remove="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\WebView\**" />
<None Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\WebView\**" />

<Page Remove="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Media\AcrylicBrushTests\**" />
<Compile Remove="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Media\AcrylicBrushTests\**" />
<None Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Media\AcrylicBrushTests\**" />

<Page Remove="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Media\BrushesTests\**" />
<Compile Remove="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Media\BrushesTests\**" />
<None Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Media\BrushesTests\**" />
Expand Down
Loading
Loading