3 ms·
i'm currently a little pissed at webwokers (yeah, i take it personally) that i can't hand them a canvaspixelarray. so basically to use workers for canvasimagema
by franze 15y ago
i'm currently a little pissed at webwokers (yeah, i take it personally) that i can't hand them a canvaspixelarray. so basically to use workers for canvasimagemanipulation you have to copy the canvaspixelarray into an uint8array, pass it to the work, get back a uint8array and copy that one back into the imagedata.data canvaspixelarray. oh yeah, the copy actions are of course all in the main thread - so this basically defeats the reason to have webworkers in the first place.
- timb 15y agothe newest chrome has support for transferable objects that can be sent directly to a worker without being copied. this works with ArrayBuffer now, not sure if ImageData is transferable yet, but it should be eventually. demo: http://html5-demos.appspot.com/static/workers/transferables/index.html http://html5-demos.appspot.com/static/workers/transferables/...
- franze 15y agonope, the canvaspixelarray is no arraybuffer, doesn't work yet. i check for changes in that regard with every google chrome canary release.