summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2015-06-02 13:51:56 +0100
committerRussell King <rmk@arm.linux.org.uk>2015-06-29 12:58:34 +0100
commitdc262e52f532b4bff891caed9dbadf7828a04e3b (patch)
treef9d126f2a8f1f92907355163ac112793b4b50b42
parent5ff3645997ccf4aaaeebe2fec7d7855108843548 (diff)
etnaviv: convert glyph rendering code to use source origin de op
When glyphs are coming from the glyph cache, it's common for them to have the same source. Since the destination is constant, we can save the setup time for each glyph, and only compute the source origin and destination box. Convert the glyph rendering to this model. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r--etnaviv/etnaviv_accel.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/etnaviv/etnaviv_accel.c b/etnaviv/etnaviv_accel.c
index 112d472..3600366 100644
--- a/etnaviv/etnaviv_accel.c
+++ b/etnaviv/etnaviv_accel.c
@@ -1943,13 +1943,15 @@ Bool etnaviv_accel_Glyphs(CARD8 final_op, PicturePtr pSrc, PicturePtr pDst,
op.dst = INIT_BLIT_PIX(vMask, vMask->pict_format, ZERO_OFFSET);
op.blend_op = &etnaviv_composite_op[PictOpAdd];
op.clip = &box;
- op.src_origin_mode = SRC_ORIGIN_RELATIVE;
+ op.src_origin_mode = SRC_ORIGIN_NONE;
op.rop = 0xcc;
op.cmd = VIVS_DE_DEST_CONFIG_COMMAND_BIT_BLT;
op.brush = FALSE;
pCurrent = NULL;
for (grp = gr; grp < gr + n; grp++) {
+ BoxRec box;
+
if (pCurrent != grp->picture) {
PixmapPtr pPix = drawable_pixmap(grp->picture->pDrawable);
struct etnaviv_pixmap *v = etnaviv_get_pixmap_priv(pPix);
@@ -1957,20 +1959,28 @@ Bool etnaviv_accel_Glyphs(CARD8 final_op, PicturePtr pSrc, PicturePtr pDst,
if (!gal_prepare_gpu(etnaviv, v, GPU_ACCESS_RO))
goto destroy_picture;
+ if (pCurrent)
+ etnaviv_blit_complete(etnaviv);
+
prefetch(grp);
op.src = INIT_BLIT_PIX(v, v->pict_format, ZERO_OFFSET);
pCurrent = grp->picture;
+
+ etnaviv_blit_start(etnaviv, &op);
}
prefetch(grp + 1);
- etnaviv_blit_srcdst(etnaviv, &op,
- grp->glyph_pos.x, grp->glyph_pos.y,
- grp->dest_x, grp->dest_y,
- grp->width, grp->height);
+ box.x1 = grp->dest_x;
+ box.x2 = grp->dest_x + grp->width;
+ box.y1 = grp->dest_y;
+ box.y2 = grp->dest_y + grp->height;
+
+ etnaviv_de_op_src_origin(etnaviv, &op, grp->glyph_pos, &box);
}
+ etnaviv_blit_complete(etnaviv);
free(gr);