From 530e80375ebbe825247646d5225e0ebb91f940cb Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 30 Dec 2024 17:10:35 +0100 Subject: [PATCH] glamor: explicitly draw endpoints of line segments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: --- glamor/glamor_lines.c | 1 + 1 file changed, 1 insertion(+) diff --git a/glamor/glamor_lines.c b/glamor/glamor_lines.c index c9b776bb5..8d6db3e4c 100644 --- a/glamor/glamor_lines.c +++ b/glamor/glamor_lines.c @@ -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); } }