[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 14:33:20 PDT 2011
https://bugs.freedesktop.org/show_bug.cgi?id=40918
--- Comment #8 from Andrea Canciani <ranma42 at gmail.com> 2011-09-16 14:33:17 PDT ---
(In reply to comment #7)
> (In reply to comment #4)
> > Sorry, I just realized that maybe what you're actually reporting is that
> > sometimes you do not see the red part, not that sometimes the gradient covers
> > an half-plane, sometimes the whole plane.
>
> This looks better, but the transparent area at the top right is still a
> problem. I would have to fill it with a separate paint operation. Additionally,
> I would need to reverse the order of stops.
>
> Why is the order of circles not a problem for infocus* gradients, but suddenly
> starts to matter for outfocus ones? Is there actually a situation where the
> rendering from my testcase is preferred over the one from yours?
Radial gradients are drawn following the PDF specification, i.e. along the
direction from the start circle to the end one, using the [0,1] parameter range
for NONE extend and the (-inf, +inf) for other modes (with the additional
condition that circles with negative radiuses are not drawn).
The rendering from your testcase is preferred whenever it is the desired one
(example: when doing PDF gradients instead of SVG ones, that is the correct
rendering for your input data).
>
> By the way - the problem could be solved without any magic by just filling the
> half-plane which is now left transparent with the outer color of the gradient.
> There would then be a smooth transition between outfocus and infocus gradients.
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.
>
> * - I invented "outfocus" as an abbreviation for "gradient with focus / inner
> circle outside the outer circle" and "infocus" for "gradient with focus / inner
> circle inside the outer circle"
--
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