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

Add more SKPicture APIs #2883

Merged
merged 8 commits into from
Jun 3, 2024
Merged

Add more SKPicture APIs #2883

merged 8 commits into from
Jun 3, 2024

Conversation

mattleibow
Copy link
Contributor

@mattleibow mattleibow commented Jun 1, 2024

Description of Change

Adding a few new APIs to help with determining picture and drawable "size" as well as adding the Playback method to SKPicture.

The playback method is different to draw in that draw results in a single "draw the picture" command, but playback effectively replicates what was done to create the picture. There is a small different to the latter in that the picture may optimize/combine commands as well as split commands to best fit into the picture's storage.

Bugs Fixed

API Changes

class SKDrawable {
   public int ApproximateBytesUsed { get; }
}

class SKPicture {
  public int ApproximateBytesUsed { get; }
  public int ApproximateOperationCount { get; }
  public int GetApproximateOperationCount(bool includeNested);
  public void Playback(SKCanvas canvas);
}

Behavioral Changes

None.

Required skia PR

mono/skia#127

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

@mattleibow mattleibow merged commit c629919 into main Jun 3, 2024
1 of 2 checks passed
@mattleibow mattleibow deleted the dev/picture branch June 3, 2024 15:15
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.

[FEATURE] Introduce SKPicture.Playback()
1 participant