summaryrefslogtreecommitdiff
path: root/src/sna/gen7_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/gen7_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/gen7_render.c')
-rw-r--r--src/sna/gen7_render.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index 16c14621..ae773206 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -2870,6 +2870,32 @@ gen7_render_fill_blt(struct sna *sna,
OUT_VERTEX_F(0);
}
+fastcall static void
+gen7_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 (!gen7_get_rectangles(sna, &op->base, 1)) {
+ gen7_emit_fill_state(sna, &op->base);
+ gen7_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
gen7_render_fill_done(struct sna *sna, const struct sna_fill_op *op)
{
@@ -2941,6 +2967,7 @@ gen7_render_fill(struct sna *sna, uint8_t alu,
gen7_align_vertex(sna, &op->base);
op->blt = gen7_render_fill_blt;
+ op->box = gen7_render_fill_box;
op->done = gen7_render_fill_done;
return TRUE;
}