summaryrefslogtreecommitdiff
path: root/src/sna/gen2_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-10-10 16:39:02 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-10-11 08:48:54 +0100
commit5b6575bdded4b24ec1c9515203f44798225c10b6 (patch)
tree445945fac2bc9878b32335b688c8827ddadc85bf /src/sna/gen2_render.c
parentc5414ec992d935e10156a2b513d5ec2dded2f689 (diff)
sna: Support a fast composite hook for solitary boxes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen2_render.c')
-rw-r--r--src/sna/gen2_render.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index 935dffe8..c0d357d9 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -950,6 +950,31 @@ gen2_render_composite_blt(struct sna *sna,
op->prim_emit(sna, op, r);
}
+fastcall static void
+gen2_render_composite_box(struct sna *sna,
+ const struct sna_composite_op *op,
+ const BoxRec *box)
+{
+ struct sna_composite_rectangles r;
+
+ if (!gen2_get_rectangles(sna, op, 1)) {
+ gen2_emit_composite_state(sna, op);
+ gen2_get_rectangles(sna, op, 1);
+ }
+
+ DBG((" %s: (%d, %d) x (%d, %d)\n", __FUNCTION__,
+ box->x1, box->y1,
+ box->x2 - box->x1,
+ box->y2 - box->y1));
+
+ r.dst.x = box->x1; r.dst.y = box->y1;
+ r.width = box->x2 - box->x1;
+ r.height = box->y2 - box->y1;
+ r.src = r.mask = r.dst;
+
+ op->prim_emit(sna, op, &r);
+}
+
static void
gen2_render_composite_boxes(struct sna *sna,
const struct sna_composite_op *op,
@@ -1344,6 +1369,7 @@ gen2_render_composite(struct sna *sna,
}
tmp->blt = gen2_render_composite_blt;
+ tmp->box = gen2_render_composite_box;
tmp->boxes = gen2_render_composite_boxes;
tmp->done = gen2_render_composite_done;