Skip to content
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

[release/2.x] Add some new overloads for better compat #2810

Merged
merged 2 commits into from Mar 27, 2024

Conversation

mattleibow
Copy link
Contributor

@mattleibow mattleibow commented Mar 27, 2024

Description of Change

In SkiaSharp 3.x, the overloads no longer take the SKImageFilter.CropRect and instead use a plain SKRect.

This PR adds a bunch of overloads into the 2.x series that are present in 3.x - notably the SKImageFilter.CropRect to SKRect as well as some others. CreateShader is also new and really CreatePaint is a CreateShader under the hood in C++.

For the variations of CreateMatrix with the different in overloads, I will add this back into 3.x using the mechanism in #2789

Instead of a single overload with all the default parameters, the new overloads avoid defaults so we can not require nullable structs as well as not use the CropRect class if the crop rect is not in use.

After this PR lands, libraries that want to be compatible with 3.x will need to:

  • Switch to the SKRect overloads
  • Switch to CreateShader
  • Switch to ReadOnlySpan overloads
  • Recompile to get C# to pick the correct overloads if default parameters are used

Bugs Fixed

API Changes

None.

Behavioral Changes

None.

Required skia PR

None.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Merged related skia PRs
  • Changes adhere to coding standard
  • Updated documentation

In SkiaSharp 3.x, the overloads no longer take the SKImageFilter.CropRect and instead use a plain SKRect.
@mattleibow mattleibow merged commit 214c9c0 into release/2.x Mar 27, 2024
2 checks passed
@mattleibow mattleibow deleted the dev/compat-forwards branch March 27, 2024 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant