[XRender] Howto draw a hairline-trapezoid?
Clemens Eisserer
linuxhippy at gmail.com
Mon Jun 2 08:30:28 PDT 2008
Hello Glynn,
Thanks a lot for the hint with line_width.
Yes, I was using a zero line width, after setting it to 1 I get the
same results as with XRender, it seems the Intel-Driver was
responsible for th nice lines and not XDrawLine.
Is there any way for getting "nice lines" with XRender, without
emmiting many many small trapezoids?
Thanks a lot, lg Clemens
> What line width are you using for XDrawLine()? Zero or one?
>
> The rendering of zero-width lines by XDrawLine() can vary between
> drivers. The XChangeGC() manual page says:
>
> Thin lines (zero line-width) are one-pixel-wide lines drawn using an
> unspecified, device-dependent algorithm. There are only two con-
> straints on this algorithm.
>
> 1. If a line is drawn unclipped from [x1,y1] to [x2,y2] and if
> another line is drawn unclipped from [x1+dx,y1+dy] to
> [x2+dx,y2+dy], a point [x,y] is touched by drawing the first line
> if and only if the point [x+dx,y+dy] is touched by drawing the
> second line.
>
> 2. The effective set of points comprising a line cannot be affected
> by clipping. That is, a point is touched in a clipped line if and
> only if the point lies inside the clipping region and the point
> would be touched by the line when drawn unclipped.
>
> A wide line drawn from [x1,y1] to [x2,y2] always draws the same pixels
> as a wide line drawn from [x2,y2] to [x1,y1], not counting cap-style
> and join-style. It is recommended that this property be true for thin
> lines, but this is not required. A line-width of zero may differ from
> a line-width of one in which pixels are drawn. This permits the use of
> many manufacturers' line drawing hardware, which may run many times
> faster than the more precisely specified wide lines.
>
> --
> Glynn Clements <glynn at gclements.plus.com>
>
More information about the xorg
mailing list