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 willReadFrequently to 2d canvas contexts, where appropriate. #6084

Merged
merged 4 commits into from
Mar 24, 2022
Merged

Add willReadFrequently to 2d canvas contexts, where appropriate. #6084

merged 4 commits into from
Mar 24, 2022

Conversation

junov
Copy link
Contributor

@junov junov commented Jan 19, 2022

This change adds the willReadFrequently:true 2d context creation
attribute to call sites where canvases will be read from (i.e
getImageData or toDataURL). This is a performance hint that tells
the browser to optimize for readbacks.

See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently

The new API will soon be launched in chromium-based web browsers.

The objective of this change is to optimize performance and prevent
possible performance regressions when this new feature is launched
by major web browser in the near future.

junov added 2 commits January 19, 2022 13:48
This chang add the willReadFrequently:true 2d context creation
attribute to call sites where canvases will be read from (i.e
getImagData or toDataURL).  This is a performance hint that tells
the browser to optimize for readbacks.

See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently

The new API will soon be launched in chromium-based web browsers.

The objective of this change is to optimize performance and prevent
possible performance regressions when this new feature is launched
by major web browser in the near future.
@archmoj archmoj added community community contribution status: reviewable labels Mar 23, 2022
@archmoj
Copy link
Contributor

archmoj commented Mar 23, 2022

Thanks very much for the PR!
Looking good to me.
cc: @alexcjohnson

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

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

Thanks @junov - and @archmoj if you’re happy I’m happy 💃

@secretwpn
Copy link

Hi. I'm still getting browser warning about missing willReadFrequently hint in plotly 2.33.0
It looks like this is coming from regl-splom funciton getPad(...)

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

Successfully merging this pull request may close these issues.

4 participants