-
Notifications
You must be signed in to change notification settings - Fork 107
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
SkXamlCanvas crashes with new prerelease packages #1645
Comments
I assume the exception call stack is after a |
@mattleibow FYI work needs to be done in SkiaSharp to support WinUI changes. |
@charlesroddie I fixed the issue in mono/SkiaSharp#2920. You can try out the artifacts here by downloading the Ignore the failure, the tests are a bit flakey... @manodasanW my fix is to just skip all the manual interop code and do it in C++. I am not sure if you know if this code is going to cause any issues: https://github.com/mono/SkiaSharp/pull/2920/files intptr_t BufferExtensions::GetByteBuffer(IBuffer const& buffer)
{
byte* current_data = nullptr;
auto bufferByteAccess = buffer.as<winrt::impl::IBufferByteAccess>();
bufferByteAccess->Buffer(¤t_data);
return (intptr_t)current_data;
} But, one thing that I noticed is that it uses a lot of new code which only exists in the very latest WinRT.Runtime.dll. And this as far as I can tell is a viral dependency meaning that if I use this new version, all things that depend on SkiaSharp will also need this. I tried to copy some of the new code from all over, but several of the types and members are internal and it got crazy fast. Another thing that I try and do is make sure I use the WinRT.Runtime that the SDK uses so I don't have to force all users of SkiaSharp to update things. @manodasanW when do you think this new version of WinRT.Runtime will be the version used by the .NET SDK? When I say "used" I mean the version included by default here: https://github.com/dotnet/sdk/blob/main/eng/ManualVersions.props As of right now it is still .31 Since that is still preview and SkiaSharp is stable, I cannot really depend on it for SkiaSharp 2.x. However, the 2.x branch does not have the convenient native library that I can use. I technically can add it to 2.x but that is a lot of work, and that old branch is very iffy to build. So, at this point @charlesroddie, are there any technical reasons why you are unable to use the 3.0 versions besides the fact it is not stable yet? |
We can test on 3.0. We'd just need to stub out Svg.Skia which is waiting for release to be 3.0-compatible. I think going all-in on 3.0 makes sense. |
We expect to update the .NET SDK with the new AOT compatible version pretty soon aligned with WinAppSDK stable. Given this has been addressed by the other project, closing this issue. |
Putting an SkXamlCanvas in a WinUI app crashes with the new prerelease packages.
We are trying to test NativeAOT in WinUI for our app, which is built in SkiaSharp.
We are using SkXamlCanvas because hardware accelerated support for SkiaSharp views in WinUI aren't released yet.
We get the exception:
Reproduction:
https://github.com/charlesroddie/WinUITemplate/tree/SkXamlCanvas
Is this a CsWinRT issue or a Skiasharp issue?
Version info:
Two trim warnings are produced in release mode, but the crash happens in debug (non-aot) and release (nativeaot):
The text was updated successfully, but these errors were encountered: