[Feature Request] Enable 'willReadFrequently' on html5 canvas
See original GitHub issueIs your feature request related to a problem? Please describe. Scanning performance can possibly be improved by providing a hint to the web browser about intended usage
Describe the solution you’d like See this spec
// Javascript example
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d', {willReadFrequently: true});
this would (probably) apply to https://github.com/mebjas/html5-qrcode/blob/master/third_party/zxing-js.umd.js
Originally developed for games, but high frequency fps scans could also benefit from this
Describe alternatives you’ve considered It’s a trivial performance enhancement
Additional context
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
"canvas" | Can I use... Support tables for HTML5, CSS3, etc
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >HTMLCanvasElement.getContext() - Web APIs
getContext() method returns a drawing context on the canvas, or null if the context ... willReadFrequently.enable is set to true (which, by default, ......
Read more >CanvasRenderingContext2D.getImageData() - Web APIs | MDN
The CanvasRenderingContext2D method getImageData() of the Canvas 2D API returns an ImageData object representing the underlying pixel data ...
Read more >Canvas Element - HTML Standard - WhatWG
In interactive visual media, if scripting is enabled for the canvas element, ... webgl " or " webgl2 ", if the user agent...
Read more >Canvas2D is getting an update - YouTube
Hear about all the new features that have been added to the spec.Resourc... ... HTML5 Canvas API Crash Course. Traversy Media.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Added in v2.3.1 (in prod)
Thanks for the pointer @jbemmel and thanks for the insights @ROBERT-MCDOWELL
It’d be great to investigate the performance with and without this before using this. Keeping this issue open if someone is interested in the research.