- From: Greggman <notifications@github.com>
- Date: Sat, 05 May 2018 13:31:57 +0000 (UTC)
- To: w3ctag/design-reviews <design-reviews@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3ctag/design-reviews/issues/141/386805956@github.com>
In that case you shouldn't you get rid of `transferControlToOffscreen` and `commit`? Why have 2 ways to render from a worker? One using `transferToBitmapImage` and another using `commit`? I assume `commit` is there because `transferToBitmapImage` is not efficient. Which kind of seems like it points out the issue? Why are there 2 ways to do this? Might I suggest there should be only one way or at least if there are 2 ways they should both work for both use cases? For example if a WebGL context could be bound to an OffscreenCanvas then you could do ``` cconst offscreen1 = document.querySelector("#c1*).transforControllToOffscreen(); const offscreen2 = document.querySelector("#c1*).transforControllToOffscreen(); const gl = offscreen1.getContext("webgl"); gl.setTargetCanvas(offscreen1); ...draw scene 1... gl.commit(); gl.setTargetCanvas(offscreen2); ...draw scene 2... gl.commit(); ``` This seems like it would have a bunch of beneifts * It would pull the 2 ways of doing things into 1 or at least make doing this both ways possible instead of the inconsistent way it is now. * It would also mean no need to set the size when switching which canvas you're planning to target * It would also mean drawing to multiple canvases doesn't require transferring to imagebitmaps and then transfering those imagebitmaps from a worker back to the main thread so it's much simpler to use. * It seems like it doesn't require nearly as much smarts or special algorithms for the browser to guess/infer how to keep around old drawingbuffers as it becomes clear what's supposed to happen Is there a reason why this is a bad idea? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3ctag/design-reviews/issues/141#issuecomment-386805956
Received on Saturday, 5 May 2018 13:32:23 UTC