question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] Enable 'willReadFrequently' on html5 canvas

See original GitHub issue

Is 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:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mebjascommented, Nov 17, 2022

Added in v2.3.1 (in prod)

0reactions
mebjascommented, Oct 29, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found