W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2009

[whatwg] Canvas tag - single or multiple contexts?

From: Anne van Kesteren <annevk@opera.com>
Date: Mon, 21 Dec 2009 20:56:15 +0100
Message-ID: <op.u5a0amjg64w2qv@annevk-t60>
On Mon, 21 Dec 2009 20:50:33 +0100, Gregg Tavares <gman at google.com> wrote:
> What is the intent of the getContext function on the <canvas> tag?
>
> Should it be possible to get multiple simultaneous different contexts as  
> in?
>
> var ctx2d = canvas.getContext("2d");
> var ctxText = canvas.getContext("fancy-text-api");
> var ctxFilter = canvas.getContext("image-filter-api");
>
> ctx2d.drawImage(someImage, 0, 0);
> ctxText.drawText(0, 0, "hello world");
> ctxFilter.radialBlur(0.1);
>
> ?
>
> OR
>
> is canvas only allowed 1 context at a time?

In theory multiple contexts should be possible. E.g. we supported 2d,  
opera-2dgame, and opera-3d for a while. However it seems that for certain  
contexts, in particular webgl, using it together with other contexts is  
not possible (for now anyway).


-- 
Anne van Kesteren
http://annevankesteren.nl/
Received on Monday, 21 December 2009 11:56:15 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:54 UTC