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

[SKIA] Don't re-create SKImage on every WriteableBitmap draw call #18164

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

kekekeks
Copy link
Member

There previously was SKCanvas::drawBitmap method, but it apparently got removed around 2021. That method was properly tracking SKBitmap pixel data versioning that we've been reporting via SKBitmap::notifyPixelsChanged, so a bitmap would only uploaded to GPU once per change if it would fit into gpu memory allowance.

SkiaSharp have silently added a shim that would just re-create an SKImage instance on every draw call.

This PR caches an SKImage instance.

Note that it technically increases the system RAM usage.

@kekekeks kekekeks added bug backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch labels Feb 10, 2025
@maxkatz6 maxkatz6 added this pull request to the merge queue Feb 10, 2025
Merged via the queue into master with commit ead6ac8 Feb 11, 2025
12 checks passed
@maxkatz6 maxkatz6 deleted the fixes/skia-writeable-bitmap-perf branch February 11, 2025 00:16
@maxkatz6 maxkatz6 added backported-11.2.x and removed backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch labels Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants