Re: Properties of Custom Paint

On Wed, May 20, 2015 at 5:53 AM Amelia Bellamy-Royds <
amelia.bellamy.royds@gmail.com> wrote:

> 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.
>

It isn't the end goal. The Houdini "custom paint" idea is about being part
of the CSS style computation / layout / paint pipeline. It's not
particularly relevant to SVG because SVG doesn't really have this pipeline.

Sincerely,
    -Shane Stephens


>
> 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 20:05:51 UTC