diff options
Diffstat (limited to 'exa/exa_accel.c')
-rw-r--r-- | exa/exa_accel.c | 81 |
1 files changed, 25 insertions, 56 deletions
diff --git a/exa/exa_accel.c b/exa/exa_accel.c index 028d93644..8bbf036e4 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -508,14 +508,6 @@ exaCopyNtoN (DrawablePtr pSrcDrawable, region = RECTS_TO_REGION(pScreen, nbox, rects, CT_YXBANDED); DEALLOCATE_LOCAL(rects); - - if (region) { - src_off_x -= dst_off_x; - src_off_y -= dst_off_y; - dst_off_x = dst_off_y = 0; - pbox = REGION_RECTS(region); - nbox = REGION_NUM_RECTS(region); - } } } @@ -1106,6 +1098,7 @@ exaFillRegionSolid (DrawablePtr pDrawable, ExaPixmapPriv (pPixmap); int xoff, yoff; ExaMigrationRec pixmaps[1]; + Bool ret = FALSE; pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; @@ -1118,12 +1111,12 @@ exaFillRegionSolid (DrawablePtr pDrawable, if (pExaPixmap->accel_blocked) { - goto fallback; + goto out; } else { exaDoMigration (pixmaps, 1, TRUE); } - if ((pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) && + if (exaPixmapIsOffscreen (pPixmap) && (*pExaScr->info->PrepareSolid) (pPixmap, alu, planemask, pixel)) { int nbox; @@ -1141,7 +1134,8 @@ exaFillRegionSolid (DrawablePtr pDrawable, (*pExaScr->info->DoneSolid) (pPixmap); exaMarkSync(pDrawable->pScreen); - if (pDrawable->width == 1 && pDrawable->height == 1 && + if (!(pExaScr->info->flags & EXA_HANDLES_PIXMAPS) && + pDrawable->width == 1 && pDrawable->height == 1 && pDrawable->bitsPerPixel != 24) { ExaPixmapPriv(pPixmap); @@ -1160,24 +1154,13 @@ exaFillRegionSolid (DrawablePtr pDrawable, pRegion); } - REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff); - return TRUE; + ret = TRUE; } -fallback: - if (alu != GXcopy || !EXA_PM_IS_SOLID(pDrawable, planemask)) { - REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff); - return FALSE; - } - EXA_FALLBACK(("to %p (%c)\n", pDrawable, - exaDrawableLocation(pDrawable))); - exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pixmaps[0].pReg); +out: REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff); - fbFillRegionSolid (pDrawable, pRegion, 0, - fbReplicatePixel (pixel, pDrawable->bitsPerPixel)); - exaFinishAccess (pDrawable, EXA_PREPARE_DEST); - return TRUE; + return ret; } /* Try to do an accelerated tile of the pTile into pRegion of pDrawable. @@ -1195,11 +1178,12 @@ exaFillRegionTiled (DrawablePtr pDrawable, PixmapPtr pPixmap; ExaPixmapPrivPtr pExaPixmap; ExaPixmapPrivPtr pTileExaPixmap = ExaGetPixmapPriv(pTile); - int xoff, yoff, tileXoff, tileYoff; + int xoff, yoff; int tileWidth, tileHeight; ExaMigrationRec pixmaps[2]; int nbox = REGION_NUM_RECTS (pRegion); BoxPtr pBox = REGION_RECTS (pRegion); + Bool ret = FALSE; tileWidth = pTile->drawable.width; tileHeight = pTile->drawable.height; @@ -1229,22 +1213,17 @@ exaFillRegionTiled (DrawablePtr pDrawable, if (pExaPixmap->accel_blocked || pTileExaPixmap->accel_blocked) { - goto fallback; + goto out; } else { exaDoMigration (pixmaps, 2, TRUE); } pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff); - if (!pPixmap) - goto fallback; - - if (!exaPixmapIsOffscreen(pTile)) - goto fallback; + if (!pPixmap || !exaPixmapIsOffscreen(pTile)) + goto out; - if ((*pExaScr->info->PrepareCopy) (exaGetOffscreenPixmap((DrawablePtr)pTile, - &tileXoff, &tileYoff), - pPixmap, 0, 0, alu, planemask)) + if ((*pExaScr->info->PrepareCopy) (pTile, pPixmap, 1, 1, alu, planemask)) { while (nbox--) { @@ -1252,7 +1231,8 @@ exaFillRegionTiled (DrawablePtr pDrawable, int dstY = pBox->y1; int tileY; - tileY = (dstY - yoff - pDrawable->y - pPatOrg->y) % tileHeight; + modulus(dstY - yoff - pDrawable->y - pPatOrg->y, tileHeight, tileY); + while (height > 0) { int width = pBox->x2 - pBox->x1; int dstX = pBox->x1; @@ -1263,16 +1243,17 @@ exaFillRegionTiled (DrawablePtr pDrawable, h = height; height -= h; - tileX = (dstX - xoff - pDrawable->x - pPatOrg->x) % tileWidth; + modulus(dstX - xoff - pDrawable->x - pPatOrg->x, tileWidth, + tileX); + while (width > 0) { int w = tileWidth - tileX; if (w > width) w = width; width -= w; - (*pExaScr->info->Copy) (pPixmap, - tileX + tileXoff, tileY + tileYoff, - dstX, dstY, w, h); + (*pExaScr->info->Copy) (pPixmap, tileX, tileY, dstX, dstY, + w, h); dstX += w; tileX = 0; } @@ -1283,26 +1264,14 @@ exaFillRegionTiled (DrawablePtr pDrawable, } (*pExaScr->info->DoneCopy) (pPixmap); exaMarkSync(pDrawable->pScreen); - REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff); - return TRUE; - } -fallback: - if (alu != GXcopy || !EXA_PM_IS_SOLID(pDrawable, planemask)) { - REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff); - return FALSE; + ret = TRUE; } - EXA_FALLBACK(("from %p to %p (%c,%c)\n", pTile, pDrawable, - exaDrawableLocation(&pTile->drawable), - exaDrawableLocation(pDrawable))); - exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pixmaps[0].pReg); + +out: REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff); - exaPrepareAccess ((DrawablePtr)pTile, EXA_PREPARE_SRC); - fbFillRegionTiled (pDrawable, pRegion, pTile); - exaFinishAccess ((DrawablePtr)pTile, EXA_PREPARE_SRC); - exaFinishAccess (pDrawable, EXA_PREPARE_DEST); - return TRUE; + return ret; } |