summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-11-21 11:49:49 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-11-21 11:54:59 +0000
commitb0d64a9567d9cb749568448e4ce090b187308028 (patch)
treee1883e01e2367a7c0804ee5a31053daf01b5449f
parenta5353a7c1d1f02b887f61f543c8e4bd4e8bd104f (diff)
sna: Correct end-point adjustment for stippling PolySegment
Reported-by: Roman Jarosz <kedgedev@gmail.com> Reported-by: da_fox@mad.scientist.com Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43134 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index cfb32c60..0f41003b 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4162,20 +4162,20 @@ sna_poly_line(DrawablePtr drawable, GCPtr gc,
}
if (p1.x < p2.x) {
rect[i].x = p1.x;
- rect[i].width = p2.x - p1.x;
+ rect[i].width = p2.x - p1.x + 1;
} else if (p1.x > p2.x) {
rect[i].x = p2.x;
- rect[i].width = p1.x - p2.x;
+ rect[i].width = p1.x - p2.x + 1;
} else {
rect[i].x = p1.x;
rect[i].width = 1;
}
if (p1.y < p2.y) {
rect[i].y = p1.y;
- rect[i].height = p2.y - p1.y;
+ rect[i].height = p2.y - p1.y + 1;
} else if (p1.y > p2.y) {
rect[i].y = p2.y;
- rect[i].height = p1.y - p2.y;
+ rect[i].height = p1.y - p2.y + 1;
} else {
rect[i].y = p1.y;
rect[i].height = 1;
@@ -4984,7 +4984,7 @@ sna_poly_segment(DrawablePtr drawable, GCPtr gc, int n, xSegment *seg)
gc, n, seg, &region.extents, flags & 2))
return;
}
- } else if (flags &4) {
+ } else if (flags & 4) {
struct sna_pixmap *priv = sna_pixmap(pixmap);
struct sna_damage **damage;
@@ -5002,20 +5002,20 @@ sna_poly_segment(DrawablePtr drawable, GCPtr gc, int n, xSegment *seg)
for (i = 0; i < n; i++) {
if (seg[i].x1 < seg[i].x2) {
rect[i].x = seg[i].x1;
- rect[i].width = seg[i].x2 - seg[i].x1;
+ rect[i].width = seg[i].x2 - seg[i].x1 + 1;
} else if (seg[i].x1 > seg[i].x2) {
rect[i].x = seg[i].x2;
- rect[i].width = seg[i].x1 - seg[i].x2;
+ rect[i].width = seg[i].x1 - seg[i].x2 + 1;
} else {
rect[i].x = seg[i].x1;
rect[i].width = 1;
}
if (seg[i].y1 < seg[i].y2) {
rect[i].y = seg[i].y1;
- rect[i].height = seg[i].y2 - seg[i].y1;
+ rect[i].height = seg[i].y2 - seg[i].y1 + 1;
} else if (seg[i].x1 > seg[i].y2) {
rect[i].y = seg[i].y2;
- rect[i].height = seg[i].y1 - seg[i].y2;
+ rect[i].height = seg[i].y1 - seg[i].y2 + 1;
} else {
rect[i].y = seg[i].y1;
rect[i].height = 1;
@@ -5023,7 +5023,7 @@ sna_poly_segment(DrawablePtr drawable, GCPtr gc, int n, xSegment *seg)
/* don't paint last pixel */
if (gc->capStyle == CapNotLast) {
- if (seg->x1 == seg->x2)
+ if (seg[i].x1 == seg[i].x2)
rect[i].height--;
else
rect[i].width--;