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

Use createImageBitmap for image decoding when available #6624

Closed
puckey opened this issue May 24, 2018 · 3 comments
Closed

Use createImageBitmap for image decoding when available #6624

puckey opened this issue May 24, 2018 · 3 comments

Comments

@puckey
Copy link
Contributor

puckey commented May 24, 2018

While profiling in Chrome, I noticed quite a few ms being spent in decoding satellite images on the main thread. Using ImageBitmap this decoding could be offloaded to the background. ImageBitmap is currently supported by Firefox, Chrome & Opera.

https://developers.google.com/web/updates/2016/03/createimagebitmap-in-chrome-50

"The problem with decoding images is that it can be CPU intensive, and that can sometimes mean jank or checkerboarding. As of Chrome 50 (and in Firefox 42+) you now have another option: createImageBitmap(). It allows you to decode an image in the background, and get access to a new ImageBitmap primitive, which you can draw into a canvas in the same way you would an element, another canvas, or a video."

@puckey
Copy link
Contributor Author

puckey commented May 24, 2018

I created the following pull request for this: #6625

It contains one TODO: I am not completely sure what to do with the crossOrigin parameter passed to Resource._Implementations.createImage...

@mramato
Copy link
Contributor

mramato commented Aug 16, 2019

Implemented in #7579

@mramato mramato closed this as completed Aug 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants