[cairo-bugs] [Bug 103840] Bug rendering lines of a certain length

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Nov 22 19:17:45 UTC 2017


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

--- Comment #8 from Uli Schlachter <psychon at znc.in> ---
I found something. The problem seems to come from `composite_traps` in
`cairo-xlib-render-compositor.c`. The X11 protocol uses a 16.16 representation
for traps coordinates (32 bit fixed point with 16 bit fractional part).
However, the numbers that are passed in are not representable in 16.16 format.
There is code for handling that (`line_exceeds_16_16()` and
`project_line_x_onto_16_16`), but apparently its precision is not all that
great.

This trap is passed in (it's the main part of "what is going on"; there are two
other traps generated by `_cairo_traps_tessellate_convex_quad()`, but they are
outside of the visible area):

> left from (200000,-0.25) to (-200000,299.75)
> right from (200000,0.25) to (-200000,300.25)
> top=0.25
> bottom=299.75

and this is the computed, supposedly equivalent trap:

> left from (2725.33,0.25) to (-3392,299.75)
> right from (3392,0.25) to (-2725.33,299.75)
> top=0.25
> bottom=299.75

If my math (and my calculator) is not wrong, the left line of the first trap
has an "anti-slope" (delta x / delta y) of 400000 while the result's left line
has a slope of.... about 20?

@Matthew: Try adding cairo_set_antialias(cr, CAIRO_ANTIALIAS_BEST) to your test
case (btw: thanks for the nice test case!) and drawing the line once before and
once afterwards (e.g. in red and blue). The results look quite different.

Now we just need someone with the time (sorry, my time for now is up) and
knowledge to figure out how to fix `project_line_onto_16_16`.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo-bugs/attachments/20171122/5454acb0/attachment.html>


More information about the cairo-bugs mailing list