xf86-video-intel: uxa/uxa-glyphs.c

Chris Wilson ickle at kemper.freedesktop.org
Fri May 28 09:31:54 PDT 2010


 uxa/uxa-glyphs.c |   53 ++++++++++++++++++++---------------------------------
 1 file changed, 20 insertions(+), 33 deletions(-)

New commits:
commit 66c90158e45e890c6f655195c6707d216c7ac4c5
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri May 28 17:13:30 2010 +0100

    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 at chris-wilson.co.uk>

diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c
index f5495d6..4a05248 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(&region, 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(&region);
-		pbox = REGION_RECTS(&region);
-
-		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, &region);
+		(*uxa_screen->info->composite) (pDstPix,
+						xSrc, ySrc,
+						0, 0,
+						xDst, yDst,
+						rects->width,
+						rects->height);
 
 		rects++;
 	} while (--nrect);


More information about the xorg-commit mailing list