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

feat: add prop to configure canvasRenderingContext2DSettings #2104

Merged

Conversation

hichemfantar
Copy link
Contributor

@hichemfantar hichemfantar commented Sep 24, 2024

Why

Added the canvasRenderingContext2DSettings prop to the SpriteAnimator component in the core module

resolves #2103

What

add ability to enable willReadFrequently as recommended by https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently

Checklist

  • Ready to be merged

This commit optimizes the performance of the useSpriteLoader function by adding the 'willReadFrequently' flag to the getContext method call. This flag improves the rendering performance when reading from the canvas context. The change ensures that the getContext method is called with the 'willReadFrequently' flag set to true, which can result in faster rendering of sprite textures.
Copy link

vercel bot commented Sep 24, 2024

@hichemfantar is attempting to deploy a commit to the Poimandres Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

codesandbox-ci bot commented Sep 24, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

- Added the canvasRenderingContext2DSettings prop to the SpriteAnimator component in the core module.
@hichemfantar hichemfantar changed the title fix: stop willReadFrequently warning feat: add prop to configure canvasRenderingContext2DSettings Sep 24, 2024
@netgfx
Copy link
Contributor

netgfx commented Sep 24, 2024

@hichemfantar There are some conflicts now because I merged your other PR with the error handling, please fix them so I can merge this one as well. Thanks!

@hichemfantar
Copy link
Contributor Author

@netgfx all good!

@netgfx netgfx merged commit 7f9e6fd into pmndrs:master Sep 24, 2024
3 of 4 checks passed
@hichemfantar hichemfantar deleted the fix-canvas-2d-willReadFrequently-warning branch September 24, 2024 12:01
Copy link

🎉 This PR is included in version 9.114.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants