diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2008-07-31 10:55:44 +0200 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2008-07-31 10:55:44 +0200 |
commit | 8405c25d9ddbfddb6b155a436f07ccad689e53bd (patch) | |
tree | b2ade54d9226b39ebaefc049b9347ea973718d83 /exa | |
parent | b37b1e66996f8335dafc97b12d25aaec452b931e (diff) |
EXA: Simplify exaFillRegionTiled() control flow.
Also only call REGION_TRANSLATE() when necessary.
Diffstat (limited to 'exa')
-rw-r--r-- | exa/exa_accel.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/exa/exa_accel.c b/exa/exa_accel.c index cf15709a3..f7da91194 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -1234,14 +1234,11 @@ exaFillRegionTiled (DrawablePtr pDrawable, pixmaps[1].pPix = pTile; pixmaps[1].pReg = NULL; - exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff); - REGION_TRANSLATE(pScreen, pRegion, xoff, yoff); - pExaPixmap = ExaGetPixmapPriv (pPixmap); if (pExaPixmap->accel_blocked || pTileExaPixmap->accel_blocked) { - goto out; + return FALSE; } else { exaDoMigration (pixmaps, 2, TRUE); } @@ -1249,10 +1246,13 @@ exaFillRegionTiled (DrawablePtr pDrawable, pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff); if (!pPixmap || !exaPixmapIsOffscreen(pTile)) - goto out; + return FALSE; if ((*pExaScr->info->PrepareCopy) (pTile, pPixmap, 1, 1, alu, planemask)) { + if (xoff || yoff) + REGION_TRANSLATE(pScreen, pRegion, xoff, yoff); + for (i = 0; i < nbox; i++) { int height = pBox[i].y2 - pBox[i].y1; @@ -1297,8 +1297,6 @@ exaFillRegionTiled (DrawablePtr pDrawable, } (*pExaScr->info->DoneCopy) (pPixmap); - exaMarkSync(pDrawable->pScreen); - /* With GXcopy, we only need to do the basic algorithm up to the tile * size; then, we can just keep doubling the destination in each * direction until it fills the box. This way, the number of copy @@ -1336,15 +1334,15 @@ exaFillRegionTiled (DrawablePtr pDrawable, } (*pExaScr->info->DoneCopy) (pPixmap); - - ret = TRUE; } - } -out: - REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff); + exaMarkSync(pDrawable->pScreen); - return ret; + if (xoff || yoff) + REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff); + } + + return TRUE; } |