glamor: explicitly draw endpoints of line segments

The OpenGL 4.6 specification §14.5.1 "Basic Line Rasterization"
figure 14.2 says:

"""A diamond shaped region of height 1 is placed around each fragment
center; those regions that the line segment **exits** cause
rasterization to produce corresponding fragments."""

As the line does not necessarily exit the last diamond,
it is necessary to explicitly paint a pixel at line ends.

Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1434
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1755>
This commit is contained in:
Jan Engelhardt 2024-12-30 17:10:35 +01:00 committed by Marge Bot
parent 6fad884ce7
commit 530e80375e

View File

@ -115,6 +115,7 @@ glamor_poly_lines_solid_gl(DrawablePtr drawable, GCPtr gc,
box->y2 - box->y1);
box++;
glDrawArrays(GL_LINE_STRIP, 0, n + add_last);
glDrawArrays(GL_POINTS, 0, n + add_last);
}
}