summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-10-29 12:53:15 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-10-29 13:42:54 +0100
commit33383fde55609fb4bd372d2d41a6254799499225 (patch)
tree618e0fd8413cb80c06bc0d1bdbdc3b5c3fc04ca8
parent64a57c8dbec81f6420ff032985237eb16cebfb87 (diff)
sna: Tweak PolyRectangle blitting
A box of height/width 1 and lineWidth 0 can also be drawn with a single box as the far edge is contiguous with far side of the near edge. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 096e458a..3eb0d856 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4182,7 +4182,7 @@ sna_poly_rectangle_blt(DrawablePtr drawable,
get_drawable_deltas(drawable, pixmap, &dx, &dy);
v = !!clipped;
- v |= (gc->lineWidth != 0) << 1;
+ v |= (gc->lineWidth <= 1) << 1;
goto *jump[v];
zero:
@@ -4201,7 +4201,7 @@ zero:
b = boxes;
}
- if (rr.width <= 1 || rr.height <= 1) {
+ if (rr.width <= 2 || rr.height <= 2) {
b->x1 = rr.x;
b->y1 = rr.y;
b->x2 = rr.x + rr.width + 1;
@@ -4254,11 +4254,11 @@ zero_clipped:
rr.x += drawable->x;
rr.y += drawable->y;
- if (rr.width <= 1 || rr.height <= 1) {
+ if (rr.width <= 2 || rr.height <= 2) {
box[0].x1 = rr.x;
box[0].y1 = rr.y;
box[0].x2 = rr.x + rr.width + 1;
- box[0].y2 = rr.y + r->height + 1;
+ box[0].y2 = rr.y + rr.height + 1;
count = 1;
} else {
box[0].x1 = rr.x;
@@ -4312,11 +4312,11 @@ zero_clipped:
rr.x += drawable->x;
rr.y += drawable->y;
- if (rr.width <= 1 || rr.height <= 1) {
+ if (rr.width <= 2 || rr.height <= 2) {
box[0].x1 = rr.x;
box[0].y1 = rr.y;
box[0].x2 = rr.x + rr.width + 1;
- box[0].y2 = rr.y + r->height + 1;
+ box[0].y2 = rr.y + rr.height + 1;
count = 1;
} else {
box[0].x1 = rr.x;
@@ -4383,7 +4383,7 @@ wide_clipped:
rr.x += drawable->x;
rr.y += drawable->y;
- if (rr.height < offset2 || rr.width < offset1) {
+ if (rr.height <= offset2 || rr.width <= offset2) {
if (rr.height == 0) {
box[0].x1 = rr.x;
box[0].x2 = rr.x + rr.width + 1;
@@ -4452,7 +4452,7 @@ wide_clipped:
rr.x += drawable->x;
rr.y += drawable->y;
- if (rr.height < offset2 || rr.width < offset1) {
+ if (rr.height <= offset2 || rr.width <= offset2) {
if (rr.height == 0) {
box[0].x1 = rr.x;
box[0].x2 = rr.x + rr.width + 1;
@@ -4531,7 +4531,7 @@ wide:
b = boxes;
}
- if (rr.height < offset2 || rr.width < offset1) {
+ if (rr.height <= offset2 || rr.width <= offset2) {
if (rr.height == 0) {
b->x1 = rr.x;
b->x2 = rr.x + rr.width + 1;