draw: fix line stippling
authorRoland Scheidegger <sroland@vmware.com>
Tue, 15 Mar 2016 18:40:44 +0000 (19:40 +0100)
committerRoland Scheidegger <sroland@vmware.com>
Tue, 15 Mar 2016 18:41:34 +0000 (19:41 +0100)
commit12a4f0bed6ff03031587e1eb6d69f18b131f5655
tree955238b811132aa9c25f1f7af61df62253c04a8a
parent4b249ed4cd813fa71e3b4a9457b365cc5dcbc3a1
draw: fix line stippling

The logic was comparing actual ints, not true/false values.
This meant that it was emitting always multiple line segments instead of just
one even if the stipple test had the same result, which looks inefficient, and
the segments also overlapped thus breaking line aa as well.
(In practice, with the no-op default line stipple pattern, for a 10-pixel
long line from 0-9 it was emitting 10 segments, with the individual segments
ranging from 0-1, 0-2, 0-3 and so on.)

This fixes https://bugs.freedesktop.org/show_bug.cgi?id=94193

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
CC: <mesa-stable@lists.freedesktop.org>
src/gallium/auxiliary/draw/draw_pipe_stipple.c