diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-10-10 16:39:02 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-10-11 08:48:54 +0100 |
commit | 5b6575bdded4b24ec1c9515203f44798225c10b6 (patch) | |
tree | 445945fac2bc9878b32335b688c8827ddadc85bf /src/sna/gen5_render.c | |
parent | c5414ec992d935e10156a2b513d5ec2dded2f689 (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/gen5_render.c')
-rw-r--r-- | src/sna/gen5_render.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c index ad27d908..ab30c9c8 100644 --- a/src/sna/gen5_render.c +++ b/src/sna/gen5_render.c @@ -1486,6 +1486,31 @@ gen5_render_composite_blt(struct sna *sna, op->prim_emit(sna, op, r); } +fastcall static void +gen5_render_composite_box(struct sna *sna, + const struct sna_composite_op *op, + const BoxRec *box) +{ + struct sna_composite_rectangles r; + + DBG((" %s: (%d, %d), (%d, %d)\n", + __FUNCTION__, + box->x1, box->y1, box->x2, box->y2)); + + if (!gen5_get_rectangles(sna, op, 1)) { + gen5_bind_surfaces(sna, op); + gen5_get_rectangles(sna, op, 1); + } + + r.dst.x = box->x1; + r.dst.y = box->y1; + r.width = box->x2 - box->x1; + r.height = box->y2 - box->y1; + r.mask = r.src = r.dst; + + op->prim_emit(sna, op, &r); +} + static void gen5_render_composite_boxes(struct sna *sna, const struct sna_composite_op *op, @@ -2040,6 +2065,7 @@ gen5_render_composite(struct sna *sna, tmp->u.gen5.ve_id = (tmp->mask.bo != NULL) << 1 | tmp->is_affine; tmp->blt = gen5_render_composite_blt; + tmp->box = gen5_render_composite_box; tmp->boxes = gen5_render_composite_boxes; tmp->done = gen5_render_composite_done; |