EXA: Lots of damage tracking fixes.
Mostly due to exaDrawableDirty() now calculating the backing pixmap coordinates internally, for cases where they aren't trivially known. There's a new exaPixmapDirty() function for the other cases.
This commit is contained in:
parent
467c00cf45
commit
9563b2eea2
106
exa/exa.c
106
exa/exa.c
|
@ -121,6 +121,57 @@ exaGetDrawablePixmap(DrawablePtr pDrawable)
|
||||||
return (PixmapPtr) pDrawable;
|
return (PixmapPtr) pDrawable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the offsets to add to coordinates to make them address the same bits in
|
||||||
|
* the backing drawable. These coordinates are nonzero only for redirected
|
||||||
|
* windows.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
exaGetDrawableDeltas (DrawablePtr pDrawable, PixmapPtr pPixmap,
|
||||||
|
int *xp, int *yp)
|
||||||
|
{
|
||||||
|
#ifdef COMPOSITE
|
||||||
|
if (pDrawable->type == DRAWABLE_WINDOW) {
|
||||||
|
*xp = -pPixmap->screen_x;
|
||||||
|
*yp = -pPixmap->screen_y;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
*xp = 0;
|
||||||
|
*yp = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* exaPixmapDirty() marks a pixmap as dirty, allowing for
|
||||||
|
* optimizations in pixmap migration when no changes have occurred.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
exaPixmapDirty (PixmapPtr pPix, int x1, int y1, int x2, int y2)
|
||||||
|
{
|
||||||
|
ExaPixmapPriv(pPix);
|
||||||
|
BoxRec box;
|
||||||
|
RegionPtr pDamageReg;
|
||||||
|
RegionRec region;
|
||||||
|
|
||||||
|
if (!pExaPixmap)
|
||||||
|
return;
|
||||||
|
|
||||||
|
box.x1 = max(x1, 0);
|
||||||
|
box.y1 = max(y1, 0);
|
||||||
|
box.x2 = min(x2, pPix->drawable.width);
|
||||||
|
box.y2 = min(y2, pPix->drawable.height);
|
||||||
|
|
||||||
|
if (box.x1 >= box.x2 || box.y1 >= box.y2)
|
||||||
|
return;
|
||||||
|
|
||||||
|
pDamageReg = DamageRegion(pExaPixmap->pDamage);
|
||||||
|
|
||||||
|
REGION_INIT(pScreen, ®ion, &box, 1);
|
||||||
|
REGION_UNION(pScreen, pDamageReg, pDamageReg, ®ion);
|
||||||
|
REGION_UNINIT(pScreen, ®ion);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* exaDrawableDirty() marks a pixmap backing a drawable as dirty, allowing for
|
* exaDrawableDirty() marks a pixmap backing a drawable as dirty, allowing for
|
||||||
* optimizations in pixmap migration when no changes have occurred.
|
* optimizations in pixmap migration when no changes have occurred.
|
||||||
|
@ -128,21 +179,20 @@ exaGetDrawablePixmap(DrawablePtr pDrawable)
|
||||||
void
|
void
|
||||||
exaDrawableDirty (DrawablePtr pDrawable, int x1, int y1, int x2, int y2)
|
exaDrawableDirty (DrawablePtr pDrawable, int x1, int y1, int x2, int y2)
|
||||||
{
|
{
|
||||||
ExaPixmapPrivPtr pExaPixmap;
|
PixmapPtr pPix = exaGetDrawablePixmap(pDrawable);
|
||||||
RegionPtr pDamageReg;
|
int xoff, yoff;
|
||||||
BoxRec box = { .x1 = max(x1,0), .x2 = min(x2,pDrawable->width),
|
|
||||||
.y1 = max(y1,0), .y2 = min(y2,pDrawable->height) };
|
|
||||||
RegionRec region;
|
|
||||||
|
|
||||||
pExaPixmap = ExaGetPixmapPriv(exaGetDrawablePixmap (pDrawable));
|
x1 = max(x1, pDrawable->x);
|
||||||
if (!pExaPixmap || box.x1 >= box.x2 || box.y1 >= box.y2)
|
y1 = max(y1, pDrawable->y);
|
||||||
|
x2 = min(x2, pDrawable->x + pDrawable->width);
|
||||||
|
y2 = min(y2, pDrawable->y + pDrawable->height);
|
||||||
|
|
||||||
|
if (x1 >= x2 || y1 >= y2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pDamageReg = DamageRegion(pExaPixmap->pDamage);
|
|
||||||
|
|
||||||
REGION_INIT(pScreen, ®ion, &box, 1);
|
exaGetDrawableDeltas(pDrawable, pPix, &xoff, &yoff);
|
||||||
REGION_UNION(pScreen, pDamageReg, pDamageReg, ®ion);
|
|
||||||
REGION_UNINIT(pScreen, ®ion);
|
exaPixmapDirty(pPix, x1 + xoff, y1 + yoff, x2 + xoff, y2 + yoff);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
|
@ -289,32 +339,14 @@ exaDrawableIsOffscreen (DrawablePtr pDrawable)
|
||||||
/**
|
/**
|
||||||
* Returns the pixmap which backs a drawable, and the offsets to add to
|
* Returns the pixmap which backs a drawable, and the offsets to add to
|
||||||
* coordinates to make them address the same bits in the backing drawable.
|
* coordinates to make them address the same bits in the backing drawable.
|
||||||
* These coordinates are nonzero only for redirected windows.
|
|
||||||
*/
|
*/
|
||||||
PixmapPtr
|
PixmapPtr
|
||||||
exaGetOffscreenPixmap (DrawablePtr pDrawable, int *xp, int *yp)
|
exaGetOffscreenPixmap (DrawablePtr pDrawable, int *xp, int *yp)
|
||||||
{
|
{
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap = exaGetDrawablePixmap (pDrawable);
|
||||||
int x, y;
|
|
||||||
|
exaGetDrawableDeltas (pDrawable, pPixmap, xp, yp);
|
||||||
|
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW) {
|
|
||||||
pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
|
||||||
#ifdef COMPOSITE
|
|
||||||
x = -pPixmap->screen_x;
|
|
||||||
y = -pPixmap->screen_y;
|
|
||||||
#else
|
|
||||||
x = 0;
|
|
||||||
y = 0;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pPixmap = (PixmapPtr) pDrawable;
|
|
||||||
x = 0;
|
|
||||||
y = 0;
|
|
||||||
}
|
|
||||||
*xp = x;
|
|
||||||
*yp = y;
|
|
||||||
if (exaPixmapIsOffscreen (pPixmap))
|
if (exaPixmapIsOffscreen (pPixmap))
|
||||||
return pPixmap;
|
return pPixmap;
|
||||||
else
|
else
|
||||||
|
@ -428,7 +460,7 @@ exaValidateGC (GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
|
||||||
exaPrepareAccess(&pOldTile->drawable, EXA_PREPARE_SRC);
|
exaPrepareAccess(&pOldTile->drawable, EXA_PREPARE_SRC);
|
||||||
pNewTile = fb24_32ReformatTile (pOldTile,
|
pNewTile = fb24_32ReformatTile (pOldTile,
|
||||||
pDrawable->bitsPerPixel);
|
pDrawable->bitsPerPixel);
|
||||||
exaDrawableDirty(&pNewTile->drawable, 0, 0, pNewTile->drawable.width, pNewTile->drawable.height);
|
exaPixmapDirty(pNewTile, 0, 0, pNewTile->drawable.width, pNewTile->drawable.height);
|
||||||
exaFinishAccess(&pOldTile->drawable, EXA_PREPARE_SRC);
|
exaFinishAccess(&pOldTile->drawable, EXA_PREPARE_SRC);
|
||||||
}
|
}
|
||||||
if (pNewTile)
|
if (pNewTile)
|
||||||
|
@ -449,9 +481,9 @@ exaValidateGC (GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
|
||||||
*/
|
*/
|
||||||
exaMoveOutPixmap(pGC->tile.pixmap);
|
exaMoveOutPixmap(pGC->tile.pixmap);
|
||||||
fbPadPixmap (pGC->tile.pixmap);
|
fbPadPixmap (pGC->tile.pixmap);
|
||||||
exaDrawableDirty(&pGC->tile.pixmap->drawable, 0, 0,
|
exaPixmapDirty(pGC->tile.pixmap, 0, 0,
|
||||||
pGC->tile.pixmap->drawable.width,
|
pGC->tile.pixmap->drawable.width,
|
||||||
pGC->tile.pixmap->drawable.height);
|
pGC->tile.pixmap->drawable.height);
|
||||||
}
|
}
|
||||||
/* Mask out the GCTile change notification, now that we've done FB's
|
/* Mask out the GCTile change notification, now that we've done FB's
|
||||||
* job for it.
|
* job for it.
|
||||||
|
|
|
@ -109,9 +109,8 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n,
|
||||||
(*pExaScr->info->Solid) (pPixmap,
|
(*pExaScr->info->Solid) (pPixmap,
|
||||||
fullX1 + off_x, fullY1 + off_y,
|
fullX1 + off_x, fullY1 + off_y,
|
||||||
fullX2 + off_x, fullY1 + 1 + off_y);
|
fullX2 + off_x, fullY1 + 1 + off_y);
|
||||||
exaDrawableDirty (pDrawable,
|
exaPixmapDirty (pPixmap, fullX1 + off_x, fullY1 + off_y,
|
||||||
fullX1 + off_x, fullY1 + off_y,
|
fullX2 + off_x, fullY1 + 1 + off_y);
|
||||||
fullX2 + off_x, fullY1 + 1 + off_y);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -130,9 +129,8 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n,
|
||||||
(*pExaScr->info->Solid) (pPixmap,
|
(*pExaScr->info->Solid) (pPixmap,
|
||||||
partX1 + off_x, fullY1 + off_y,
|
partX1 + off_x, fullY1 + off_y,
|
||||||
partX2 + off_x, fullY1 + 1 + off_y);
|
partX2 + off_x, fullY1 + 1 + off_y);
|
||||||
exaDrawableDirty (pDrawable,
|
exaPixmapDirty (pPixmap, partX1 + off_x, fullY1 + off_y,
|
||||||
partX1 + off_x, fullY1 + off_y,
|
partX2 + off_x, fullY1 + 1 + off_y);
|
||||||
partX2 + off_x, fullY1 + 1 + off_y);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pbox++;
|
pbox++;
|
||||||
|
@ -233,7 +231,7 @@ exaPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
|
||||||
|
|
||||||
exaFinishAccess(pDrawable, EXA_PREPARE_DEST);
|
exaFinishAccess(pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
exaDrawableDirty(pDrawable, x1 + xoff, y1 + yoff, x2 + xoff, y2 + yoff);
|
exaPixmapDirty(pPix, x1 + xoff, y1 + yoff, x2 + xoff, y2 + yoff);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -362,9 +360,8 @@ exaCopyNtoNTwoDir (DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
|
||||||
dst_off_y + pbox->y1 + i,
|
dst_off_y + pbox->y1 + i,
|
||||||
pbox->x2 - pbox->x1, 1);
|
pbox->x2 - pbox->x1, 1);
|
||||||
}
|
}
|
||||||
exaDrawableDirty(pDstDrawable,
|
exaPixmapDirty(pDstPixmap, dst_off_x + pbox->x1, dst_off_y + pbox->y1,
|
||||||
dst_off_x + pbox->x1, dst_off_y + pbox->y1,
|
dst_off_x + pbox->x2, dst_off_y + pbox->y2);
|
||||||
dst_off_x + pbox->x2, dst_off_y + pbox->y2);
|
|
||||||
}
|
}
|
||||||
if (dirsetup != 0)
|
if (dirsetup != 0)
|
||||||
pExaScr->info->DoneCopy(pDstPixmap);
|
pExaScr->info->DoneCopy(pDstPixmap);
|
||||||
|
@ -437,9 +434,9 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
||||||
pbox->x1 + dst_off_x, pbox->y1 + dst_off_y,
|
pbox->x1 + dst_off_x, pbox->y1 + dst_off_y,
|
||||||
pbox->x2 - pbox->x1,
|
pbox->x2 - pbox->x1,
|
||||||
pbox->y2 - pbox->y1);
|
pbox->y2 - pbox->y1);
|
||||||
exaDrawableDirty (pDstDrawable,
|
exaPixmapDirty (pDstPixmap,
|
||||||
pbox->x1 + dst_off_x, pbox->y1 + dst_off_y,
|
pbox->x1 + dst_off_x, pbox->y1 + dst_off_y,
|
||||||
pbox->x2 + dst_off_x, pbox->y2 + dst_off_y);
|
pbox->x2 + dst_off_x, pbox->y2 + dst_off_y);
|
||||||
pbox++;
|
pbox++;
|
||||||
}
|
}
|
||||||
(*pExaScr->info->DoneCopy) (pDstPixmap);
|
(*pExaScr->info->DoneCopy) (pDstPixmap);
|
||||||
|
@ -460,9 +457,7 @@ fallback:
|
||||||
exaFinishAccess (pDstDrawable, EXA_PREPARE_DEST);
|
exaFinishAccess (pDstDrawable, EXA_PREPARE_DEST);
|
||||||
while (nbox--)
|
while (nbox--)
|
||||||
{
|
{
|
||||||
exaDrawableDirty (pDstDrawable,
|
exaDrawableDirty (pDstDrawable, pbox->x1, pbox->y1, pbox->x2, pbox->y2);
|
||||||
pbox->x1 + dst_off_x, pbox->y1 + dst_off_y,
|
|
||||||
pbox->x2 + dst_off_x, pbox->y2 + dst_off_y);
|
|
||||||
pbox++;
|
pbox++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -704,9 +699,8 @@ exaPolyFillRect(DrawablePtr pDrawable,
|
||||||
(*pExaScr->info->Solid) (pPixmap,
|
(*pExaScr->info->Solid) (pPixmap,
|
||||||
fullX1 + xoff, fullY1 + yoff,
|
fullX1 + xoff, fullY1 + yoff,
|
||||||
fullX2 + xoff, fullY2 + yoff);
|
fullX2 + xoff, fullY2 + yoff);
|
||||||
exaDrawableDirty (pDrawable,
|
exaPixmapDirty (pPixmap, fullX1 + xoff, fullY1 + yoff,
|
||||||
fullX1 + xoff, fullY1 + yoff,
|
fullX2 + xoff, fullY2 + yoff);
|
||||||
fullX2 + xoff, fullY2 + yoff);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -736,9 +730,8 @@ exaPolyFillRect(DrawablePtr pDrawable,
|
||||||
(*pExaScr->info->Solid) (pPixmap,
|
(*pExaScr->info->Solid) (pPixmap,
|
||||||
partX1 + xoff, partY1 + yoff,
|
partX1 + xoff, partY1 + yoff,
|
||||||
partX2 + xoff, partY2 + yoff);
|
partX2 + xoff, partY2 + yoff);
|
||||||
exaDrawableDirty (pDrawable,
|
exaPixmapDirty (pPixmap, partX1 + xoff, partY1 + yoff,
|
||||||
partX1 + xoff, partY1 + yoff,
|
partX2 + xoff, partY2 + yoff);
|
||||||
partX2 + xoff, partY2 + yoff);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -770,9 +763,6 @@ exaSolidBoxClipped (DrawablePtr pDrawable,
|
||||||
pixmaps[0].as_src = FALSE;
|
pixmaps[0].as_src = FALSE;
|
||||||
pixmaps[0].pPix = pPixmap = exaGetDrawablePixmap (pDrawable);
|
pixmaps[0].pPix = pPixmap = exaGetDrawablePixmap (pDrawable);
|
||||||
|
|
||||||
/* We need to initialize x/yoff for tracking damage in the fallback case */
|
|
||||||
pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
|
|
||||||
|
|
||||||
if (pExaScr->swappedOut ||
|
if (pExaScr->swappedOut ||
|
||||||
pPixmap->drawable.width > pExaScr->info->maxX ||
|
pPixmap->drawable.width > pExaScr->info->maxX ||
|
||||||
pPixmap->drawable.height > pExaScr->info->maxY)
|
pPixmap->drawable.height > pExaScr->info->maxY)
|
||||||
|
@ -825,13 +815,14 @@ fallback:
|
||||||
if (partY2 <= partY1)
|
if (partY2 <= partY1)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!fallback)
|
if (!fallback) {
|
||||||
(*pExaScr->info->Solid) (pPixmap,
|
(*pExaScr->info->Solid) (pPixmap,
|
||||||
partX1 + xoff, partY1 + yoff,
|
partX1 + xoff, partY1 + yoff,
|
||||||
partX2 + xoff, partY2 + yoff);
|
partX2 + xoff, partY2 + yoff);
|
||||||
exaDrawableDirty (pDrawable,
|
exaPixmapDirty (pPixmap, partX1 + xoff, partY1 + yoff,
|
||||||
partX1 + xoff, partY1 + yoff,
|
partX2 + xoff, partY2 + yoff);
|
||||||
partX2 + xoff, partY2 + yoff);
|
} else
|
||||||
|
exaDrawableDirty (pDrawable, partX1, partY1, partX2, partY2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fallback)
|
if (fallback)
|
||||||
|
@ -950,12 +941,17 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
|
||||||
pPriv->fg,
|
pPriv->fg,
|
||||||
gx + dstXoff,
|
gx + dstXoff,
|
||||||
gHeight);
|
gHeight);
|
||||||
|
exaDrawableDirty (pDrawable, gx, gy, gx + gWidth, gy + gHeight);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
RegionPtr pClip = fbGetCompositeClip(pGC);
|
||||||
|
int nbox;
|
||||||
|
BoxPtr pbox;
|
||||||
|
|
||||||
gStride = GLYPHWIDTHBYTESPADDED(pci) / sizeof (FbStip);
|
gStride = GLYPHWIDTHBYTESPADDED(pci) / sizeof (FbStip);
|
||||||
fbPutXYImage (pDrawable,
|
fbPutXYImage (pDrawable,
|
||||||
fbGetCompositeClip(pGC),
|
pClip,
|
||||||
pPriv->fg,
|
pPriv->fg,
|
||||||
pPriv->bg,
|
pPriv->bg,
|
||||||
pPriv->pm,
|
pPriv->pm,
|
||||||
|
@ -969,9 +965,19 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
|
||||||
(FbStip *) pglyph,
|
(FbStip *) pglyph,
|
||||||
gStride,
|
gStride,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
|
for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip);
|
||||||
|
nbox--; pbox++) {
|
||||||
|
int x1 = max(gx, pbox->x1), x2 = min(gx + gWidth, pbox->x2);
|
||||||
|
int y1 = max(gy, pbox->y1), y2 = min(gy + gHeight, pbox->y2);
|
||||||
|
|
||||||
|
if (x1 >= x2 || y1 >= y2)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
exaDrawableDirty (pDrawable, gx, gy, gx + gWidth,
|
||||||
|
gy + gHeight);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
exaDrawableDirty(pDrawable, gx + dstXoff, gy + dstYoff,
|
|
||||||
gx + dstXoff + gWidth, gy + dstYoff + gHeight);
|
|
||||||
}
|
}
|
||||||
x += pci->metrics.characterWidth;
|
x += pci->metrics.characterWidth;
|
||||||
}
|
}
|
||||||
|
@ -1062,9 +1068,8 @@ exaFillRegionSolid (DrawablePtr pDrawable,
|
||||||
(*pExaScr->info->Solid) (pPixmap,
|
(*pExaScr->info->Solid) (pPixmap,
|
||||||
pBox->x1 + xoff, pBox->y1 + yoff,
|
pBox->x1 + xoff, pBox->y1 + yoff,
|
||||||
pBox->x2 + xoff, pBox->y2 + yoff);
|
pBox->x2 + xoff, pBox->y2 + yoff);
|
||||||
exaDrawableDirty (pDrawable,
|
exaPixmapDirty (pPixmap, pBox->x1 + xoff, pBox->y1 + yoff,
|
||||||
pBox->x1 + xoff, pBox->y1 + yoff,
|
pBox->x2 + xoff, pBox->y2 + yoff);
|
||||||
pBox->x2 + xoff, pBox->y2 + yoff);
|
|
||||||
pBox++;
|
pBox++;
|
||||||
}
|
}
|
||||||
(*pExaScr->info->DoneSolid) (pPixmap);
|
(*pExaScr->info->DoneSolid) (pPixmap);
|
||||||
|
@ -1081,9 +1086,7 @@ fallback:
|
||||||
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
while (nbox--)
|
while (nbox--)
|
||||||
{
|
{
|
||||||
exaDrawableDirty (pDrawable,
|
exaDrawableDirty (pDrawable, pBox->x1, pBox->y1, pBox->x2, pBox->y2);
|
||||||
pBox->x1 + xoff, pBox->y1 + yoff,
|
|
||||||
pBox->x2 + xoff, pBox->y2 + yoff);
|
|
||||||
pBox++;
|
pBox++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1123,9 +1126,6 @@ exaFillRegionTiled (DrawablePtr pDrawable,
|
||||||
pixmaps[1].as_src = TRUE;
|
pixmaps[1].as_src = TRUE;
|
||||||
pixmaps[1].pPix = pTile;
|
pixmaps[1].pPix = pTile;
|
||||||
|
|
||||||
/* We need to initialize x/yoff for tracking damage in the fallback case */
|
|
||||||
pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
|
|
||||||
|
|
||||||
if (pPixmap->drawable.width > pExaScr->info->maxX ||
|
if (pPixmap->drawable.width > pExaScr->info->maxX ||
|
||||||
pPixmap->drawable.height > pExaScr->info->maxY ||
|
pPixmap->drawable.height > pExaScr->info->maxY ||
|
||||||
tileWidth > pExaScr->info->maxX ||
|
tileWidth > pExaScr->info->maxX ||
|
||||||
|
@ -1182,8 +1182,8 @@ exaFillRegionTiled (DrawablePtr pDrawable,
|
||||||
dstY += h;
|
dstY += h;
|
||||||
tileY = 0;
|
tileY = 0;
|
||||||
}
|
}
|
||||||
exaDrawableDirty (pDrawable, pBox->x1 + xoff, pBox->y1 + yoff,
|
exaPixmapDirty (pPixmap, pBox->x1 + xoff, pBox->y1 + yoff,
|
||||||
pBox->x2 + xoff, pBox->y2 + yoff);
|
pBox->x2 + xoff, pBox->y2 + yoff);
|
||||||
pBox++;
|
pBox++;
|
||||||
}
|
}
|
||||||
(*pExaScr->info->DoneCopy) (pPixmap);
|
(*pExaScr->info->DoneCopy) (pPixmap);
|
||||||
|
@ -1202,8 +1202,7 @@ fallback:
|
||||||
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
while (nbox--)
|
while (nbox--)
|
||||||
{
|
{
|
||||||
exaDrawableDirty (pDrawable, pBox->x1 + xoff, pBox->y1 + yoff,
|
exaDrawableDirty (pDrawable, pBox->x1, pBox->y1, pBox->x2, pBox->y2);
|
||||||
pBox->x2 + xoff, pBox->y2 + yoff);
|
|
||||||
pBox++;
|
pBox++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -339,6 +339,9 @@ exaPrepareAccess(DrawablePtr pDrawable, int index);
|
||||||
void
|
void
|
||||||
exaFinishAccess(DrawablePtr pDrawable, int index);
|
exaFinishAccess(DrawablePtr pDrawable, int index);
|
||||||
|
|
||||||
|
void
|
||||||
|
exaPixmapDirty(PixmapPtr pPix, int x1, int y1, int x2, int y2);
|
||||||
|
|
||||||
void
|
void
|
||||||
exaDrawableDirty(DrawablePtr pDrawable, int x1, int y1, int x2, int y2);
|
exaDrawableDirty(DrawablePtr pDrawable, int x1, int y1, int x2, int y2);
|
||||||
|
|
||||||
|
|
|
@ -302,9 +302,8 @@ exaTryDriverSolidFill(PicturePtr pSrc,
|
||||||
(*pExaScr->info->Solid) (pDstPix,
|
(*pExaScr->info->Solid) (pDstPix,
|
||||||
pbox->x1 + dst_off_x, pbox->y1 + dst_off_y,
|
pbox->x1 + dst_off_x, pbox->y1 + dst_off_y,
|
||||||
pbox->x2 + dst_off_x, pbox->y2 + dst_off_y);
|
pbox->x2 + dst_off_x, pbox->y2 + dst_off_y);
|
||||||
exaDrawableDirty (pDst->pDrawable,
|
exaPixmapDirty (pDstPix, pbox->x1 + dst_off_x, pbox->y1 + dst_off_y,
|
||||||
pbox->x1 + dst_off_x, pbox->y1 + dst_off_y,
|
pbox->x2 + dst_off_x, pbox->y2 + dst_off_y);
|
||||||
pbox->x2 + dst_off_x, pbox->y2 + dst_off_y);
|
|
||||||
pbox++;
|
pbox++;
|
||||||
}
|
}
|
||||||
(*pExaScr->info->DoneSolid) (pDstPix);
|
(*pExaScr->info->DoneSolid) (pDstPix);
|
||||||
|
@ -447,9 +446,8 @@ exaTryDriverComposite(CARD8 op,
|
||||||
pbox->y1 + dst_off_y,
|
pbox->y1 + dst_off_y,
|
||||||
pbox->x2 - pbox->x1,
|
pbox->x2 - pbox->x1,
|
||||||
pbox->y2 - pbox->y1);
|
pbox->y2 - pbox->y1);
|
||||||
exaDrawableDirty (pDst->pDrawable,
|
exaPixmapDirty (pDstPix, pbox->x1 + dst_off_x, pbox->y1 + dst_off_y,
|
||||||
pbox->x1 + dst_off_x, pbox->y1 + dst_off_y,
|
pbox->x2 + dst_off_x, pbox->y2 + dst_off_y);
|
||||||
pbox->x2 + dst_off_x, pbox->y2 + dst_off_y);
|
|
||||||
pbox++;
|
pbox++;
|
||||||
}
|
}
|
||||||
(*pExaScr->info->DoneComposite) (pDstPix);
|
(*pExaScr->info->DoneComposite) (pDstPix);
|
||||||
|
@ -712,18 +710,19 @@ void
|
||||||
exaRasterizeTrapezoid (PicturePtr pPicture, xTrapezoid *trap,
|
exaRasterizeTrapezoid (PicturePtr pPicture, xTrapezoid *trap,
|
||||||
int x_off, int y_off)
|
int x_off, int y_off)
|
||||||
{
|
{
|
||||||
|
DrawablePtr pDraw = pPicture->pDrawable;
|
||||||
ExaMigrationRec pixmaps[1];
|
ExaMigrationRec pixmaps[1];
|
||||||
|
|
||||||
pixmaps[0].as_dst = TRUE;
|
pixmaps[0].as_dst = TRUE;
|
||||||
pixmaps[0].as_src = TRUE;
|
pixmaps[0].as_src = TRUE;
|
||||||
pixmaps[0].pPix = exaGetDrawablePixmap (pPicture->pDrawable);
|
pixmaps[0].pPix = exaGetDrawablePixmap (pDraw);
|
||||||
exaDoMigration(pixmaps, 1, FALSE);
|
exaDoMigration(pixmaps, 1, FALSE);
|
||||||
|
|
||||||
exaPrepareAccess(pPicture->pDrawable, EXA_PREPARE_DEST);
|
exaPrepareAccess(pDraw, EXA_PREPARE_DEST);
|
||||||
fbRasterizeTrapezoid(pPicture, trap, x_off, y_off);
|
fbRasterizeTrapezoid(pPicture, trap, x_off, y_off);
|
||||||
exaDrawableDirty(pPicture->pDrawable, 0, 0,
|
exaDrawableDirty(pDraw, pDraw->x, pDraw->y,
|
||||||
pPicture->pDrawable->width, pPicture->pDrawable->height);
|
pDraw->x + pDraw->width, pDraw->y + pDraw->height);
|
||||||
exaFinishAccess(pPicture->pDrawable, EXA_PREPARE_DEST);
|
exaFinishAccess(pDraw, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -734,18 +733,19 @@ void
|
||||||
exaAddTriangles (PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntri,
|
exaAddTriangles (PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntri,
|
||||||
xTriangle *tris)
|
xTriangle *tris)
|
||||||
{
|
{
|
||||||
|
DrawablePtr pDraw = pPicture->pDrawable;
|
||||||
ExaMigrationRec pixmaps[1];
|
ExaMigrationRec pixmaps[1];
|
||||||
|
|
||||||
pixmaps[0].as_dst = TRUE;
|
pixmaps[0].as_dst = TRUE;
|
||||||
pixmaps[0].as_src = TRUE;
|
pixmaps[0].as_src = TRUE;
|
||||||
pixmaps[0].pPix = exaGetDrawablePixmap (pPicture->pDrawable);
|
pixmaps[0].pPix = exaGetDrawablePixmap (pDraw);
|
||||||
exaDoMigration(pixmaps, 1, FALSE);
|
exaDoMigration(pixmaps, 1, FALSE);
|
||||||
|
|
||||||
exaPrepareAccess(pPicture->pDrawable, EXA_PREPARE_DEST);
|
exaPrepareAccess(pDraw, EXA_PREPARE_DEST);
|
||||||
fbAddTriangles(pPicture, x_off, y_off, ntri, tris);
|
fbAddTriangles(pPicture, x_off, y_off, ntri, tris);
|
||||||
exaFinishAccess(pPicture->pDrawable, EXA_PREPARE_DEST);
|
exaDrawableDirty(pDraw, pDraw->x, pDraw->y,
|
||||||
exaDrawableDirty(pPicture->pDrawable, 0, 0,
|
pDraw->x + pDraw->width, pDraw->y + pDraw->height);
|
||||||
pPicture->pDrawable->width, pPicture->pDrawable->height);
|
exaFinishAccess(pDraw, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1036,8 +1036,8 @@ exaGlyphs (CARD8 op,
|
||||||
0, 0, glyph->info.width, glyph->info.height, 0, 0);
|
0, 0, glyph->info.width, glyph->info.height, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
exaDrawableDirty (&pPixmap->drawable, 0, 0,
|
exaPixmapDirty (pPixmap, 0, 0,
|
||||||
glyph->info.width, glyph->info.height);
|
glyph->info.width, glyph->info.height);
|
||||||
|
|
||||||
if (maskFormat)
|
if (maskFormat)
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,26 +23,6 @@
|
||||||
|
|
||||||
#include "exa_priv.h"
|
#include "exa_priv.h"
|
||||||
|
|
||||||
#define TRIM_BOX(box, pGC) if (pGC->pCompositeClip) { \
|
|
||||||
BoxPtr extents = &pGC->pCompositeClip->extents;\
|
|
||||||
if(box.x1 < extents->x1) box.x1 = extents->x1; \
|
|
||||||
if(box.x2 > extents->x2) box.x2 = extents->x2; \
|
|
||||||
if(box.y1 < extents->y1) box.y1 = extents->y1; \
|
|
||||||
if(box.y2 > extents->y2) box.y2 = extents->y2; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define TRANSLATE_BOX(box, pDrawable) { \
|
|
||||||
box.x1 += pDrawable->x; \
|
|
||||||
box.x2 += pDrawable->x; \
|
|
||||||
box.y1 += pDrawable->y; \
|
|
||||||
box.y2 += pDrawable->y; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC) { \
|
|
||||||
TRANSLATE_BOX(box, pDrawable); \
|
|
||||||
TRIM_BOX(box, pGC); \
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These functions wrap the low-level fb rendering functions and
|
* These functions wrap the low-level fb rendering functions and
|
||||||
* synchronize framebuffer/accelerated drawing by stalling until
|
* synchronize framebuffer/accelerated drawing by stalling until
|
||||||
|
@ -222,10 +202,9 @@ ExaCheckPolyFillRect (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
|
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
|
||||||
|
|
||||||
if (nrect) {
|
if (nrect) {
|
||||||
BoxRec box = { .x1 = max(prect->x,0),
|
int x1 = max(prect->x, 0), y1 = max(prect->y, 0);
|
||||||
.x2 = min(prect->x + prect->width,pDrawable->width),
|
int x2 = min(prect->x + prect->width, pDrawable->width);
|
||||||
.y1 = max(prect->y,0),
|
int y2 = min(prect->y + prect->height, pDrawable->height);
|
||||||
.y2 = min(prect->y + prect->height,pDrawable->height) };
|
|
||||||
|
|
||||||
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||||
exaPrepareAccessGC (pGC);
|
exaPrepareAccessGC (pGC);
|
||||||
|
@ -239,15 +218,14 @@ ExaCheckPolyFillRect (DrawablePtr pDrawable, GCPtr pGC,
|
||||||
while (--nrect)
|
while (--nrect)
|
||||||
{
|
{
|
||||||
prect++;
|
prect++;
|
||||||
box.x1 = min(box.x1, prect->x);
|
x1 = min(x1, prect->x);
|
||||||
box.x2 = max(box.x2, prect->x + prect->width);
|
x2 = max(x2, prect->x + prect->width);
|
||||||
box.y1 = min(box.y1, prect->y);
|
y1 = min(y1, prect->y);
|
||||||
box.y2 = max(box.y2, prect->y + prect->height);
|
y2 = max(y2, prect->y + prect->height);
|
||||||
}
|
}
|
||||||
|
|
||||||
TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC);
|
exaDrawableDirty (pDrawable, pDrawable->x + x1, pDrawable->y + y1,
|
||||||
|
pDrawable->x + x2, pDrawable->y + y2);
|
||||||
exaDrawableDirty (pDrawable, box.x1, box.x2, box.y1, box.y2);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue