Skip to content

Use ImageBitmap API in Chrome and Firefox to decode images #7555

@kkaefer

Description

@kkaefer

The ImageBitmap API is supported in Chrome and Firefox at the time of this writing, but not Safari/Webkit, IE and Edge. It looks like we could use this to make image decoding asynchrous: The createImageBitmap constructor method returns a promise that will be resolve to a ImageBitmap object, so the call to texImage2D doesn't need to decode the image first. (See example in https://gist.github.com/ahem/d19ee198565e20c6f5e1bcd8f87b3408). Note that at least Chrome still decodes on the current, thread, so we need to do this in a webworker.

See #7405 for the master ticket around image decoding/uploading performance.

Metadata

Metadata

Assignees

Labels

performance ⚡Speed, stability, CPU usage, memory usage, or power usage

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions