From 855c45c65a69d34ad32a97a5fc54dd09d40d3e26 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 24 Jan 2012 18:48:17 +0000 Subject: [PATCH] sna: Enable clipping for mi FillSpans gpu callback The mi routines do not ensure that their output is suitably constrained to the clip extents, so we must run it through the clipper. Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 01b44a01..cadd1c96 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -4389,11 +4389,15 @@ sna_fill_spans__gpu(DrawablePtr drawable, GCPtr gc, int n, if (n == 0) return; + /* The mi routines do not attempt to keep the spans it generates + * within the clip, so we must run them through the clipper. + */ + if (gc_is_solid(gc, &color)) { sna_fill_spans_blt(drawable, - data->bo, data->damage, + data->bo, NULL, gc, color, n, pt, width, sorted, - &data->region.extents, data->flags & 2); + &data->region.extents, 2); } else { /* Try converting these to a set of rectangles instead */ xRectangle *rect; @@ -4414,16 +4418,14 @@ sna_fill_spans__gpu(DrawablePtr drawable, GCPtr gc, int n, if (gc->fillStyle == FillTiled) { sna_poly_fill_rect_tiled_blt(drawable, - data->bo, data->damage, + data->bo, NULL, gc, n, rect, - &data->region.extents, - data->flags & 2); + &data->region.extents, 2); } else { sna_poly_fill_rect_stippled_blt(drawable, - data->bo, data->damage, + data->bo, NULL, gc, n, rect, - &data->region.extents, - data->flags & 2); + &data->region.extents, 2); } free (rect); }