diff options
author | Russell King <rmk@arm.linux.org.uk> | 2015-06-02 14:23:17 +0100 |
---|---|---|
committer | Russell King <rmk@arm.linux.org.uk> | 2015-06-29 12:58:34 +0100 |
commit | 97e079f689bdcaa7ab878c173bed5112389cd34c (patch) | |
tree | 23ddbbcd05b2c383e0470c10b981fd7c32c77d9a | |
parent | 6a9ca517a29fb6849c88489f7200ac3ad681ab67 (diff) |
common,etnaviv: convert glyph assembly to use a BoxRec
Use a BoxRec for the destination rectangle for the glyph, so the
etnaviv code doesn't have to manually convert to a BoxRec.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r-- | common/glyph_assemble.c | 10 | ||||
-rw-r--r-- | common/glyph_assemble.h | 3 | ||||
-rw-r--r-- | etnaviv/etnaviv_accel.c | 10 |
3 files changed, 9 insertions, 14 deletions
diff --git a/common/glyph_assemble.c b/common/glyph_assemble.c index e978473..cc7a700 100644 --- a/common/glyph_assemble.c +++ b/common/glyph_assemble.c @@ -60,10 +60,12 @@ int glyphs_assemble(ScreenPtr pScreen, struct glyph_render **gp, GlyphPtr glyph = *glyphs++; if (glyph->info.width && glyph->info.height) { - grp->width = glyph->info.width; - grp->height = glyph->info.height; - grp->dest_x = x - glyph->info.x; - grp->dest_y = y - glyph->info.y; + grp->dest_box.x1 = x - glyph->info.x; + grp->dest_box.y1 = y - glyph->info.y; + grp->dest_box.x2 = grp->dest_box.x1 + + glyph->info.width; + grp->dest_box.y2 = grp->dest_box.y1 + + glyph->info.height; grp->picture = glyph_cache_only(pScreen, glyph, &grp->glyph_pos); if (!grp->picture) { diff --git a/common/glyph_assemble.h b/common/glyph_assemble.h index e074374..80354dc 100644 --- a/common/glyph_assemble.h +++ b/common/glyph_assemble.h @@ -4,8 +4,7 @@ struct glyph_render { PicturePtr picture; xPoint glyph_pos; - unsigned short width, height; - short dest_x, dest_y; + BoxRec dest_box; }; int glyphs_assemble(ScreenPtr pScreen, struct glyph_render **gp, diff --git a/etnaviv/etnaviv_accel.c b/etnaviv/etnaviv_accel.c index c0e8237..c69ce82 100644 --- a/etnaviv/etnaviv_accel.c +++ b/etnaviv/etnaviv_accel.c @@ -1943,8 +1943,6 @@ Bool etnaviv_accel_Glyphs(CARD8 final_op, PicturePtr pSrc, PicturePtr pDst, 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); @@ -1966,12 +1964,8 @@ Bool etnaviv_accel_Glyphs(CARD8 final_op, PicturePtr pSrc, PicturePtr pDst, prefetch(grp + 1); - 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_de_op_src_origin(etnaviv, &op, grp->glyph_pos, + &grp->dest_box); } etnaviv_blit_complete(etnaviv); |