diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-07-12 19:37:02 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-07-12 19:37:02 +0100 |
commit | 0477b5fb6f040f3bad86bb314a24df1bcd660aed (patch) | |
tree | 4dc3080da823a1ffd948a2e16365d4d5cf6cd6a6 /src | |
parent | 16aaa51b5d326f44974489f5b29716c7ff5ab48e (diff) |
sna/glyphs: Apply mask reduction along fallback paths as well
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/sna_glyphs.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c index aba5fef4..cd29b07e 100644 --- a/src/sna/sna_glyphs.c +++ b/src/sna/sna_glyphs.c @@ -108,6 +108,19 @@ static inline struct sna_glyph *sna_glyph(GlyphPtr glyph) #define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0) +static bool op_is_bounded(uint8_t op) +{ + switch (op) { + case PictOpOver: + case PictOpOutReverse: + case PictOpAdd: + case PictOpXor: + return true; + default: + return false; + } +} + void sna_glyphs_close(struct sna *sna) { struct sna_render *render = &sna->render; @@ -1208,6 +1221,11 @@ glyphs_fallback(CARD8 op, src_x += dx - list->xOff; src_y += dy - list->yOff; + if (mask_format && + (op_is_bounded(op) || (nlist == 1 && list->len == 1)) && + mask_format == glyphs_format(nlist, list, glyphs)) + mask_format = NULL; + if (mask_format) { DBG(("%s: create mask (%d, %d)x(%d,%d) + (%d,%d) + (%d,%d), depth=%d, format=%lx [%lx], ca? %d\n", __FUNCTION__, @@ -1258,8 +1276,7 @@ glyphs_fallback(CARD8 op, if (picture == NULL) goto next_glyph; - glyph_image = image_from_pict(picture, - FALSE, + glyph_image = image_from_pict(picture, FALSE, &gx, &gy); if (!glyph_image) goto next_glyph; @@ -1360,19 +1377,6 @@ cleanup_region: RegionUninit(®ion); } -static bool op_is_bounded(uint8_t op) -{ - switch (op) { - case PictOpOver: - case PictOpOutReverse: - case PictOpAdd: - case PictOpXor: - return true; - default: - return false; - } -} - void sna_glyphs(CARD8 op, PicturePtr src, |