Skip to content

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

Merged
mattleibow merged 2 commits into
release/2.xfrom
dev/compat-forwards
Mar 27, 2024
Merged

[release/2.x] Add some new overloads for better compat#2810
mattleibow merged 2 commits into
release/2.xfrom
dev/compat-forwards

Conversation

@mattleibow

@mattleibow mattleibow commented Mar 27, 2024

Copy link
Copy Markdown
Contributor

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.
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.

1 participant