summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-11-08 16:30:22 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-11-08 18:12:05 +0000
commit4b100b099a4d5877c79989e8b3b4ffcd3aa2306f (patch)
tree0eb0d2c9caa145e9727e0616602e4446db8973fe /src
parent7b95f87b26675af3a1923fef824c45e087098d61 (diff)
sna: Convert stippled spans to rects
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_accel.c60
1 files changed, 37 insertions, 23 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index b9b82cc1..d5723eeb 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2620,11 +2620,18 @@ sna_spans_extents(DrawablePtr drawable, GCPtr gc,
}
static Bool
-sna_poly_fill_rect_tiled(DrawablePtr drawable,
- struct kgem_bo *bo,
- struct sna_damage **damage,
- GCPtr gc, int n, xRectangle *rect,
- const BoxRec *extents, unsigned clipped);
+sna_poly_fill_rect_tiled_blt(DrawablePtr drawable,
+ struct kgem_bo *bo,
+ struct sna_damage **damage,
+ GCPtr gc, int n, xRectangle *rect,
+ const BoxRec *extents, unsigned clipped);
+
+static bool
+sna_poly_fill_rect_stippled_blt(DrawablePtr drawable,
+ struct kgem_bo *bo,
+ struct sna_damage **damage,
+ GCPtr gc, int n, xRectangle *rect,
+ const BoxRec *extents, unsigned clipped);
static bool
can_fill_spans(DrawablePtr drawable, GCPtr gc)
@@ -2692,7 +2699,7 @@ sna_fill_spans(DrawablePtr drawable, GCPtr gc, int n,
gc, n, pt, width, sorted,
&region.extents, flags & 2))
return;
- } else if (gc->fillStyle == FillTiled) {
+ } else {
struct sna_pixmap *priv = sna_pixmap_from_drawable(drawable);
struct sna_damage **damage;
@@ -2714,10 +2721,17 @@ sna_fill_spans(DrawablePtr drawable, GCPtr gc, int n,
rect[i].height = 1;
}
- i = sna_poly_fill_rect_tiled(drawable,
- priv->gpu_bo, damage,
- gc, n, rect,
- &region.extents, flags & 2);
+ if (gc->fillStyle == FillTiled) {
+ i = sna_poly_fill_rect_tiled_blt(drawable,
+ priv->gpu_bo, damage,
+ gc, n, rect,
+ &region.extents, flags & 2);
+ } else {
+ i = sna_poly_fill_rect_stippled_blt(drawable,
+ priv->gpu_bo, damage,
+ gc, n, rect,
+ &region.extents, flags & 2);
+ }
free (rect);
if (i)
@@ -5770,11 +5784,11 @@ get_pixel(PixmapPtr pixmap)
}
static Bool
-sna_poly_fill_rect_tiled(DrawablePtr drawable,
- struct kgem_bo *bo,
- struct sna_damage **damage,
- GCPtr gc, int n, xRectangle *rect,
- const BoxRec *extents, unsigned clipped)
+sna_poly_fill_rect_tiled_blt(DrawablePtr drawable,
+ struct kgem_bo *bo,
+ struct sna_damage **damage,
+ GCPtr gc, int n, xRectangle *rect,
+ const BoxRec *extents, unsigned clipped)
{
struct sna *sna = to_sna_from_drawable(drawable);
PixmapPtr pixmap = get_drawable_pixmap(drawable);
@@ -6743,17 +6757,17 @@ sna_poly_fill_rect(DrawablePtr draw, GCPtr gc, int n, xRectangle *rect)
DBG(("%s: tiled fill, testing for blt\n", __FUNCTION__));
if (sna_drawable_use_gpu_bo(draw, &region.extents, &damage) &&
- sna_poly_fill_rect_tiled(draw,
- priv->gpu_bo, damage,
- gc, n, rect,
- &region.extents, flags & 2))
+ sna_poly_fill_rect_tiled_blt(draw,
+ priv->gpu_bo, damage,
+ gc, n, rect,
+ &region.extents, flags & 2))
return;
if (sna_drawable_use_cpu_bo(draw, &region.extents, &damage) &&
- sna_poly_fill_rect_tiled(draw,
- priv->cpu_bo, damage,
- gc, n, rect,
- &region.extents, flags & 2))
+ sna_poly_fill_rect_tiled_blt(draw,
+ priv->cpu_bo, damage,
+ gc, n, rect,
+ &region.extents, flags & 2))
return;
} else {
struct sna_pixmap *priv = sna_pixmap_from_drawable(draw);