Intent to Implement : antialiased clipping in canvas (for real this time)

38 views
Skip to first unread message

Robert Phillips

unread,
Oct 13, 2014, 1:15:48 PM10/13/14
to blin...@chromium.org

Contact emails


Spec


The spec seems intentionally vague regarding the antialiasing of clips so Blink isn't doing anything non-compliant but, performing antialiased draws but aliased clipping seems contrary to end-user expectations.

Summary
Change the behavior of Canvas clipping to be antialiased. Initially behind a flag to allow switching the behavior of the canvas element.

Motivation
Many web developers would like antialiased clipping in canvas so their canvas graphics will look better. Most other browsers already provide antialiased canvas clipping.

Compatibility Risk

It appears that most other browsers already support antialiased canvas clipping.

Ongoing technical constraints

None.

Will this feature be supported on all five Blink platforms (Windows, Mac, Linux, Chrome OS and Android)?
Yes - Skia supports antialiased clipping on all of these platforms.

OWP launch tracking bug?


Link to entry on the feature dashboard

Requesting approval to ship?
No



Philip Rogers

unread,
Oct 13, 2014, 1:23:08 PM10/13/14
to Robert Phillips, blink-dev
This seems like a clear win: it's a better user experience and improves interoperability. Is there a reason not to ship this too?

Dirk Schulze

unread,
Oct 13, 2014, 1:28:05 PM10/13/14
to Philip Rogers, Robert Phillips, blink-dev
Hi Philip,

IIRC all browsers but Chrome do anitaliased clipping by default. Even without an switch to non-antialiased clipping.

How do you plan to change that in Blink? Will there be a flag to switch between one and the other clipping?

Most web developers want antialiased clipping. However, if there are compelling use cases for having both, could you start a thread on WHATWG mailing list and bring this up please?

Greetings,
Dirk

Robert Phillips

unread,
Oct 13, 2014, 1:30:21 PM10/13/14
to Philip Rogers, blink-dev
There is a bit more work that needs to be done on the Skia-side to ensure that we don't see any performance degradation (esp. for concave path clips). So, I would like to keep it behind a flag until we ensure that it is ready to go.

Ian Hickson

unread,
Oct 14, 2014, 12:12:02 PM10/14/14
to Robert Phillips, blin...@chromium.org
On Mon, 13 Oct 2014, 'Robert Phillips' via blink-dev wrote:
>
> Spec
> http://www.w3.org/TR/2dcontext/

Note that a much more up to date spec is at:

http://html.spec.whatwg.org/multipage#2dcontext

I would not recommend using the W3C version.

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