W3C home > Mailing lists > Public > www-style@w3.org > January 2010

Re: [css3-background] border-radius color transitions using gradients recommended but undefined

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Wed, 27 Jan 2010 19:32:34 -0800
Message-ID: <4B610552.4090304@terrainformatica.com>
To: Zack Weinberg <zweinberg@mozilla.com>
CC: "www-style@w3.org" <www-style@w3.org>, Brian Manthos <brianman@microsoft.com>
Zack Weinberg wrote:
> Andrew Fedoniouk <news@terrainformatica.com> wrote:
>> Zack Weinberg wrote:
>>> Andrew Fedoniouk <news@terrainformatica.com> wrote:
>>>> There are actually not too many alternatives.
>>>> The most viable solution is to a) use conic gradient 
>>> How are you drawing the conic gradients?  I've not been able to find
>>> them as an accelerated primitive on any common OS.
>> Sciter and HTMLayout (h-smile core) are using AGG [1] for such things.
>> So that part is implemented in code generating such bitmaps.
> AGG as in Anti-Grain Geometry [ http://www.antigrain.com/ ]? I'll have
> a look at that when I get a chance.

Correct, it is Anti-Grain Geometry library of Maxim Schemanarev.

>> (D) case on your image require non-trivial gradient function.
>> Angle of that dark green sector will not be of 90deg and color
>> spread function is not a linear interpolation of end points.
>> That reduces optimization options to nothing. E.g. in my case
>> it is possible to pre-compute map once and to use it for all border
>> transitions no matter what color they will have.
> I'd rather take a performance hit in case 10 (which will be rare in
> practice, I think) than produce a rendering that looks like the browser
> has a bug in it.  Which is my reaction to a situation where there's a
> sharp inner corner but it isn't the center of the gradient cone, or the
> gradient fails to extend to the limits of the outer arc.

Think about transitions from inset to outset border style.
Someone may think that one of cases here:
is a bug.

We just need to define *reasonable* schema that looks OK in typical use 
cases. That schema should be known as having effective implementation as
high CPU consumption is a bug too. Tradeoffs as usual, sigh.

Andrew Fedoniouk.

Received on Thursday, 28 January 2010 03:32:57 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:13:42 UTC