[cairo-bugs] [Bug 40918] Radial gradients misrendered if focus is exactly on the outer circle

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Sep 16 21:01:49 PDT 2011


https://bugs.freedesktop.org/show_bug.cgi?id=40918

--- Comment #10 from Andrea Canciani <ranma42 at gmail.com> 2011-09-16 21:01:47 PDT ---
(In reply to comment #9)
> (In reply to comment #8)
> > In this case you can simply paint the plane with solid color (the "outer
> > color") and then draw the radial gradient. This should ensure that no part
> > stays clear.
> 
> In general this is not possible. If any stop of the gradient is not fully
> opaque, the result would be incorrect. Painting with the SOURCE operator might
> fix this, but then every shape with a radial gradient would have to be rendered
> to a separate group.

Yes, this looks like the right thing to do.

> 
> Isn't it possible to round the focus coordinates towards the center of the
> outer circle rather than in some arbitrary direction? Maybe provide a new

It is possible, but the application should be doing it, not cairo (cairo has no
means to know whether you wanted the focus point to be inside or outside the
circle, it just tries to respect the input).
The application could move the focus point slightly inside the outer circle in
order to (try to) avoid the rounding issues, but the problem is ill-conditioned
when the focus is almost on the outer circle, so the behavior you see is
actually the expected one.

> extend mode which would paint the half-plane which is now left transparent with
> the color of the outer circle?

This would be possible, but it would be quite pointless, because you would need
an API change and every backend (except maybe image with a future pixman) would
have to fallback and perform the separate group trick. I see no advantage in
extending the API to support this ad-hoc extend mode given that it can easily
be reproduced using existing gradients.

Anyway, could you please try to describe the extend mode you would like to add
and what the behavior for a radial gradient in generic position would be? Would
this new extend mode also provide a new rasterization type for other pattern
types as well?

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the cairo-bugs mailing list