Skip to content

Properly sending skia-canvas' buffer to other windowing program #227

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

Open
ajitid opened this issue Apr 20, 2025 · 0 comments
Open

Properly sending skia-canvas' buffer to other windowing program #227

ajitid opened this issue Apr 20, 2025 · 0 comments

Comments

@ajitid
Copy link

ajitid commented Apr 20, 2025

Warning: Just thought that it is important to mention that the SVG file using in the repro contains anime and can be potentially NSFW. This ticket is not a troll, and the image is taken from an example in another library that performs the same function as skia-canvas.

When I resize my SDL window it reduces FPS a lot when SVG is loaded. Haven't check if this applies to other image formats as well.

To reproduce:

  1. Clone this repository
  2. Install dependencies using bun install
  3. Run the program using bun run main.ts

When the window opens, I see ~40 FPS. When extend the size of the window, it reduces to ~24 FPS. I tried with @napi-rs/canvas as well, and with that library I'm always getting ~60 FPS.

If you want to compare, I have also created a branch which runs same code in @napi-rs/canvas which you can find here.

I tried skia-canvas' own Window, and I'm getting ~60FPS there. But I'm not able to figure out how to draw exactly as in the examples above where the things I'm draw don't scale when window is resized.

I'm not sure if something like this is at play here.

@ajitid ajitid changed the title Scaling window reduces FPS a lot when SVG is loaded Properly sending skia-canvas' buffer to other windowing program Apr 21, 2025
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

No branches or pull requests

1 participant