diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2007-04-29 23:48:19 +0200 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2007-04-29 23:48:19 +0200 |
commit | 0880aaac9c83019fec2e3d32871f74c7a407f8b3 (patch) | |
tree | 0fade5fab67b4d5103521cbc5020ad4aebe0535b /exa | |
parent | 7fca16901187ade48e83e6a2684ef464b1912357 (diff) |
EXA: PutImage improvements.
* Migrate for fallbacks when appropriate.
* Add damage tracking in ExaCheckPutImage.
Diffstat (limited to 'exa')
-rw-r--r-- | exa/exa_accel.c | 29 | ||||
-rw-r--r-- | exa/exa_unaccel.c | 5 |
2 files changed, 21 insertions, 13 deletions
diff --git a/exa/exa_accel.c b/exa/exa_accel.c index fc1f3d7e6..dd02fef63 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -154,8 +154,9 @@ exaPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int xoff, yoff; int src_stride, bpp = pDrawable->bitsPerPixel; - if (pExaScr->swappedOut || pExaScr->info->UploadToScreen == NULL) - goto migrate_and_fallback; + pixmaps[0].as_dst = TRUE; + pixmaps[0].as_src = FALSE; + pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable); /* Don't bother with under 8bpp, XYPixmaps. */ if (format != ZPixmap || bpp < 8) @@ -165,10 +166,14 @@ exaPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, if (!EXA_PM_IS_SOLID(pDrawable, pGC->planemask) || pGC->alu != GXcopy) goto migrate_and_fallback; - pixmaps[0].as_dst = TRUE; - pixmaps[0].as_src = FALSE; - pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable); + if (pExaScr->swappedOut) + goto fallback; + exaDoMigration (pixmaps, 1, TRUE); + + if (pExaScr->info->UploadToScreen == NULL) + goto fallback; + pPix = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff); if (pPix == NULL) @@ -221,25 +226,23 @@ exaPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, fbBltStip((FbStip *)bits + (y1 - y) * (src_stride / sizeof(FbStip)), src_stride / sizeof(FbStip), - (x1 - x) * bpp, - dst + (y1 + yoff) * dst_stride, + (x1 - x) * dstBpp, + dst + (y1 + dstYoff) * dst_stride, dst_stride, - (x1 + xoff) * bpp, - (x2 - x1) * bpp, + (x1 + dstXoff) * dstBpp, + (x2 - x1) * dstBpp, y2 - y1, - GXcopy, FB_ALLONES, bpp); + GXcopy, FB_ALLONES, dstBpp); exaFinishAccess(pDrawable, EXA_PREPARE_DEST); } + exaPixmapDirty(pPix, x1 + xoff, y1 + yoff, x2 + xoff, y2 + yoff); } return; migrate_and_fallback: - pixmaps[0].as_dst = TRUE; - pixmaps[0].as_src = FALSE; - pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable); exaDoMigration (pixmaps, 1, FALSE); fallback: diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c index a7f939845..708d1eac6 100644 --- a/exa/exa_unaccel.c +++ b/exa/exa_unaccel.c @@ -88,10 +88,15 @@ ExaCheckPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int w, int h, int leftPad, int format, char *bits) { + PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable); + int xoff, yoff; + EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); fbPutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits); exaFinishAccess (pDrawable, EXA_PREPARE_DEST); + exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff); + exaPixmapDirty(pPixmap, x + xoff, y + yoff, x + xoff + w, y + yoff + h); } RegionPtr |