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

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

On Tue, Dec 18, 2012 at 3:30 AM, Ian Hickson <ian@hixie.ch> wrote:
On Mon, 17 Dec 2012, Gregg Tavares (社ç~T¨) wrote:
> On Fri, Dec 14, 2012 at 5:08 AM, Ian Hickson <ian@hixie.ch> wrote:
> > On Thu, 13 Dec 2012, Gregg Tavares (社ç~T¨) wrote:
> > > >
> > > > Is this something that would make sense as arguments to
> > > > setContext()?
> > >
> > > It doesn't seem like the appropriate place since they are "creation"
> > > parameters and since for an animated app with multiple canvases
> > > you're going to be calling setContext once per canvas per frame.
> >
> > They don't have to be creation, right? I mean, you have multiple
> > contexts and you have multiple canvases, you're not going to be
> > necessarily creating anything after that, just binding a context to a
> > canvas and drawing. If the settings are specific to a particular
> > context/canvas binding, then setContext() seems the right place...
> How does this help us in workers where we also want to be able to create
> some object that represents what's being drawn to and we want to be able
> to create multiple of them, draw to them with 1 context, and have each
> have different attributes?

setContext is on the CanvasProxy object you have in workers also.

My understanding of CanvasProxy is it's something you create in the main thread from a Canvas. Not something the worker creates. We're asking for something a worker creates, no relation to the main page whatsoever. are you suggesting

  var cp = new CanvasProxy();
  cp.setContext(gl, {..params..});

And that doesn't strike you as a very strange API? What is this a proxy for if there's no actual canvas?


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