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

expose more of SKMatrix #2153

Closed
wants to merge 5 commits into from
Closed

expose more of SKMatrix #2153

wants to merge 5 commits into from

Conversation

mgood7123
Copy link
Contributor

@mgood7123 mgood7123 commented Jul 7, 2022

Description of Change

Bugs Fixed

  • Fixes #

API Changes

None.

Behavioral Changes

None.

Required skia PR

#2153

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

SKMatrix o;
fixed (SKMatrix* t = &this)
{
SkiaApi.sk_matrix_post_translate(&o, t, dx, dy);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it read sk_matrix_pre_translate() here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, havnt worked on it in ages

@mattleibow
Copy link
Contributor

Thanks for this PR! However, I am not sure the current SKMatrix approach is the way we want to go for 3.0.

I have been investigating this from a perf perspective and right now SKMatrix has terrible performance compared to SKMatrix44. It is about 200% slower because it has to hop the interop, and it also is deceiving because using a struct is supposed to be light, however it does expensive things.

It may even be cheaper to use Matrix4x4 under the hood. In addition to the current interop, the managed struct does not have the matrix type mask which skia uses to take shortcuts. As a result, even just passing the struct between C++ and C# causes skia to have to recalculate it. It may be better to just re-implement the whole thing in C#.

@mattleibow mattleibow closed this Mar 2, 2024
@mgood7123
Copy link
Contributor Author

mgood7123 commented Mar 5, 2024 via email

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.

3 participants