diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-07 22:57:44 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-07 22:57:44 +0000 |
commit | 33351d5c3dd912534c54e64ccfc7adc4c6f6ecae (patch) | |
tree | 30477a015a574e5121f9035fa455f1b77640a1cc /src | |
parent | e4872225ace7e3b129292f5822aa75b84c52beff (diff) |
sna/glyphs: Bypass masks for single glyphs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/sna_composite.c | 6 | ||||
-rw-r--r-- | src/sna/sna_glyphs.c | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c index a6f867f5..532dd805 100644 --- a/src/sna/sna_composite.c +++ b/src/sna/sna_composite.c @@ -405,8 +405,12 @@ sna_composite(CARD8 op, dst_x, dst_y, dst->pDrawable->x, dst->pDrawable->y, width, height)); - if (mask && sna_composite_mask_is_opaque(mask)) + if (mask && sna_composite_mask_is_opaque(mask)) { + DBG(("%s: removing opaque %smask\n", + __FUNCTION__, + mask->componentAlpha && PICT_FORMAT_RGB(mask->format) ? "CA " : "")); mask = NULL; + } if (!sna_compute_composite_region(®ion, src, mask, dst, diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c index acec1116..b189930a 100644 --- a/src/sna/sna_glyphs.c +++ b/src/sna/sna_glyphs.c @@ -727,8 +727,8 @@ glyphs_via_mask(struct sna *sna, pixman_image_t *mask_image; int s; - DBG(("%s: smal mask, rendering glyphs to upload buffer\n", - __FUNCTION__)); + DBG(("%s: small mask [format=%lx, depth=%d], rendering glyphs to upload buffer\n", + __FUNCTION__, format->format, format->depth)); upload: pixmap = sna_pixmap_create_upload(screen, @@ -1237,7 +1237,9 @@ sna_glyphs(CARD8 op, /* XXX discard the mask for non-overlapping glyphs? */ - if (!mask || (op == PictOpAdd && dst->format == mask->format)) { + if (!mask || + (((nlist == 1 && list->len == 1) || op == PictOpAdd) && + dst->format == (mask->depth << 24 | mask->format))) { if (glyphs_to_dst(sna, op, src, dst, src_x, src_y, |