private ICompositionBrush CreateMicaBackdropBrush() { if (Win32Platform.WindowsVersion.Build < 22000) { return(null); } using var compositorWithBlurredWallpaperBackdropBrush = _compositor.QueryInterface <ICompositorWithBlurredWallpaperBackdropBrush>(); using var blurredWallpaperBackdropBrush = compositorWithBlurredWallpaperBackdropBrush?.TryCreateBlurredWallpaperBackdropBrush(); using var micaBackdropBrush = blurredWallpaperBackdropBrush?.QueryInterface <ICompositionBrush>(); return(micaBackdropBrush.CloneReference()); }
public WinUICompositorConnection(EglPlatformOpenGlInterface gl, object pumpLock) { _gl = gl; _pumpLock = pumpLock; _syncContext = _gl.PrimaryEglContext; _angle = (AngleWin32EglDisplay)_gl.Display; _compositor = NativeWinRTMethods.CreateInstance <ICompositor>("Windows.UI.Composition.Compositor"); _compositor2 = _compositor.QueryInterface <ICompositor2>(); _compositor5 = _compositor.QueryInterface <ICompositor5>(); _compositorInterop = _compositor.QueryInterface <ICompositorInterop>(); _compositorDesktopInterop = _compositor.QueryInterface <ICompositorDesktopInterop>(); using var device = MicroComRuntime.CreateProxyFor <IUnknown>(_angle.GetDirect3DDevice(), true); _device = _compositorInterop.CreateGraphicsDevice(device); _blurBrush = CreateBlurBrush(); }