W3C home > Mailing lists > Public > public-houdini@w3.org > May 2015

Re: Properties of Custom Paint

From: Amelia Bellamy-Royds <amelia.bellamy.royds@gmail.com>
Date: Tue, 19 May 2015 13:52:30 -0600
Message-ID: <CAFDDJ7z8E-FK4ZC6-bYBpXj6DDa38+WSsRpD6sxFOLKxr7_wSQ@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>, "public-houdini@w3.org" <public-houdini@w3.org>
Cc: Ian Kilpatrick <ikilpatrick@chromium.org>
Even better!

So this could potentially address lots of the live path effects features
that the Inkscape team has been implementing: draw a shape with a sketchy
outline that doesn't quite line up with the geometric shape, or with
variable-width strokes, or all sorts of fun things where the rendered
output is calculated as an extension of the basic shape.

However, if that's the end goal then I think it should be more clearly
spelled out on Ian's list.

If you want to be able to paint an extra effect on an element, you don't
want to have to re-write all the code for rendering the basic features.  So
you need to be able to access the current rendering process as a series of
calls, so that you can replace any of them, modify any of them (e.g., take
the result of the browser's draw-border routine and apply a graphical
effect to it), or insert a new call anywhere in the list.

I think this is what the "Custom paint augments existing elements in the
DOM" point is getting at.  But it's more than just augmenting the existing
DOM elements -- it's about augmenting the existing rendering model.  A
filter augments the existing DOM element, but only after the browser has
rendered and rasterized it.  If you wanted to add a border-filter property,
you need a greater granularity of control.

ABR

On 19 May 2015 at 12:57, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>
>
> Custom Paint actually goes quite a bit past "custom paint servers".
> It's more like, say, what if box-shadow didn't exist, and you wanted
> to draw a shadow on a box.  Or say underlines didn't exist, and you
> wanted to add them.  Today, these are possible, but *incredibly*
> hacky, requiring additional elements and some dumb stuff; Custom Paint
> lets you affect how these elements paint and add
> shadows/underlines/anything else.
>
> Custom Paint Servers are easy, and already done in spec - just use
> <canvas> to draw them, and use element() in CSS to reference them.
> This is available today in Firefox via -moz-element().
>
> ~TJ
>
Received on Tuesday, 19 May 2015 19:53:02 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 19 May 2015 19:53:03 UTC