Using Web Workers for drawing using native canvas functions

前端 未结 4 769
长情又很酷
长情又很酷 2020-12-14 06:39

It\'s possible to send a CanvasPixelArray obtained via getImageData to a worker script, and let the worker script manipulate the pixels in its back

4条回答
  •  醉梦人生
    2020-12-14 07:33

    There's a new API to do this (currently only supported in Firefox if you enable a pref).

    See https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas and https://hacks.mozilla.org/2016/01/webgl-off-the-main-thread/.

提交回复
热议问题