-
Notifications
You must be signed in to change notification settings - Fork 538
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
.NET MAUI and/or WinUI 3 SKGLView
is not transparent
#2871
Comments
This is most likely because SwapChainPanel does not support transparency: https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/composition SKGLView uses it on MAUI Windows. |
Indeed this is not a bug but unfortunately by design as windows GL hardware-accelerated view cannot be transparent. |
This is surely the limitation of the WinUI 3 composition engine, because WinUI 2 and UWP supported transparent backgrounds for swap chains. |
Would you be able to make a feature request for the WinUI3 team to add support for transparency? Without transparency, Windows SKGLView is pretty useless. Both Android and iOS support transparency for SKGLView. If transparency worked in WinUI2, I don't see why it would be impossible to implement for WinUI3. |
It's already been done here: microsoft/microsoft-ui-xaml#5025 It's a long standing issue requested by many users already. |
A similar thread is here: |
An interesting thing is that some of the use-cases, such as a transparent WebView2 over a MediaPlayerElement, could be done with the current composition engine, if there were a way to activate transparency for external content that is over other external content. |
Well, we all would sure want to render an accelerated canvas over a usual MAUI content, so.. Not until we have a different backend for WinUI what would be close to a miracle. =) |
SKGLView
does not support a transparent background
SKGLView
does not support a transparent backgroundSKGLView
is not transparent
Maybe this PR will expose Direct3D and then we can add a new D3D view to be used as a backing element: Anyone that can help test or review will make things go faster. Also, if there are any folks that know how to hook up the WinUI + Direct3D + Composition, then please feel very free to help in any way. |
SKGLView
is not transparentSKGLView
is not transparent
I'm not sure how we could best help here, but at least we could test new views, if they are available as a NuGet package for .NET MAUI on Windows. |
Here's an example in C++ how to make a transparent DirectX SwapChainPanel: Info from here: microsoft/microsoft-ui-xaml#9684 (reply in thread) |
Description
SKGLView always draws an opaque gray background instead of a transparent background when specified to be transparent. SKCanvasView works fine.
Code
https://github.com/hyvanmielenpelit/GnollHack
Expected Behavior
Both SKGLView and SKCanvasView draw a transparent background upon
canvas.Clear()
.Actual Behavior
SKCanvasView draws a transparent background upon
canvas.Clear()
but SKGLView draws an opaque gray background.Version of SkiaSharp
3.x (Alpha)
Last Known Good Version of SkiaSharp
Other (Please indicate in the description)
IDE / Editor
Visual Studio (Windows)
Platform / Operating System
Windows
Platform / Operating System Version
Windows 11 Home, version 10.0.22631
Devices
Micro-Star International Co., Ltd. Pulse GL66 11UDK
Relevant Screenshots
Relevant Log Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: