<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Bug rendering lines of a certain length"
href="https://bugs.freedesktop.org/show_bug.cgi?id=103840#c8">Comment # 8</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Bug rendering lines of a certain length"
href="https://bugs.freedesktop.org/show_bug.cgi?id=103840">bug 103840</a>
from <span class="vcard"><a class="email" href="mailto:psychon@znc.in" title="Uli Schlachter <psychon@znc.in>"> <span class="fn">Uli Schlachter</span></a>
</span></b>
<pre>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):
<span class="quote">> left from (200000,-0.25) to (-200000,299.75)
> right from (200000,0.25) to (-200000,300.25)
> top=0.25
> bottom=299.75</span >
and this is the computed, supposedly equivalent trap:
<span class="quote">> 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</span >
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`.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>