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

Conversation

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 Jan 19, 2022
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.
src/traces/image/plot.js Outdated Show resolved Hide resolved
draftlogs/6084_change.md Outdated Show resolved Hide resolved
@archmoj
Copy link
Contributor

@archmoj archmoj commented Mar 23, 2022

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

@archmoj archmoj requested review from antoinerg and alexcjohnson Mar 23, 2022
Copy link
Contributor

@alexcjohnson alexcjohnson left a comment

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

@archmoj archmoj merged commit 9c0ceb9 into plotly:master Mar 24, 2022
1 check passed
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.

None yet

3 participants