[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] using the same context with multiple canvases



On Sat, 10 Nov 2012, Boris Zbarsky wrote:
> On 11/10/12 10:57 PM, Ian Hickson wrote:
> > Look at this test (warning, has a loop with 10000 
> > getImageData/drawImage calls, so can take a long time to render):
> > 
> >     http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1908
> > 
> > Between the time that the timeout fires and the time the timeout ends, 
> > which should hopefully be noticeable unless your computer is quite new 
> > (in which case just up the iteration count, thanks!), you can see the 
> > canvas on the screen is still completely transparent, but the bitmap 
> > of the canvas/context itself (they're shared in this case) is clearly 
> > not showing the same thing, since after the loop has finished, you see 
> > two squares, despite only one having been drawn -- the second is a 
> > copy from this "off-screen" buffer to itself.
> 
> Sure.  So there is an off-screen buffer that's acting as the canvas 
> backing store.  The point is that continuing to paint a transparent 
> canvas on-screen in this case does not require a second buffer the size 
> of the backing store. It only requires a buffer the size of the part of 
> the backing store that was visible the last time layout got updated, 
> since presumably the expectation is that there should be no layout or 
> other updates making their way to the screen during the loop on your 
> test.

That presumably depends on the UA. I don't see any reason why a UA 
couldn't support scrolling or zooming while the script is running; that 
they don't is merely an artefact of current browser architectures. In the 
multi-process case, though, there's really no way to get away from having 
this second bitmap be the full size of the canvas. So I will grant you 
that it increases the size of a required bitmap in some cases, but I don't 
see that there's much we can do to avoid that.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------