Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-07-23 Thread Stephen White
On Tue, Jul 16, 2013 at 6:41 PM, Ian Hickson i...@hixie.ch wrote: This thread was gigantic and involved many proposals. I've only included the last one below, since it seemed to take into account the most of the feedback mentioned on the thread; I haven't responded to all the intermediate

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-07-16 Thread Ian Hickson
This thread was gigantic and involved many proposals. I've only included the last one below, since it seemed to take into account the most of the feedback mentioned on the thread; I haven't responded to all the intermediate e-mails which were mainly just a discussion amongst contributors, and

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-07-10 Thread Ian Hickson
On Sat, 24 Nov 2012, Adam Barth wrote: On Fri, Nov 23, 2012 at 3:04 PM, Ian Hickson i...@hixie.ch wrote: On Mon, 12 Nov 2012, Justin Novosad wrote: For many types of apps, DOM-based rendering is uncompetitively slow [so we should make text rendering in canvas more controllable] This

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-04-19 Thread Rik Cabanier
Nice! The behaviour of putImageData() and putImageDataHD() is to premultiply the RGB components by the alpha component as usual, but write 1.0 into destination alpha. In other words, if (r, g, b, a) are the component values in a given pixel passed to putImageData[HD](), then r' = ar, g' = ag, b'

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-04-19 Thread Stephen White
Thanks for your comments. On Fri, Apr 19, 2013 at 12:53 PM, Rik Cabanier caban...@gmail.com wrote: Nice! The behaviour of putImageData() and putImageDataHD() is to premultiply the RGB components by the alpha component as usual, but write 1.0 into destination alpha. In other words, if (r, g,

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-04-19 Thread Robert O'Callahan
On Sat, Apr 20, 2013 at 4:13 AM, Stephen White senorbla...@chromium.orgwrote: Here's a short proposal I've written up for the getContext('2d', { alpha: false } ) version of this idea (much of it culled from the mega-thread above). http://wiki.whatwg.org/wiki/CanvasOpaque Looks reasonable

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-04-03 Thread Stephen White
Would Mozilla (or other browser vendors) be interested in implementing the hint as Gregg described above? If so, we could break out the LCD text issue from canvas opacity, and consider the latter on its own merits, since it has benefits apart from LCD text (i.e., performance). Regarding that, if

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-04-03 Thread Gregg Tavares
On Wed, Apr 3, 2013 at 8:41 AM, Stephen White senorbla...@chromium.orgwrote: Would Mozilla (or other browser vendors) be interested in implementing the hint as Gregg described above? If so, we could break out the LCD text issue from canvas opacity, and consider the latter on its own merits,

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-04-03 Thread Rik Cabanier
On Wed, Apr 3, 2013 at 9:04 AM, Gregg Tavares g...@google.com wrote: On Wed, Apr 3, 2013 at 8:41 AM, Stephen White senorbla...@chromium.org wrote: Would Mozilla (or other browser vendors) be interested in implementing the hint as Gregg described above? If so, we could break out the

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-04-03 Thread Gregg Tavares
On Wed, Apr 3, 2013 at 5:04 PM, Rik Cabanier caban...@gmail.com wrote: On Wed, Apr 3, 2013 at 9:04 AM, Gregg Tavares g...@google.com wrote: On Wed, Apr 3, 2013 at 8:41 AM, Stephen White senorbla...@chromium.org wrote: Would Mozilla (or other browser vendors) be interested in implementing

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-04-03 Thread James Robinson
Fonts are not vector art and are not rendered as paths at commonly read sizes. I don't think anyone is using or would be tempted to use LCD subpixel AA for anything other than text. - James On Wed, Apr 3, 2013 at 5:07 PM, Gregg Tavares g...@google.com wrote: On Wed, Apr 3, 2013 at 5:04 PM,

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-04-03 Thread Gregg Tavares
On Wed, Apr 3, 2013 at 5:09 PM, James Robinson jam...@google.com wrote: Fonts are not vector art O RLY? So you're saying the following 250pt ampersand is stored as a bitmap in the font file? and are not rendered as paths at commonly read sizes. I don't think anyone is using or

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-04-03 Thread Stephen White
On Wed, Apr 3, 2013 at 12:04 PM, Gregg Tavares g...@google.com wrote: On Wed, Apr 3, 2013 at 8:41 AM, Stephen White senorbla...@chromium.orgwrote: Would Mozilla (or other browser vendors) be interested in implementing the hint as Gregg described above? If so, we could break out the LCD

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-04-03 Thread Rik Cabanier
On Wed, Apr 3, 2013 at 5:21 PM, Gregg Tavares g...@google.com wrote: On Wed, Apr 3, 2013 at 5:09 PM, James Robinson jam...@google.com wrote: Fonts are not vector art O RLY? So you're saying the following 250pt ampersand is stored as a bitmap in the font file? It's not simply

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-04-03 Thread Mark Callow
On 2013/04/04 10:08, Rik Cabanier wrote: On Wed, Apr 3, 2013 at 5:21 PM, Gregg Tavares g...@google.com wrote: O RLY? So you're saying the following 250pt ampersand is stored as a bitmap in the font file? It's not simply stored as a path that you then scale. In some fonts it might be

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-04-03 Thread Mark Callow
On 2013/04/04 10:08, Rik Cabanier wrote: On Wed, Apr 3, 2013 at 5:21 PM, Gregg Tavares g...@google.com wrote: Fonts render different from paths. If your UA doesn't do that, you are doing it wrong. :-) Line art looks different to the human eye than a line of text. Imagina a vertical and a

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-04-03 Thread Mark Callow
On 2013/04/04 13:50, Rik Cabanier wrote: On Wed, Apr 3, 2013 at 9:25 PM, Mark Callow callow.m...@artspark.co.jp mailto:callow.m...@artspark.co.jp wrote: As screen pixel densities soar, it is increasingly the case that fonts are stored simply as paths that are scaled, especially

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-04-03 Thread Rik Cabanier
On Wed, Apr 3, 2013 at 10:02 PM, Mark Callow callow.m...@artspark.co.jpwrote: On 2013/04/04 13:50, Rik Cabanier wrote: On Wed, Apr 3, 2013 at 9:25 PM, Mark Callow callow.m...@artspark.co.jpwrote: As screen pixel densities soar, it is increasingly the case that fonts are stored simply as

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-17 Thread Robert O'Callahan
On Sat, Mar 16, 2013 at 5:52 PM, Gregg Tavares g...@google.com wrote: Let me ask again in a different way ;-) Specifically about LCD style antialiasing. What about a context attribute antialiasRenderingQualityHint for now with 2 settings default and displayDependent

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-17 Thread Gregg Tavares
On Sun, Mar 17, 2013 at 1:40 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Sat, Mar 16, 2013 at 5:52 PM, Gregg Tavares g...@google.com wrote: Let me ask again in a different way ;-) Specifically about LCD style antialiasing. What about a context attribute

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-15 Thread Gregg Tavares
Let me ask again in a different way ;-) Specifically about LCD style antialiasing. What about a context attribute antialiasRenderingQualityHint for now with 2 settings default and displayDependent context.antialiasRenderingQualityHint = displayDependent I'm thinking of it like this. The

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-14 Thread Stephen White
On Wed, Mar 13, 2013 at 10:28 PM, Gregg Tavares g...@google.com wrote: On Wed, Mar 13, 2013 at 1:18 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Mar 14, 2013 at 8:04 AM, Gregg Tavares g...@google.com wrote: It seems like an opaque canvas should be an orthogonal issue to

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-14 Thread Stephen White
On Wed, Mar 13, 2013 at 2:48 PM, Gregg Tavares g...@google.com wrote: Sorry for only mentioning this so late but is there any chance to steer this to be more inline with WebGL? WebGL already has the option to have an opaque canvas using context creation parameters. In WebGL it's gl =

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-14 Thread Boris Zbarsky
On 3/14/13 10:34 AM, Stephen White wrote: can we create a interface Canvas2DContextAttributes { attribute boolean alpha; } which has no relation to WebGLContextAttributes? Yes. Then we get at least the duck typing such that ctx = canvas.getContext('2d', {alpha: false }); and ctx =

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-13 Thread Robert O'Callahan
On Wed, Mar 13, 2013 at 4:51 PM, Rik Cabanier caban...@gmail.com wrote: Also, should opaque go on CanvasRenderingContext2D or the canvas object? If it's applied to the canvas object, it seems that it should apply to WebGL too. Does Firefox apply this to WebGL contexts? We don't, but ideally

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-13 Thread Gregg Tavares
Sorry for only mentioning this so late but is there any chance to steer this to be more inline with WebGL? WebGL already has the option to have an opaque canvas using context creation parameters. In WebGL it's gl = canvas.getContext(webgl, {alpha: false}); If we go forward with an opaque

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-13 Thread Gregg Tavares
Another question: And I see this brought up above It seems like an opaque canvas should be an orthogonal issue to subpixel-aa. Subpixel AA seems like it should be a Canvas2DRenderingContext setting though maybe with a name like ctx.antialiasingRenderQuality = With options of none

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-13 Thread Robert O'Callahan
On Thu, Mar 14, 2013 at 8:04 AM, Gregg Tavares g...@google.com wrote: It seems like an opaque canvas should be an orthogonal issue to subpixel-aa. Subpixel AA seems like it should be a Canvas2DRenderingContext setting though maybe with a name like ctx.antialiasingRenderQuality = With

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-13 Thread Gregg Tavares
On Wed, Mar 13, 2013 at 1:18 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Mar 14, 2013 at 8:04 AM, Gregg Tavares g...@google.com wrote: It seems like an opaque canvas should be an orthogonal issue to subpixel-aa. Subpixel AA seems like it should be a Canvas2DRenderingContext

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-13 Thread Rik Cabanier
On Wed, Mar 13, 2013 at 11:48 AM, Gregg Tavares g...@google.com wrote: Sorry for only mentioning this so late but is there any chance to steer this to be more inline with WebGL? WebGL already has the option to have an opaque canvas using context creation parameters. In WebGL it's gl =

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-13 Thread Mark Callow
On 2013/03/13 2:03, Stephen White wrote: Description: The opaque attribute is a boolean attribute of the canvas element, whose presence indicates that the alpha values in the canvas backing store must be 1.0 at all times. All canvas operations are modified to preserve this invariant. If

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-12 Thread Stephen White
On Mon, Mar 11, 2013 at 4:32 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Tue, Mar 12, 2013 at 8:23 AM, Stephen White senorbla...@chromium.orgwrote: On Mon, Mar 11, 2013 at 2:56 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Tue, Mar 12, 2013 at 7:53 AM, Stephen White

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-12 Thread Stephen White
Here's a draft of proposal (1) above: Motivation: Compositing a canvas element into the page can be expensive, due to blending operations, and lack of opportunity for culling. Since arbitrary graphics operations can affect the opacity of the canvas, it is difficult to determine programmatically

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-12 Thread Robert O'Callahan
On Wed, Mar 13, 2013 at 5:53 AM, Stephen White senorbla...@chromium.orgwrote: I'm a little leery of spec'ing something that has negative performance implications. So am I, but surely making non-over operators slower is better than making them not work at all --- especially if the former

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-12 Thread Ian Hickson
On Tue, 12 Mar 2013, Stephen White wrote: As an example, the darker compositing mode was removed from the spec due to hardware-accelerated performance concerns, IIRC. 'darker' was removed because it wasn't defined anywhere so couldn't be implemented interoperably. -- Ian Hickson

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-12 Thread Rik Cabanier
On Tue, Mar 12, 2013 at 10:03 AM, Stephen White senorbla...@chromium.orgwrote: Here's a draft of proposal (1) above: Motivation: Compositing a canvas element into the page can be expensive, due to blending operations, and lack of opportunity for culling. Since arbitrary graphics operations

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-12 Thread Rik Cabanier
On Tue, Mar 12, 2013 at 3:08 PM, Stephen White senorbla...@chromium.orgwrote: On Tue, Mar 12, 2013 at 5:36 PM, Rik Cabanier caban...@gmail.com wrote: On Tue, Mar 12, 2013 at 10:03 AM, Stephen White senorbla...@chromium.org wrote: Here's a draft of proposal (1) above: Motivation:

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-11 Thread Stephen White
Here's a first draft of a proposal to standardize moz-opaque. (Note that Firefox/Linux and Firefox/Win differ in their implementation of moz-opaque. This proposal is most similar to the Firefox/Linux implementation, but with the canvas cleared to opaque black as in the Firefox/Win version).

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-11 Thread Robert O'Callahan
On Tue, Mar 12, 2013 at 7:53 AM, Stephen White senorbla...@chromium.orgwrote: All other canvas functionality behaves as normal, including operations which modify the alpha values of the backing store. However, any such transparency values will be ignored when compositing the canvas into the

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-11 Thread Stephen White
On Mon, Mar 11, 2013 at 2:56 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Tue, Mar 12, 2013 at 7:53 AM, Stephen White senorbla...@chromium.orgwrote: All other canvas functionality behaves as normal, including operations which modify the alpha values of the backing store. However,

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-11 Thread Robert O'Callahan
On Tue, Mar 12, 2013 at 8:23 AM, Stephen White senorbla...@chromium.orgwrote: On Mon, Mar 11, 2013 at 2:56 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Tue, Mar 12, 2013 at 7:53 AM, Stephen White senorbla...@chromium.orgwrote: All other canvas functionality behaves as normal,

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-03-08 Thread Stephen White
On Sat, Feb 23, 2013 at 6:48 AM, Robert O'Callahan rob...@ocallahan.orgwrote: On Sat, Feb 23, 2013 at 4:59 AM, Stephen White senorbla...@chromium.orgwrote: On Thu, Feb 21, 2013 at 7:01 PM, Rik Cabanier caban...@gmail.com wrote: On Fri, Feb 22, 2013 at 10:33 AM, Robert O'Callahan

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-26 Thread Rik Cabanier
FYI http://www.istartedsomething.com/20120303/cleartype-takes-a-back-seat-for-windows-8-metro/ IE 10 removed subpixel positioning and just use regular AA. On Thu, Feb 21, 2013 at 11:12 AM, Stephen White senorbla...@chromium.orgwrote: On Tue, Feb 19, 2013 at 11:31 PM, Rik Cabanier

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-26 Thread Bjoern Hoehrmann
* Rik Cabanier wrote: FYI http://www.istartedsomething.com/20120303/cleartype-takes-a-back-seat-for-windows-8-metro/ IE 10 removed subpixel positioning and just use regular AA. The article seems to be about Windows 8 and neither it nor the comments seem to discuss Internet Explorer 10 on Windows

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-26 Thread Rik Cabanier
I experimented a bit and t is still active on Windows 7. On Tue, Feb 26, 2013 at 10:11 AM, Bjoern Hoehrmann derhoe...@gmx.netwrote: * Rik Cabanier wrote: FYI http://www.istartedsomething.com/20120303/cleartype-takes-a-back-seat-for-windows-8-metro/ IE 10 removed subpixel positioning and

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-23 Thread Robert O'Callahan
On Sat, Feb 23, 2013 at 4:59 AM, Stephen White senorbla...@chromium.orgwrote: On Thu, Feb 21, 2013 at 7:01 PM, Rik Cabanier caban...@gmail.com wrote: On Fri, Feb 22, 2013 at 10:33 AM, Robert O'Callahan rob...@ocallahan.org wrote: I think a fully automatic solution that tries to use

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-22 Thread Stephen White
On Thu, Feb 21, 2013 at 7:01 PM, Rik Cabanier caban...@gmail.com wrote: On Fri, Feb 22, 2013 at 10:33 AM, Robert O'Callahan rob...@ocallahan.orgwrote: I think Rik is convincing me that we shouldn't expose mozOpaque or any other explicit subpixel AA control to the Web. It will be very easy

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-22 Thread Rik Cabanier
On Fri, Feb 22, 2013 at 7:59 AM, Stephen White senorbla...@chromium.orgwrote: On Thu, Feb 21, 2013 at 7:01 PM, Rik Cabanier caban...@gmail.com wrote: On Fri, Feb 22, 2013 at 10:33 AM, Robert O'Callahan rob...@ocallahan.org wrote: I think Rik is convincing me that we shouldn't expose

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-22 Thread Rik Cabanier
On Sat, Feb 23, 2013 at 2:59 AM, Stephen White senorbla...@chromium.orgwrote: On Thu, Feb 21, 2013 at 7:01 PM, Rik Cabanier caban...@gmail.com wrote: On Fri, Feb 22, 2013 at 10:33 AM, Robert O'Callahan rob...@ocallahan.org wrote: I think Rik is convincing me that we shouldn't expose

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-21 Thread Stephen White
On Tue, Feb 19, 2013 at 11:31 PM, Rik Cabanier caban...@gmail.com wrote: So now we have: - don't do this on pinch-zoom devices - don't do this for HW accelerated canvases - don't do this if the canvas dpi doesn't match the screen - don't do this if there are transforms - authors will have

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-21 Thread Robert O'Callahan
I think Rik is convincing me that we shouldn't expose mozOpaque or any other explicit subpixel AA control to the Web. It will be very easy for Web authors to test it in one place and discover that it works without realizing that they're causing problems for some users. I think a fully automatic

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-19 Thread Rik Cabanier
So now we have: - don't do this on pinch-zoom devices - don't do this for HW accelerated canvases - don't do this if the canvas dpi doesn't match the screen - don't do this if there are transforms - authors will have to be very careful when using this feature since it can turn on or off or cause

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-18 Thread Stephen White
On Sat, Feb 16, 2013 at 4:09 AM, Robert O'Callahan rob...@ocallahan.orgwrote: On Sat, Feb 16, 2013 at 11:09 AM, Stephen White senorbla...@chromium.orgwrote: On Fri, Feb 15, 2013 at 2:37 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Sat, Feb 16, 2013 at 4:35 AM, Stephen White

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-18 Thread Robert O'Callahan
On Tue, Feb 19, 2013 at 12:01 PM, Stephen White senorbla...@chromium.orgwrote: On Sat, Feb 16, 2013 at 4:09 AM, Robert O'Callahan rob...@ocallahan.orgwrote: Not really true, you can just give up on the complex cases and draw grayscale whenever you feel like it. And leave the behaviour

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-18 Thread Rik Cabanier
On Mon, Feb 18, 2013 at 4:01 PM, Stephen White senorbla...@chromium.orgwrote: On Sat, Feb 16, 2013 at 4:09 AM, Robert O'Callahan rob...@ocallahan.orgwrote: On Sat, Feb 16, 2013 at 11:09 AM, Stephen White senorbla...@chromium.org wrote: On Fri, Feb 15, 2013 at 2:37 PM, Robert O'Callahan

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-18 Thread Stephen White
On Sat, Feb 16, 2013 at 4:12 AM, Robert O'Callahan rob...@ocallahan.orgwrote: On Sat, Feb 16, 2013 at 11:09 AM, Stephen White senorbla...@chromium.orgwrote: deferred canvas rendering (collect commands into a buffer, flush buffer only when compositing canvas to page, and decide on subpixel

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-18 Thread Robert O'Callahan
On Tue, Feb 19, 2013 at 5:19 PM, Stephen White senorbla...@chromium.orgwrote: Even with text on an opaque background, I think you still have to worry about the case of transformed canvases. E.g., text drawn over an opaque background into a single still frame canvas, but then subsequently

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-16 Thread Robert O'Callahan
On Sat, Feb 16, 2013 at 11:09 AM, Stephen White senorbla...@chromium.orgwrote: On Fri, Feb 15, 2013 at 2:37 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Sat, Feb 16, 2013 at 4:35 AM, Stephen White senorbla...@chromium.orgwrote: Even within canvas, there may be a way to break it if

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-16 Thread Robert O'Callahan
On Sat, Feb 16, 2013 at 11:09 AM, Stephen White senorbla...@chromium.orgwrote: deferred canvas rendering (collect commands into a buffer, flush buffer only when compositing canvas to page, and decide on subpixel AA at that point) pro: catches all cases of color fringing con: in some cases,

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-15 Thread Stephen White
On Thu, Feb 14, 2013 at 10:21 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Feb 14, 2013 at 11:59 PM, Stephen White senorbla...@chromium.orgwrote: I think this is difficult to do in the general case, such as putImageData() or drawImage() or patterns, since you would need to

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-15 Thread Rik Cabanier
On Sat, Feb 16, 2013 at 2:35 AM, Stephen White senorbla...@chromium.orgwrote: On Thu, Feb 14, 2013 at 10:21 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Feb 14, 2013 at 11:59 PM, Stephen White senorbla...@chromium.org wrote: I think this is difficult to do in the general

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-15 Thread Rik Cabanier
As an other alternative, we could also introduce a 'matteColor' attribute. It's default would be 'transparent'. If it's set to a css color, the canvas will be matted to that color. In addition if you use putImageData or a compositing operator that changes alpha, you always matte with that color

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-15 Thread Robert O'Callahan
On Sat, Feb 16, 2013 at 4:35 AM, Stephen White senorbla...@chromium.orgwrote: Even with these constraints, I don't think we can guarantee that it's safe to use LCD AA text. Once you've drawn with LCD AA text, even if it's safe at the time of drawing, there's no guarantee that it will be safe

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-15 Thread Stephen White
On Fri, Feb 15, 2013 at 2:37 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Sat, Feb 16, 2013 at 4:35 AM, Stephen White senorbla...@chromium.orgwrote: Even with these constraints, I don't think we can guarantee that it's safe to use LCD AA text. Once you've drawn with LCD AA text, even

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-14 Thread Stephen White
On Wed, Feb 13, 2013 at 11:35 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Feb 14, 2013 at 5:16 PM, Rik Cabanier caban...@gmail.com wrote: Looking at the WebKit implementation, I'm unsure how 'opaque' can implemented for accelerated canvas. It might work with non-accelerated

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-14 Thread Rik Cabanier
On Thu, Feb 14, 2013 at 2:59 AM, Stephen White senorbla...@chromium.orgwrote: On Wed, Feb 13, 2013 at 11:35 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Feb 14, 2013 at 5:16 PM, Rik Cabanier caban...@gmail.com wrote: Looking at the WebKit implementation, I'm unsure how 'opaque'

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-14 Thread Robert O'Callahan
On Thu, Feb 14, 2013 at 11:59 PM, Stephen White senorbla...@chromium.orgwrote: I think this is difficult to do in the general case, such as putImageData() or drawImage() or patterns, since you would need to examine all the pixels of the source image to determine if they contain non-1 alpha.

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-14 Thread Rik Cabanier
On Fri, Feb 15, 2013 at 2:21 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Feb 14, 2013 at 11:59 PM, Stephen White senorbla...@chromium.orgwrote: I think this is difficult to do in the general case, such as putImageData() or drawImage() or patterns, since you would need to

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-13 Thread Stephen White
On Tue, Feb 12, 2013 at 6:14 PM, Rik Cabanier caban...@gmail.com wrote: On Tue, Feb 12, 2013 at 2:56 PM, Stephen White senorbla...@chromium.orgwrote: On Fri, Nov 23, 2012 at 6:04 PM, Ian Hickson i...@hixie.ch wrote: On Thu, 29 Mar 2012, Jeremy Apthorp wrote: On Thu, Mar 29, 2012 at

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-13 Thread Rik Cabanier
For blending optimizations, it might be better to introduce a function instead of a boolean attribute like 'opaque'. What you really want, is to matte [1] the canvas with a solid color so you can optimize compositing. How about this API: void applyMatte(DOMString color); // color is a CSS rgb

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-13 Thread Stephen White
On Wed, Feb 13, 2013 at 12:22 PM, Rik Cabanier caban...@gmail.com wrote: For blending optimizations, it might be better to introduce a function instead of a boolean attribute like 'opaque'. What you really want, is to matte [1] the canvas with a solid color so you can optimize compositing.

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-13 Thread Rik Cabanier
On Wed, Feb 13, 2013 at 11:25 AM, Stephen White senorbla...@chromium.orgwrote: On Wed, Feb 13, 2013 at 12:22 PM, Rik Cabanier caban...@gmail.com wrote: For blending optimizations, it might be better to introduce a function instead of a boolean attribute like 'opaque'. What you really want,

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-13 Thread Stephen White
On Wed, Feb 13, 2013 at 5:31 PM, Rik Cabanier caban...@gmail.com wrote: On Wed, Feb 13, 2013 at 11:25 AM, Stephen White senorbla...@chromium.org wrote: On Wed, Feb 13, 2013 at 12:22 PM, Rik Cabanier caban...@gmail.com wrote: For blending optimizations, it might be better to introduce a

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-13 Thread Rik Cabanier
On Thu, Feb 14, 2013 at 12:39 PM, Stephen White senorbla...@chromium.orgwrote: On Wed, Feb 13, 2013 at 5:31 PM, Rik Cabanier caban...@gmail.com wrote: On Wed, Feb 13, 2013 at 11:25 AM, Stephen White senorbla...@chromium.org wrote: On Wed, Feb 13, 2013 at 12:22 PM, Rik Cabanier

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-13 Thread Robert O'Callahan
On Thu, Feb 14, 2013 at 3:55 PM, Rik Cabanier caban...@gmail.com wrote: What would happen if you set 'opaque' to true and you draw with alpha and 'copy' compositing? It seems that that has the same issue (unless you're OK with breaking drawing). The alpha values of all moz-opaque canvas

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-13 Thread Rik Cabanier
On Thu, Feb 14, 2013 at 2:12 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Feb 14, 2013 at 3:55 PM, Rik Cabanier caban...@gmail.com wrote: What would happen if you set 'opaque' to true and you draw with alpha and 'copy' compositing? It seems that that has the same issue (unless

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-13 Thread Robert O'Callahan
On Thu, Feb 14, 2013 at 4:18 PM, Rik Cabanier caban...@gmail.com wrote: On Thu, Feb 14, 2013 at 2:12 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Feb 14, 2013 at 3:55 PM, Rik Cabanier caban...@gmail.com wrote: What would happen if you set 'opaque' to true and you draw with

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-13 Thread Rik Cabanier
On Thu, Feb 14, 2013 at 2:27 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Feb 14, 2013 at 4:18 PM, Rik Cabanier caban...@gmail.com wrote: On Thu, Feb 14, 2013 at 2:12 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Feb 14, 2013 at 3:55 PM, Rik Cabanier

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-13 Thread Robert O'Callahan
On Thu, Feb 14, 2013 at 5:16 PM, Rik Cabanier caban...@gmail.com wrote: Looking at the WebKit implementation, I'm unsure how 'opaque' can implemented for accelerated canvas. It might work with non-accelerated canvas but would have to run some experiments. I also look at mozilla's Core

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-13 Thread Rik Cabanier
On Thu, Feb 14, 2013 at 3:35 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Thu, Feb 14, 2013 at 5:16 PM, Rik Cabanier caban...@gmail.com wrote: Looking at the WebKit implementation, I'm unsure how 'opaque' can implemented for accelerated canvas. It might work with non-accelerated

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-12 Thread Stephen White
On Fri, Nov 23, 2012 at 6:04 PM, Ian Hickson i...@hixie.ch wrote: On Thu, 29 Mar 2012, Jeremy Apthorp wrote: On Thu, Mar 29, 2012 at 10:25 AM, Jeremy Apthorp jere...@chromium.org wrote: On Thu, Mar 29, 2012 at 8:41 AM, Ian Hickson i...@hixie.ch wrote: On Fri, 13 Jan 2012, Jeremy Apthorp

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2013-02-12 Thread Rik Cabanier
On Tue, Feb 12, 2013 at 2:56 PM, Stephen White senorbla...@chromium.orgwrote: On Fri, Nov 23, 2012 at 6:04 PM, Ian Hickson i...@hixie.ch wrote: On Thu, 29 Mar 2012, Jeremy Apthorp wrote: On Thu, Mar 29, 2012 at 10:25 AM, Jeremy Apthorp jere...@chromium.org wrote: On Thu, Mar 29, 2012

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2012-11-26 Thread Robert O'Callahan
It's hard to analyze your use-case without knowing what it is. For some kinds of large data model applications, I can think of DOM-based implementation techniques that might be a lot more performant than those you have mentioned. I agree that this is a very challenging domain. Rob -- Jesus

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2012-11-26 Thread Tab Atkins Jr.
On Sat, Nov 24, 2012 at 7:10 PM, Adam Barth w...@adambarth.com wrote: 2) Remarkably, the current best candidate is a rendering pipeline that attempts to use the DOM in immediate mode. The application performs some application-specific processing to determine which portions of the model can

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

2012-11-24 Thread Adam Barth
On Fri, Nov 23, 2012 at 3:04 PM, Ian Hickson i...@hixie.ch wrote: On Mon, 12 Nov 2012, Justin Novosad wrote: For many types of apps, DOM-based rendering is uncompetitively slow [so we should make text rendering in canvas more controllable] This seems like something we should fix, not

[whatwg] Enabling LCD Text and antialiasing in canvas

2012-11-23 Thread Ian Hickson
On Thu, 29 Mar 2012, Jeremy Apthorp wrote: On Thu, Mar 29, 2012 at 10:25 AM, Jeremy Apthorp jere...@chromium.orgwrote: On Thu, Mar 29, 2012 at 8:41 AM, Ian Hickson i...@hixie.ch wrote: On Fri, 13 Jan 2012, Jeremy Apthorp wrote: I'd like to draw non-antialiased lines in a canvas.