[PATCH] Document invalid nStop value

Andrea Canciani ranma42 at gmail.com
Thu Nov 4 01:32:44 PDT 2010


On Thu, Nov 4, 2010 at 9:20 AM, Andrea Canciani <ranma42 at gmail.com> wrote:
> On Thu, Nov 4, 2010 at 2:50 AM, Soeren Sandmann <sandmann at daimi.au.dk> wrote:
>> Andrea Canciani <ranma42 at gmail.com> writes:
>>
>>> Gradients must have at least one stop.
>>> ---
>>>  renderproto.txt |    6 ++++++
>>>  1 files changed, 6 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/renderproto.txt b/renderproto.txt
>>> index 9f1f231..f6a9884 100644
>>> --- a/renderproto.txt
>>> +++ b/renderproto.txt
>>> @@ -1089,6 +1089,8 @@ CreateLinearGradient
>>>       The gradient has nstops stop points between 0 and 1, each
>>>       having a stop color defined in stop_colors.
>>>
>>> +     If nStop is 0, a Value error is generated.
>>> +
>>
>> It's probably better to use the "nstops" spelling like the rest of the
>> protocol spec.
>
> Oops! You're right. The attached patch should be better.

Better, but not correct.
The new attachment fixes the name also in the commit message.
(Sorry for the noise)

>
>>
>> Also, while the change to allow one-stop gradients is good, shouldn't
>> the spec say what actually happens in that case?
>
> Yes/no. The spec doesn't explain at all what happens with the stops
> (for example what happens when the stops don't range from 0 to 1
> exactly). I think that if such an explanation existed, it would also solve
> the problem of the one-stop gradients.
> This would be more generic and very useful (last time I had to find out
> how this worked, I had to look at the code pixman instead of render
> spec), but can probably be a different patch.
>
> Andrea
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Document-invalid-nstops-value.patch
Type: application/octet-stream
Size: 1624 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20101104/ed18adeb/attachment.obj>


More information about the xorg-devel mailing list