Repository navigation
Description
GitHub Issue: n/a
Current behavior
With the WebGPU drawing backend, a translucent AcrylicBrush (here AcrylicInAppFillColorDefaultBrush) over colourful content renders as a dark, nearly flat grey with only a faint hint of the colours behind it. The backdrop is blurred, but the blurred colours are lost. With the default Skia backend the same XAML shows a saturated, blurred version of the shapes behind the panel.
Verified at runtime on Windows desktop (net10.0-desktop SamplesApp, master 0599dad) by screenshot: default backend vs UNO_WEBGPU=1.
Expected behavior
Acrylic should look the same on both backends: blur, then a Luminosity blend with the luminosity colour, then a Color blend with the tint colour (the effect tree AcrylicMaterialBrush builds). WinUI acrylic keeps the hue of the content behind it.
How to reproduce it
- Build
SamplesAppfornet10.0-desktop(it references the WebGPU backend by default). - Add a sample page with this content:
<Grid Background="White" Width="600" Height="300">
<Rectangle Width="200" Height="200" Fill="Red" HorizontalAlignment="Left" Margin="40,40,0,0" VerticalAlignment="Top" />
<Ellipse Width="200" Height="200" Fill="Blue" HorizontalAlignment="Left" Margin="200,60,0,0" VerticalAlignment="Top" />
<Rectangle Width="200" Height="200" Fill="Green" HorizontalAlignment="Left" Margin="360,40,0,0" VerticalAlignment="Top" />
<Border Width="520" Height="100" Margin="40,100,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"
Background="{ThemeResource AcrylicInAppFillColorDefaultBrush}" />
</Grid>- Run it with no env var: the panel shows saturated red/blue/green blurred together.
- Run it with
UNO_WEBGPU=1: the panel is a dark grey with barely visible tint.
Workaround
None known. AlwaysUseFallback gives a flat colour on both backends.
Works on UWP/WinUI
Yes, hue-preserving blurred acrylic.
Environment
Skia Desktop (Win32), WebGPU backend, master 0599dad.
Anything else
Root cause (confirmed by reading the source, matching the runtime result):
AcrylicMaterialBrushbuildsBlend(Blend(Blur(backdrop), lum, Luminosity), tint, Color). Skia applies both blend modes viaSkiaDrawingSession.- The WebGPU effect lowering throws the blend modes away:
WebGpuDrawingFactory.Effects.csWalkonly records the two colours (LumColor,Color) and the blur sigma. - The acrylic shader then does
mix(blurred.rgb, tint.rgb, tint.a)(a SrcOver) instead of the Luminosity blend, andDrawBackdropTintdraws the tint as another SrcOver rect instead of a Color blend. The generic blend shader in the same file already implements modes 25 (Color) and 26 (Luminosity), so they are not wired to the acrylic path. - Noise is also a procedural hash (
Noise = 0.02f) rather than the acrylic noise texture, and the docs list the noise texture and rounded-corner mask as open gaps for translucent acrylic (doc/uno-drawing-backend-abstraction.md, "Parity gaps").
Suggested fix: apply Luminosity then Color blend (with the existing setLum/setSat helpers) in the acrylic composite instead of SrcOver mixes.
Activity
fix(webgpu): Blend acrylic in Luminosity and Color modes