summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-08-01 12:02:58 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-08-01 12:02:58 +0100
commita1a0b9c2e49d03e373695df8828c8d4c6312e5ac (patch)
treece52605e31823c5114f189b07b808f47c693f3c8
parentfc2de62496061b9d0bace02729765344bd939122 (diff)
sna/glyphs: Eliminate an extra conditional from glyphs-to-dst
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_glyphs.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index 5d3bec28..94d702ae 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -615,7 +615,7 @@ glyphs_to_dst(struct sna *sna,
src_x -= list->xOff + x;
src_y -= list->yOff + y;
- glyph_atlas = NULL;
+ glyph_atlas = NO_ATLAS;
while (nlist--) {
int n = list->len;
x += list->xOff;
@@ -626,22 +626,18 @@ glyphs_to_dst(struct sna *sna,
int i;
p = sna_glyph(glyph);
- if (unlikely(p->atlas == NULL)) {
+ if (unlikely(p->atlas != glyph_atlas)) {
if (unlikely(!glyph_valid(glyph)))
goto next_glyph;
- if (glyph_atlas) {
+ if (glyph_atlas != NO_ATLAS) {
tmp.done(sna, &tmp);
- glyph_atlas = NULL;
+ glyph_atlas = NO_ATLAS;
}
- if (!glyph_cache(screen, &sna->render, glyph))
+ if (p->atlas == NULL &&
+ !glyph_cache(screen, &sna->render, glyph))
goto next_glyph;
- }
-
- if (p->atlas != glyph_atlas) {
- if (glyph_atlas)
- tmp.done(sna, &tmp);
if (!sna->render.composite(sna,
op, src, p->atlas, dst,
@@ -748,8 +744,6 @@ glyphs0_to_dst(struct sna *sna,
struct sna_composite_op tmp;
ScreenPtr screen = dst->pDrawable->pScreen;
PicturePtr glyph_atlas = NO_ATLAS;
- const BoxRec *rects;
- int nrect;
int x, y;
if (NO_GLYPHS_TO_DST)
@@ -767,8 +761,8 @@ glyphs0_to_dst(struct sna *sna,
src_y -= list->yOff + y;
if (clipped_glyphs(dst, nlist, list, glyphs)) {
- rects = region_rects(dst->pCompositeClip);
- nrect = region_num_rects(dst->pCompositeClip);
+ const BoxRec *rects = region_rects(dst->pCompositeClip);
+ int nrect = region_num_rects(dst->pCompositeClip);
if (nrect == 0)
return true;