diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-28 17:13:30 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-28 17:13:30 +0100 |
commit | 66c90158e45e890c6f655195c6707d216c7ac4c5 (patch) | |
tree | 1211f5cd8af2c2f1fec764d3ced5e535f17465e3 | |
parent | 5b2254838eb89bf77eeb893c73eecb8c737822f4 (diff) |
uxa: Skip the redundant miComputeCompositeRects() when adding to the mask
As we are in full control of the destination (the temporary glyph mask)
and the source (the glyph cache) we know that there are no clip regions
on either and so can skip computing the composite rectangles. (We trust
the device clipping to prevent compositing outside the target.)
x11perf on PineView:
701/686 -> 881/856 kglyphs/s [aa/rgb]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | uxa/uxa-glyphs.c | 53 |
1 files changed, 20 insertions, 33 deletions
diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c index f5495d61..4a05248c 100644 --- a/uxa/uxa-glyphs.c +++ b/uxa/uxa-glyphs.c @@ -741,11 +741,15 @@ uxa_glyphs_try_driver_add_to_mask(PicturePtr pDst, pDstPix = uxa_get_offscreen_pixmap(pDst->pDrawable, &dst_off_x, &dst_off_y); + dst_off_x += pDst->pDrawable->x; + dst_off_y += pDst->pDrawable->y; pSrcPix = uxa_get_offscreen_pixmap(buffer->source->pDrawable, &src_off_x, &src_off_y); if(!pSrcPix) return -1; + src_off_x += buffer->source->pDrawable->x; + src_off_y += buffer->source->pDrawable->y; if (!(*uxa_screen->info->prepare_composite) (PictOpAdd, buffer->source, NULL, pDst, pSrcPix, NULL, pDstPix)) @@ -754,40 +758,23 @@ uxa_glyphs_try_driver_add_to_mask(PicturePtr pDst, rects = buffer->rects; nrect = buffer->count; do { - INT16 xDst = rects->xDst + pDst->pDrawable->x; - INT16 yDst = rects->yDst + pDst->pDrawable->y; - INT16 xSrc = rects->xSrc + buffer->source->pDrawable->x; - INT16 ySrc = rects->ySrc + buffer->source->pDrawable->y; - - RegionRec region; - BoxPtr pbox; - int nbox; - - if (!miComputeCompositeRegion(®ion, buffer->source, NULL, pDst, - xSrc, ySrc, 0, 0, xDst, yDst, - rects->width, rects->height)) - goto next_rect; - - xSrc += src_off_x - xDst; - ySrc += src_off_y - yDst; - - nbox = REGION_NUM_RECTS(®ion); - pbox = REGION_RECTS(®ion); - - while (nbox--) { - (*uxa_screen->info->composite) (pDstPix, - pbox->x1 + xSrc, - pbox->y1 + ySrc, - 0, 0, - pbox->x1 + dst_off_x, - pbox->y1 + dst_off_y, - pbox->x2 - pbox->x1, - pbox->y2 - pbox->y1); - pbox++; - } + INT16 xDst = rects->xDst + dst_off_x; + INT16 yDst = rects->yDst + dst_off_y; + INT16 xSrc = rects->xSrc + src_off_x; + INT16 ySrc = rects->ySrc + src_off_y; + + /* We trust the device clipping on the target and the + * specialised construction of the glyph mask and source + * so that we can skip computing the clipped composite + * region (miComputeCompositeRects). + */ -next_rect: - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); + (*uxa_screen->info->composite) (pDstPix, + xSrc, ySrc, + 0, 0, + xDst, yDst, + rects->width, + rects->height); rects++; } while (--nrect); |