Add support for WinUI 3 - #1458
Conversation
| @@ -0,0 +1,28 @@ | |||
| <Project Sdk="Microsoft.NET.Sdk"> | |||
There was a problem hiding this comment.
@azchohfi is there an easier way to multi-target this project with the 'UWP' WinUI file above?
There was a problem hiding this comment.
You could just multi-target, but the whole structure for SkiaSharp is already like this for every single other target, so I believe it makes sense to keep it this way.
There was a problem hiding this comment.
Oh, now I noticed what happened. @mattleibow, version 2.1.2 of MSBuild.Sdk.Extras added support for net5.0 TFMs, so you could, if you want to, merge the SkiaSharp.Views.WinUI.csproj and SkiaSharp.Views.WinUI.UWP.csproj .
There was a problem hiding this comment.
Oh, yay! I'll do that. I didn't see the shiny new update!
There was a problem hiding this comment.
Seems I am still getting errors on the restore, but this is MSBuild/NuGet issues because I don't think the restore process supports the conditionals. In my case, I had the WinUI project that depends on either SkiaSharp.UWP and SkiaSharp projects depending on which TFM was selected.
I need to actually do a full multi-targeting setup here. The reason I didn't before was due to VSMac having issues and VSWin not working properly - but this is most likely fixed since I started this when multi-targeting was hot off the press.
I'm going to keep it 2 projects for now, and then start some research into multi-targeting in a new PR. This time with new build tools and IDEs.
|
@mattleibow I was educated by my team that this issue prevents switching our Platform UNO solution to WinUI 3 (we're using SkiaSharp rendering massively). Is there any ETA yet? @jeromelaban FYI |
|
@DierkDroth thanks. As mentioned in the Uno issue, WinUI 3.0 is not required yet. WinUI 2.x can be used at this point. |
|
@jeromelaban sorry, I'm still lost. Let me ask you this: how would a WinUI 3 TabView host a SkiaSharp chart? |
The TabView control is available in WinUI 2.x and is available starting in Uno 3.1, there is no need for WinUI 3.0 at this point. |
|
Thanks @jeromelaban. This seems to be a viable work around |
|
@mattleibow might some preview of this ship soon? Have been extracting stuff from this PR to try but that seems like it would be a bit more painful for the GL surfaces. |
|
@mattleibow btw, the IBufferByteAccess binding doesn't work in WinUI preview 3, I was able to make it work again by comparing against the wincsrt codebase for IBufferByteAccess, maybe they could add an easier way to grab that interface? Or maybe they did already, didn't search too long. |
|
@gmurray81 I seem to be running into the same error:
Could you tell me what you changed to make it work again? |
|
I have updated a few things. The WinUI sample is running again. The implementation for Win32 is a tad bit different due to some UWP APIs not existing/implemented. The GPU views might take longer because ANGLE does not support WinUI and there appears to be know immediate plans to add it: microsoft/microsoft-ui-xaml#2558 Once things are building, I can release a preview package on the preview feed for people to try out. |
|
🦙 Seems like the Angle work has moved to Google and their discussion was placed here. (Though still that it's not in plans, but that was 8 months ago.) FYI @stmoy |
|
Is ANGLE necessary for the Win32 version of WinUI? In theory you should be able to call OpenGL directly when not confined to the UWP sandbox. |
|
@mattleibow thanks for your work!!!! Is there is any guess when pre release package with WinUI support would be possible to download? Also question would be package with name SkiaSharp.Views.Uno.WinUI ? :) |
# Conflicts: # binding/SkiaSharp/SkiaSharp.csproj # samples/Basic/WinUI/Desktop/SkiaSharpSample.Package/Package.appxmanifest # samples/Basic/WinUI/Desktop/SkiaSharpSample.Package/SkiaSharpSample.Package.wapproj # samples/Basic/WinUI/Desktop/SkiaSharpSample.sln # samples/Basic/WinUI/Desktop/SkiaSharpSample/App.xaml.cs # samples/Basic/WinUI/Desktop/SkiaSharpSample/MainWindow.xaml # samples/Basic/WinUI/Desktop/SkiaSharpSample/MainWindow.xaml.cs # samples/Basic/WinUI/Desktop/SkiaSharpSample/SkiaSharpSample.csproj # scripts/azure-pipelines.yml # scripts/azure-templates-bootstrapper.yml # source/SkiaSharp.Views.WinUI/SkiaSharp.Views.WinUI/SkiaSharp.Views.WinUI.csproj # source/SkiaSharp.Views/SkiaSharp.Views.Shared/Extensions.cs # source/SkiaSharp.Views/SkiaSharp.Views.Shared/GlesInterop/Gles.cs # source/SkiaSharp.Views/SkiaSharp.Views.UWP/AngleSwapChainPanel.cs # source/SkiaSharp.Views/SkiaSharp.Views.UWP/GlesInterop/GlesContext.cs # source/SkiaSharp.Views/SkiaSharp.Views.UWP/Interop/IBufferByteAccess.cs # source/SkiaSharp.Views/SkiaSharp.Views.UWP/Interop/PropertySetExtensions.cs # source/SkiaSharp.Views/SkiaSharp.Views.UWP/SKSwapChainPanel.cs # source/SkiaSharp.Views/SkiaSharp.Views.UWP/SKXamlCanvas.cs # source/SkiaSharp.Views/SkiaSharp.Views.UWP/UWPExtensions.cs # source/SkiaSharpSource.Windows.sln # source/SkiaSharpSource.sln
|
I pushed out a preview package (SkiaSharp.Views.WinUI) to This is just the |
|
Awesome! Thanks :) |
|
@mattleibow is there is any plans to have compatible version of SkiaSharp.Views.WinUI with UWP and UNO? |
|
@MaksimNikonovOrioninc yes there are plans to make this support work for the Uno.WinUI packages. I will be in a separate PR, though. |
|
Closing this as we got WinUI support for Desktop/Win32 a few releases back, but now stable. Additional things
|
|
@mattleibow what about the GPU support for WinUI3? Separate task? Giving up on it due to the lack of Angle support? Is he implying here that it should be supportable with the current stuff in Angle? https://groups.google.com/g/angleproject/c/oq7JU0StLCs/m/IoaPPVapBAAJ |
Description of Change
Bugs Fixed
Known Issues
API Changes
Behavioral Changes
PR Checklist