Re: [whatwg] gradient edge case

2012-12-10 Thread Rik Cabanier
On Mon, Dec 10, 2012 at 8:45 PM, Ian Hickson  wrote:

> On Mon, 10 Dec 2012, Rik Cabanier wrote:
> >
> > yes, however it will be slower since the pattern has to be rendered two
> or
> > four times.
> > If you can reflect in x and y, you can calculate the pattern cell once
> and
> > then have your hardware do the tiling.
>
> If it's something that happens a lot, then certainly it makes sense to add
> it. But I've heard very few requests for this.


yeah, we (= Adobe) never implemented it natively in our graphics libraries
but other frameworks (such as xps from Microsoft) did.


Re: [whatwg] gradient edge case

2012-12-10 Thread Ian Hickson
On Mon, 10 Dec 2012, Rik Cabanier wrote:
> 
> yes, however it will be slower since the pattern has to be rendered two or
> four times.
> If you can reflect in x and y, you can calculate the pattern cell once and
> then have your hardware do the tiling.

If it's something that happens a lot, then certainly it makes sense to add 
it. But I've heard very few requests for this.

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


Re: [whatwg] gradient edge case

2012-12-10 Thread Rik Cabanier
On Mon, Dec 10, 2012 at 4:07 PM, Ian Hickson  wrote:

> On Sat, 1 Sep 2012, Rik Cabanier wrote:
> >
> > Currently the canvas spec specifies the following:
> >
> > If x0 = x1 and y0 = y1, then the linear gradient must paint nothing.
> >
> > and
> >
> > If x0 = x1 and y0 = y1 and r0 = r1, then the radial gradient must paint
> > nothing
> >
> > Why is this?
>
> At this point: it's what browsers (mostly) do.
>

If this is consistently implemented, it's probably OK.
This 'flicker' type of situations usually points to a problem with the
model.


>
>
> On Sat, 1 Sep 2012, David Dailey wrote:
> >
> > While on the topic, it seems like reflected linear gradients would be
> > quite handy -- insert an "edge" into the stop-sequence and then reflect
> > or repeat from there.
>
> Can't you just do that by listing the colours forwards and backwards?
>
>
> On Sat, 1 Sep 2012, Rik Cabanier wrote:
> >
> > Since Canvas has support for pattern, you could fairly easy emulate this
> > behavior.
> > I think it would be handy if you could add the 'reflect' idiom to
> patterns.
>
> Can't you just make the larger pattern and use that


yes, however it will be slower since the pattern has to be rendered two or
four times.
If you can reflect in x and y, you can calculate the pattern cell once and
then have your hardware do the tiling.


Re: [whatwg] gradient edge case

2012-12-10 Thread Ian Hickson
On Sat, 1 Sep 2012, Rik Cabanier wrote:
> 
> Currently the canvas spec specifies the following:
> 
> If x0 = x1 and y0 = y1, then the linear gradient must paint nothing.
> 
> and
> 
> If x0 = x1 and y0 = y1 and r0 = r1, then the radial gradient must paint 
> nothing
> 
> Why is this?

At this point: it's what browsers (mostly) do.


On Sat, 1 Sep 2012, David Dailey wrote:
>
> While on the topic, it seems like reflected linear gradients would be 
> quite handy -- insert an "edge" into the stop-sequence and then reflect 
> or repeat from there.

Can't you just do that by listing the colours forwards and backwards?


On Sat, 1 Sep 2012, Rik Cabanier wrote:
>
> Since Canvas has support for pattern, you could fairly easy emulate this
> behavior.
> I think it would be handy if you could add the 'reflect' idiom to patterns.

Can't you just make the larger pattern and use that?

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


Re: [whatwg] gradient edge case

2012-09-01 Thread Rik Cabanier
That trick would only work for axial repeating gradients.
For radial gradients, you can work around it by calculating the extra color
stops. (This is how we emulate this idiom in PDF)

Rik

On Sat, Sep 1, 2012 at 7:17 PM, Rik Cabanier  wrote:

> Since Canvas has support for pattern, you could fairly easy emulate this
> behavior.
> I think it would be handy if you could add the 'reflect' idiom to patterns.
>
> Rik
>
>
> On Sat, Sep 1, 2012 at 7:07 PM, David Dailey wrote:
>
>> While on the topic, it seems like reflected linear gradients would be
>> quite
>> handy -- insert an "edge" into the stop-sequence and then reflect or
>> repeat
>> from there.
>>
>> Cheers
>> David
>>
>> -Original Message-
>> From: whatwg-boun...@lists.whatwg.org
>> [mailto:whatwg-boun...@lists.whatwg.org] On Behalf Of Rik Cabanier
>> Sent: Saturday, September 01, 2012 9:59 PM
>> To: whatwg; public-canvas-...@w3.org
>> Subject: [whatwg] gradient edge case
>>
>> All,
>>
>> Currently the canvas spec specifies the following:
>>
>> If x0 = x1 and y0 = y1, then the linear gradient must paint nothing.
>>
>> and
>>
>> If x0 = x1 and y0 = y1 and r0 = r1, then the radial gradient must paint
>> nothing
>>
>> Why is this? It seems that the gradient should just be a line or circle
>> that
>> has the first colorstop's on the left/inside and the last colorstop's
>> color
>> on the right/outside.
>>
>> Rik
>>
>>
>>
>>
>


Re: [whatwg] gradient edge case

2012-09-01 Thread Rik Cabanier
Since Canvas has support for pattern, you could fairly easy emulate this
behavior.
I think it would be handy if you could add the 'reflect' idiom to patterns.

Rik

On Sat, Sep 1, 2012 at 7:07 PM, David Dailey wrote:

> While on the topic, it seems like reflected linear gradients would be quite
> handy -- insert an "edge" into the stop-sequence and then reflect or repeat
> from there.
>
> Cheers
> David
>
> -Original Message-
> From: whatwg-boun...@lists.whatwg.org
> [mailto:whatwg-boun...@lists.whatwg.org] On Behalf Of Rik Cabanier
> Sent: Saturday, September 01, 2012 9:59 PM
> To: whatwg; public-canvas-...@w3.org
> Subject: [whatwg] gradient edge case
>
> All,
>
> Currently the canvas spec specifies the following:
>
> If x0 = x1 and y0 = y1, then the linear gradient must paint nothing.
>
> and
>
> If x0 = x1 and y0 = y1 and r0 = r1, then the radial gradient must paint
> nothing
>
> Why is this? It seems that the gradient should just be a line or circle
> that
> has the first colorstop's on the left/inside and the last colorstop's color
> on the right/outside.
>
> Rik
>
>
>
>


Re: [whatwg] gradient edge case

2012-09-01 Thread David Dailey
While on the topic, it seems like reflected linear gradients would be quite
handy -- insert an "edge" into the stop-sequence and then reflect or repeat
from there.

Cheers
David

-Original Message-
From: whatwg-boun...@lists.whatwg.org
[mailto:whatwg-boun...@lists.whatwg.org] On Behalf Of Rik Cabanier
Sent: Saturday, September 01, 2012 9:59 PM
To: whatwg; public-canvas-...@w3.org
Subject: [whatwg] gradient edge case

All,

Currently the canvas spec specifies the following:

If x0 = x1 and y0 = y1, then the linear gradient must paint nothing.

and

If x0 = x1 and y0 = y1 and r0 = r1, then the radial gradient must paint
nothing

Why is this? It seems that the gradient should just be a line or circle that
has the first colorstop's on the left/inside and the last colorstop's color
on the right/outside.

Rik