-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Make Avalonia.Skia compatible with both SkiaSharp 2.88 and 3.0 #14510
Conversation
You can test this PR using the following package version. |
@mattleibow hi! IIRC there was a document that tracks all breaking changes between 2.88 and 3.0 but can't find it now. Do you still have it? |
You can test this PR using the following package version. |
If anybody want/can test these packages in your apps with updated SkiaSharp to 3.0 previews, I would appreciate help with testing. Before agreeing on this approach with reusing the same Avalonia.Skia assembly, I want to know if it really works on majority of apps at least. |
I think this file and sibling files: https://github.com/mono/SkiaSharp/blob/main/changelogs/SkiaSharp/3.0.0/SkiaSharp.humanreadable.md |
If there are some APIs that are used and it is simple to add back, we can maybe add them back into SkiaSharp. I am hoping to ease the treansition if possible, but not at the cost of complex code/hacks. So, depending on what you need, I can potentially add some apis into 2.x or back into 3.x. Can't promise, but some easy wins to reduce breaks is nice to have. |
You can test this PR using the following package version. |
We don't need that reflection after we use builds with this PR included mono/SkiaSharp#2756
|
You can test this PR using the following package version. |
345b615
to
da16fd4
Compare
You can test this PR using the following package version. |
You can test this PR using the following package version. |
You can test this PR using the following package version. |
What does the pull request do?
We have a very little choice but try to sit on both chairs with SkiaSharp. Otherwise, Avalonia is going to be locked on 2.88 version until 12.0 release which won't happen this year.
For the most part SkiaSharp 3.0 is binary compatible with SkiaSharp 2.88. But not 100%, so it still breaks Avalonia rendering backend.
Ideally, my approach with this PR and that compat is general is something like this:
If we are running on 3.0 and .NET 7 or lower - try to call reflectionEDIT: just throw.Note: this PR doesn't attempt to use SKSamplingOptions instead of old deprecated API as it was done in #12729. In other words, we will use deprecated API until Avalonia fully migrates to 3.0 as a minimum version.
What's tested so far: