EXA: PutImage improvements.
* Migrate for fallbacks when appropriate. * Add damage tracking in ExaCheckPutImage.
This commit is contained in:
parent
7fca169011
commit
0880aaac9c
|
@ -154,8 +154,9 @@ exaPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
|
||||||
int xoff, yoff;
|
int xoff, yoff;
|
||||||
int src_stride, bpp = pDrawable->bitsPerPixel;
|
int src_stride, bpp = pDrawable->bitsPerPixel;
|
||||||
|
|
||||||
if (pExaScr->swappedOut || pExaScr->info->UploadToScreen == NULL)
|
pixmaps[0].as_dst = TRUE;
|
||||||
goto migrate_and_fallback;
|
pixmaps[0].as_src = FALSE;
|
||||||
|
pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable);
|
||||||
|
|
||||||
/* Don't bother with under 8bpp, XYPixmaps. */
|
/* Don't bother with under 8bpp, XYPixmaps. */
|
||||||
if (format != ZPixmap || bpp < 8)
|
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)
|
if (!EXA_PM_IS_SOLID(pDrawable, pGC->planemask) || pGC->alu != GXcopy)
|
||||||
goto migrate_and_fallback;
|
goto migrate_and_fallback;
|
||||||
|
|
||||||
pixmaps[0].as_dst = TRUE;
|
if (pExaScr->swappedOut)
|
||||||
pixmaps[0].as_src = FALSE;
|
goto fallback;
|
||||||
pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable);
|
|
||||||
exaDoMigration (pixmaps, 1, TRUE);
|
exaDoMigration (pixmaps, 1, TRUE);
|
||||||
|
|
||||||
|
if (pExaScr->info->UploadToScreen == NULL)
|
||||||
|
goto fallback;
|
||||||
|
|
||||||
pPix = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
|
pPix = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
|
||||||
|
|
||||||
if (pPix == NULL)
|
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)),
|
fbBltStip((FbStip *)bits + (y1 - y) * (src_stride / sizeof(FbStip)),
|
||||||
src_stride / sizeof(FbStip),
|
src_stride / sizeof(FbStip),
|
||||||
(x1 - x) * bpp,
|
(x1 - x) * dstBpp,
|
||||||
dst + (y1 + yoff) * dst_stride,
|
dst + (y1 + dstYoff) * dst_stride,
|
||||||
dst_stride,
|
dst_stride,
|
||||||
(x1 + xoff) * bpp,
|
(x1 + dstXoff) * dstBpp,
|
||||||
(x2 - x1) * bpp,
|
(x2 - x1) * dstBpp,
|
||||||
y2 - y1,
|
y2 - y1,
|
||||||
GXcopy, FB_ALLONES, bpp);
|
GXcopy, FB_ALLONES, dstBpp);
|
||||||
|
|
||||||
exaFinishAccess(pDrawable, EXA_PREPARE_DEST);
|
exaFinishAccess(pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
exaPixmapDirty(pPix, x1 + xoff, y1 + yoff, x2 + xoff, y2 + yoff);
|
exaPixmapDirty(pPix, x1 + xoff, y1 + yoff, x2 + xoff, y2 + yoff);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
migrate_and_fallback:
|
migrate_and_fallback:
|
||||||
pixmaps[0].as_dst = TRUE;
|
|
||||||
pixmaps[0].as_src = FALSE;
|
|
||||||
pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable);
|
|
||||||
exaDoMigration (pixmaps, 1, FALSE);
|
exaDoMigration (pixmaps, 1, FALSE);
|
||||||
|
|
||||||
fallback:
|
fallback:
|
||||||
|
|
|
@ -88,10 +88,15 @@ ExaCheckPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth,
|
||||||
int x, int y, int w, int h, int leftPad, int format,
|
int x, int y, int w, int h, int leftPad, int format,
|
||||||
char *bits)
|
char *bits)
|
||||||
{
|
{
|
||||||
|
PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable);
|
||||||
|
int xoff, yoff;
|
||||||
|
|
||||||
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
|
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
|
||||||
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
fbPutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits);
|
fbPutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits);
|
||||||
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
|
exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff);
|
||||||
|
exaPixmapDirty(pPixmap, x + xoff, y + yoff, x + xoff + w, y + yoff + h);
|
||||||
}
|
}
|
||||||
|
|
||||||
RegionPtr
|
RegionPtr
|
||||||
|
|
Loading…
Reference in New Issue