diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-03-18 14:49:58 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-03-18 15:11:24 +0000 |
commit | 28371a34fa83f70a7af3c8d3bfd6c7cef9e35073 (patch) | |
tree | bb01eae3b0af7d5b590b96684c6eeb4a95e21b06 /src/sna/sna_glyphs.c | |
parent | 16dac417c8049d65b3641e0f662865772faad61f (diff) |
sna: Skip processing an all-clipped-out glyph
Along the slow path, skip all processing of glyphs that are not visible.
This is important as the slow path handles the per-glyph redirection
case, which is much more expensive.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_glyphs.c')
-rw-r--r-- | src/sna/sna_glyphs.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c index 3b1cf379..2f44113a 100644 --- a/src/sna/sna_glyphs.c +++ b/src/sna/sna_glyphs.c @@ -692,11 +692,21 @@ glyphs_slow(struct sna *sna, GlyphPtr glyph = *glyphs++; struct sna_glyph priv; BoxPtr rects; + BoxRec box; int nrect; if (!glyph_valid(glyph)) goto next_glyph; + box.x1 = x - glyph->info.x; + box.y1 = y - glyph->info.y; + box.x2 = bound(box.x1, glyph->info.width); + box.y2 = bound(box.y1, glyph->info.height); + + if (!box_intersect(&box, + &dst->pCompositeClip->extents)) + goto next_glyph; + priv = *sna_glyph(glyph); if (priv.atlas == NULL) { if (!glyph_cache(screen, &sna->render, glyph)) { |