summaryrefslogtreecommitdiff
path: root/src/sna/gen6_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-10-21 01:41:56 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-10-21 15:34:28 +0100
commit7e7759db4c1dbf8b782fab9b9ca95cfa1db6cf59 (patch)
treed310452bfbdd92ab3c8d10277c2e5f2ccb055318 /src/sna/gen6_render.c
parent98bca2dbb9c33c548b1d9789ddb633ae0389c8f1 (diff)
sna: Pass a BoxRec to the fill op
For many of the core drawing routines, passing a BoxRec for the fill is more convenient since they already have one generated by the clip intersection. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen6_render.c')
-rw-r--r--src/sna/gen6_render.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index badade09..fc2fc471 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -2720,6 +2720,32 @@ gen6_render_fill_blt(struct sna *sna,
OUT_VERTEX_F(0);
}
+fastcall static void
+gen6_render_fill_box(struct sna *sna,
+ const struct sna_fill_op *op,
+ const BoxRec *box)
+{
+ DBG(("%s: (%d, %d),(%d, %d)\n", __FUNCTION__,
+ box->x1, box->y1, box->x2, box->y2));
+
+ if (!gen6_get_rectangles(sna, &op->base, 1)) {
+ gen6_emit_fill_state(sna, &op->base);
+ gen6_get_rectangles(sna, &op->base, 1);
+ }
+
+ OUT_VERTEX(box->x2, box->y2);
+ OUT_VERTEX_F(1);
+ OUT_VERTEX_F(1);
+
+ OUT_VERTEX(box->x1, box->y2);
+ OUT_VERTEX_F(0);
+ OUT_VERTEX_F(1);
+
+ OUT_VERTEX(box->x1, box->y1);
+ OUT_VERTEX_F(0);
+ OUT_VERTEX_F(0);
+}
+
static void
gen6_render_fill_done(struct sna *sna, const struct sna_fill_op *op)
{
@@ -2791,6 +2817,7 @@ gen6_render_fill(struct sna *sna, uint8_t alu,
gen6_align_vertex(sna, &op->base);
op->blt = gen6_render_fill_blt;
+ op->box = gen6_render_fill_box;
op->done = gen6_render_fill_done;
return TRUE;
}