Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-04-03 Thread Stephen White
For reference, here is a prototype patch which implements : https://bugs.webkit.org/show_bug.cgi?id=112624 And one which implements getContext('2d', { alpha: none }): https://bugs.webkit.org/show_bug.cgi?id=112628 I believe this represents the bulk of the cross-port work that would be required; th

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-18 Thread Stephen White
On Thu, Mar 14, 2013 at 5:23 PM, Dean Jackson wrote: > > On 15/03/2013, at 8:06 AM, Gregg Tavares wrote: > > > Because it's not the same as fillRect(0, 0, width, height) on an empty > canvas. The canvas itself has alpha (unless we add the option to not have > it as has been proposed). The conten

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-18 Thread Stephen White
On Thu, Mar 14, 2013 at 4:38 PM, Ryosuke Niwa wrote: > On Thu, Mar 14, 2013 at 12:55 PM, Dean Jackson wrote: > >> >> On 15/03/2013, at 6:50 AM, Dana Jansens wrote: >> >> On Thu, Mar 14, 2013 at 3:46 PM, Dean Jackson wrote: >> >>> I'm not sure I like this proposal. Why is canvas special? Why do

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-15 Thread Vladimir Vukicevic
On 3/15/2013 6:23 PM, Kenneth Russell wrote: Is there a nontrivial amount of content depending on it? That would be more relevant precedent than merely being in the code base. How would one determine that? Searching for "getcontext webgl alpha false" returns many web pages on the topi

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-15 Thread Kenneth Russell
On Fri, Mar 15, 2013 at 1:35 AM, Maciej Stachowiak wrote: > > On Mar 15, 2013, at 1:19 AM, Gregg Tavares wrote: > > > I don't understand the opposition to "alpha" > > You set colors in Canvas2d with rgb or rgba. That 'a' in rgba stands for > alpha. > You can set a global alpha for drawing with c

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-15 Thread Maciej Stachowiak
On Mar 15, 2013, at 1:19 AM, Gregg Tavares wrote: > > I don't understand the opposition to "alpha" > > You set colors in Canvas2d with rgb or rgba. That 'a' in rgba stands for > alpha. > You can set a global alpha for drawing with context.globalAlpha > You read data from getImageData that ret

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-15 Thread Noam Rosenthal
On Fri, Mar 15, 2013 at 9:19 AM, Gregg Tavares wrote: > I don't understand the opposition to "alpha" > > You set colors in Canvas2d with rgb or rgba. That 'a' in rgba stands for > alpha. > You can set a global alpha for drawing with context.globalAlpha > You read data from getImageData that retur

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-15 Thread Gregg Tavares
On Thu, Mar 14, 2013 at 7:47 PM, Ryosuke Niwa wrote: > On Thu, Mar 14, 2013 at 7:45 PM, Dean Jackson wrote: > >> On 15/03/2013, at 12:49 PM, Vladimir Vukicevic >> wrote: >> > On 3/14/2013 5:23 PM, Dean Jackson wrote: >> >> On 15/03/2013, at 8:06 AM, Gregg Tavares wrote: >> >>> Because it's not

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-14 Thread Ryosuke Niwa
On Thu, Mar 14, 2013 at 7:45 PM, Dean Jackson wrote: > On 15/03/2013, at 12:49 PM, Vladimir Vukicevic > wrote: > > On 3/14/2013 5:23 PM, Dean Jackson wrote: > >> On 15/03/2013, at 8:06 AM, Gregg Tavares wrote: > >>> Because it's not the same as fillRect(0, 0, width, height) on an empty > canvas

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-14 Thread Dean Jackson
On 15/03/2013, at 12:49 PM, Vladimir Vukicevic wrote: > On 3/14/2013 5:23 PM, Dean Jackson wrote: >> On 15/03/2013, at 8:06 AM, Gregg Tavares wrote: >>> Because it's not the same as fillRect(0, 0, width, height) on an empty >>> canvas. The canvas itself has alpha (unless we add the option to n

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-14 Thread Vladimir Vukicevic
On 3/14/2013 5:23 PM, Dean Jackson wrote: On 15/03/2013, at 8:06 AM, Gregg Tavares wrote: Because it's not the same as fillRect(0, 0, width, height) on an empty canvas. The canvas itself has alpha (unless we add the option to not have it as has been proposed). The contents of the canvas has t

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-14 Thread Dean Jackson
On 15/03/2013, at 8:06 AM, Gregg Tavares wrote: > Because it's not the same as fillRect(0, 0, width, height) on an empty > canvas. The canvas itself has alpha (unless we add the option to not have it > as has been proposed). The contents of the canvas has to stay as the user > created it. If

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-14 Thread Gregg Tavares
On Thu, Mar 14, 2013 at 2:00 PM, Dean Jackson wrote: > > On 15/03/2013, at 7:55 AM, Gregg Tavares wrote: > > > > > On Thu, Mar 14, 2013 at 1:38 PM, Ryosuke Niwa wrote: > >> On Thu, Mar 14, 2013 at 12:55 PM, Dean Jackson wrote: >> >>> >>> On 15/03/2013, at 6:50 AM, Dana Jansens wrote: >>> >>>

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-14 Thread Dean Jackson
On 15/03/2013, at 7:55 AM, Gregg Tavares wrote: > > > > On Thu, Mar 14, 2013 at 1:38 PM, Ryosuke Niwa wrote: > On Thu, Mar 14, 2013 at 12:55 PM, Dean Jackson wrote: > > On 15/03/2013, at 6:50 AM, Dana Jansens wrote: > >> On Thu, Mar 14, 2013 at 3:46 PM, Dean Jackson wrote: >> I'm not su

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-14 Thread Kenneth Russell
On Thu, Mar 14, 2013 at 1:55 PM, Dean Jackson wrote: > > On 15/03/2013, at 7:45 AM, Kenneth Russell wrote: > >> On Thu, Mar 14, 2013 at 1:38 PM, Ryosuke Niwa wrote: >>> On Thu, Mar 14, 2013 at 12:55 PM, Dean Jackson wrote: On 15/03/2013, at 6:50 AM, Dana Jansens wrote:

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-14 Thread Gregg Tavares
On Thu, Mar 14, 2013 at 1:38 PM, Ryosuke Niwa wrote: > On Thu, Mar 14, 2013 at 12:55 PM, Dean Jackson wrote: > >> >> On 15/03/2013, at 6:50 AM, Dana Jansens wrote: >> >> On Thu, Mar 14, 2013 at 3:46 PM, Dean Jackson wrote: >> >>> I'm not sure I like this proposal. Why is canvas special? Why do

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-14 Thread Dean Jackson
On 15/03/2013, at 7:45 AM, Kenneth Russell wrote: > On Thu, Mar 14, 2013 at 1:38 PM, Ryosuke Niwa wrote: >> On Thu, Mar 14, 2013 at 12:55 PM, Dean Jackson wrote: >>> >>> >>> On 15/03/2013, at 6:50 AM, Dana Jansens wrote: >>> >>> On Thu, Mar 14, 2013 at 3:46 PM, Dean Jackson wrote: >

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-14 Thread Kenneth Russell
On Thu, Mar 14, 2013 at 1:38 PM, Ryosuke Niwa wrote: > On Thu, Mar 14, 2013 at 12:55 PM, Dean Jackson wrote: >> >> >> On 15/03/2013, at 6:50 AM, Dana Jansens wrote: >> >> On Thu, Mar 14, 2013 at 3:46 PM, Dean Jackson wrote: >>> >>> I'm not sure I like this proposal. Why is canvas special? Why d

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-14 Thread Ryosuke Niwa
On Thu, Mar 14, 2013 at 12:55 PM, Dean Jackson wrote: > > On 15/03/2013, at 6:50 AM, Dana Jansens wrote: > > On Thu, Mar 14, 2013 at 3:46 PM, Dean Jackson wrote: > >> I'm not sure I like this proposal. Why is canvas special? Why doesn't >> get an opaque attribute (or flag)? Why not every eleme

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-14 Thread Gregg Tavares
On Thu, Mar 14, 2013 at 12:46 PM, Dean Jackson wrote: > I'm not sure I like this proposal. Why is canvas special? Why doesn't > get an opaque attribute (or flag)? Why not every element? > > I don't think the performance benefit, which is mostly going to be on very > limited hardware, is worth ch

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-14 Thread Dean Jackson
On 15/03/2013, at 6:50 AM, Dana Jansens wrote: > On Thu, Mar 14, 2013 at 3:46 PM, Dean Jackson wrote: > I'm not sure I like this proposal. Why is canvas special? Why doesn't > get an opaque attribute (or flag)? Why not every element? > > There is ongoing work to infer opaqueness in every oth

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-14 Thread Dana Jansens
On Thu, Mar 14, 2013 at 3:46 PM, Dean Jackson wrote: > I'm not sure I like this proposal. Why is canvas special? Why doesn't > get an opaque attribute (or flag)? Why not every element? > There is ongoing work to infer opaqueness in every other kind of element when possible. See for example http

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-14 Thread Dean Jackson
I'm not sure I like this proposal. Why is canvas special? Why doesn't get an opaque attribute (or flag)? Why not every element? I don't think the performance benefit, which is mostly going to be on very limited hardware, is worth changing the rendering model that is consistent across every oth

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-14 Thread Stephen White
Hi Dirk, There have been at least five options considered, with contributions from Chromium, Adobe and Mozilla so far. The moz-opaque idea was first floated by Robert O'Callahan from Mozilla, and Ian Hickson offered to spec it if another browser vendor wanted to implement it. I took him up on th

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-13 Thread Ryosuke Niwa
On Wed, Mar 13, 2013 at 9:49 PM, Gregg Tavares wrote: > On Wed, Mar 13, 2013 at 9:20 PM, Maciej Stachowiak wrote: > >> >> Two questions/comments: >> >> 1) What happens if I do: >> gl = canvas.getContext("experimental-webgl", { alpha: false }); >> and then later, in an unrelated piece of code

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-13 Thread Maciej Stachowiak
On Mar 13, 2013, at 9:49 PM, Gregg Tavares wrote: > > > > On Wed, Mar 13, 2013 at 9:20 PM, Maciej Stachowiak wrote: > > Two questions/comments: > > 1) What happens if I do: > gl = canvas.getContext("experimental-webgl", { alpha: false }); > and then later, in an unrelated piece of code

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-13 Thread Gregg Tavares
unify usage with WebGL and to make it easy to extend (e.g., >> preserveDrawingBuffer mentioned above). Firefox may well even stop >> supporting moz-opaque; we never really publicized it anywhere and just used >> it internally in the Firefox UI. >> >>- Vlad >>

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-13 Thread Gregg Tavares
> preserveDrawingBuffer mentioned above). Firefox may well even stop > supporting moz-opaque; we never really publicized it anywhere and just used > it internally in the Firefox UI. > >- Vlad > > - Original Message - > > From: "Elliott Sprehn" > To: "

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-13 Thread Maciej Stachowiak
n the Firefox UI. > >- Vlad > > - Original Message - >> From: "Elliott Sprehn" >> To: "Rik Cabanier" >> Cc: "WebKit Development" >> Sent: Wednesday, March 13, 2013 6:25:53 PM >> Subject: Re: [webkit-dev] New we

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-13 Thread Vladimir Vukicevic
he Firefox UI. - Vlad - Original Message - > From: "Elliott Sprehn" > To: "Rik Cabanier" > Cc: "WebKit Development" > Sent: Wednesday, March 13, 2013 6:25:53 PM > Subject: Re: [webkit-dev] New web-facing canvas feature: "opaque" attrib

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-13 Thread Gregg Tavares
On Wed, Mar 13, 2013 at 1:02 PM, Maciej Stachowiak wrote: > > An attribute on the canvas element would presumably be equally applicable > to all contexts. Is there a reason that it's better to have opaqueness > specified at context creation time instead of on the canvas? > Changing opaque requir

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-13 Thread Rik Cabanier
globalAlpha will still work but will always composite with an opaque backdrop (which is black by default) On Wed, Mar 13, 2013 at 3:25 PM, Elliott Sprehn wrote: > alpha:false is super confusing to me. It makes it sound as though all > draw*() operations that use an alpha channel will fail... doe

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-13 Thread Elliott Sprehn
alpha:false is super confusing to me. It makes it sound as though all draw*() operations that use an alpha channel will fail... does globalAlpha still work? It's sad that WebGL picked such a generic name that isn't about all "alpha" related things. On Wed, Mar 13, 2013 at 2:59 PM, Rik Cabanier

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-13 Thread Rik Cabanier
The main reason for this feature is to enhance performance of canvas operations. Are we certain that this will always be the case? For instance, is google going to make certain that the cairo and core graphics backends don't slow down? Rik On Wed, Mar 13, 2013 at 1:21 PM, Brandon Jones wrote: >

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-13 Thread Brandon Jones
I think "opaque" vs. "alpha: false" is a matter of opinion. The functionality doesn't change, regardless of what you call it. I agree with Gregg that this really should be implemented to reflect the functionality that WebGL already has. Wether 2D or 3D, there's a lot of common ground between the v

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-13 Thread Maciej Stachowiak
An attribute on the canvas element would presumably be equally applicable to all contexts. Is there a reason that it's better to have opaqueness specified at context creation time instead of on the canvas? Also, I think "opaque" is easier to understand than "alpha: false". - Maciej On Mar 13

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-13 Thread Gregg Tavares
It would be nice if this was the same as WebGL instead of different. Especially because 2d canvas and WebGL need to inter-operate in the near future. In WebGL to create a canvas with no alpha (an opaque canvas) you do this gl = canvas.getContext("experimental-webgl", { alpha: false }); Why ca

Re: [webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-13 Thread Dirk Schulze
This is a very long thread and I did not see any conclusions or agreement on this thread. Can you summarize the topic and the status on the acceptance level please? Greetings, Dirk On Mar 13, 2013, at 9:15 AM, Stephen White wrote: > Hi WebKittens, > > I'm planning to implement the canvas "op

[webkit-dev] New web-facing canvas feature: "opaque" attribute

2013-03-13 Thread Stephen White
Hi WebKittens, I'm planning to implement the canvas "opaque" attribute, as proposed here: http://lists.w3.org/Archives/Public/public-whatwg-archive/2013Mar/0109.html. This is an attribute that causes the allocation of an opaque backing store for , allowing optimizations at the time the canvas is