Skip to content

Commit

Permalink
Replace usage of DamageRegionAppend with DamageDamageRegion to fix re…
Browse files Browse the repository at this point in the history
…portAfter.

In all these cases, any rendering implied by this damage has already
occurred, and we want to get the damage out to the client.  Some of
the DamageRegionAppend calls were explicitly telling damage to flush
the reportAfter damage out, but not all.

Bug #30260. Fixes the compiz wallpaper plugin with client damage
changed to reportAfter.

Signed-off-by: Eric Anholt <[email protected]>
Reviewed-by: Keith Packard <[email protected]>
Signed-off-by: Keith Packard <[email protected]>
  • Loading branch information
anholt authored and keith-packard committed Nov 10, 2010
1 parent c80c417 commit f36153e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composite/compalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ compFreeClientWindow (WindowPtr pWin, XID id)
DamageRegister (&pWin->drawable, cw->damage);
cw->damageRegistered = TRUE;
pWin->redirectDraw = RedirectDrawAutomatic;
DamageRegionAppend(&pWin->drawable, &pWin->borderSize);
DamageDamageRegion(&pWin->drawable, &pWin->borderSize);
}
if (wasMapped && !pWin->mapped)
{
Expand Down
4 changes: 2 additions & 2 deletions composite/compwindow.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
RegionTranslate(prgnSrc,
pWin->drawable.x - ptOldOrg.x,
pWin->drawable.y - ptOldOrg.y);
DamageRegionAppend(&pWin->drawable, prgnSrc);
DamageDamageRegion(&pWin->drawable, prgnSrc);
}
cs->CopyWindow = pScreen->CopyWindow;
pScreen->CopyWindow = compCopyWindow;
Expand Down Expand Up @@ -598,7 +598,7 @@ compSetRedirectBorderClip (WindowPtr pWin, RegionPtr pRegion)
/*
* Report that as damaged so it will be redrawn
*/
DamageRegionAppend(&pWin->drawable, &damage);
DamageDamageRegion(&pWin->drawable, &damage);
RegionUninit(&damage);
/*
* Save the new border clip region
Expand Down
4 changes: 2 additions & 2 deletions damageext/damageext.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ ProcDamageCreate (ClientPtr client)
if (pDrawable->type == DRAWABLE_WINDOW)
{
pRegion = &((WindowPtr) pDrawable)->borderClip;
DamageRegionAppend(pDrawable, pRegion);
DamageDamageRegion(pDrawable, pRegion);
}

return Success;
Expand Down Expand Up @@ -292,7 +292,7 @@ ProcDamageAdd (ClientPtr client)
* screen coordinates like damage expects.
*/
RegionTranslate(pRegion, pDrawable->x, pDrawable->y);
DamageRegionAppend(pDrawable, pRegion);
DamageDamageRegion(pDrawable, pRegion);
RegionTranslate(pRegion, -pDrawable->x, -pDrawable->y);

return Success;
Expand Down
3 changes: 1 addition & 2 deletions exa/exa.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ exaPixmapDirty (PixmapPtr pPix, int x1, int y1, int x2, int y2)
return;

RegionInit(&region, &box, 1);
DamageRegionAppend(&pPix->drawable, &region);
DamageRegionProcessPending(&pPix->drawable);
DamageDamageRegion(&pPix->drawable, &region);
RegionUninit(&region);
}

Expand Down
4 changes: 1 addition & 3 deletions glx/glxdri.c
Original file line number Diff line number Diff line change
Expand Up @@ -834,9 +834,7 @@ static void __glXReportDamage(__DRIdrawable *driDraw,

RegionInit(&region, (BoxPtr) rects, num_rects);
RegionTranslate(&region, pDraw->x, pDraw->y);
DamageRegionAppend(pDraw, &region);
/* This is wrong, this needs a seperate function. */
DamageRegionProcessPending(pDraw);
DamageDamageRegion(pDraw, &region);
RegionUninit(&region);

__glXleaveServer(GL_FALSE);
Expand Down
2 changes: 1 addition & 1 deletion hw/xfree86/modes/xf86Rotate.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ xf86CrtcDamageShadow (xf86CrtcPtr crtc)
if (damage_box.x2 > pScreen->width) damage_box.x2 = pScreen->width;
if (damage_box.y2 > pScreen->height) damage_box.y2 = pScreen->height;
RegionInit(&damage_region, &damage_box, 1);
DamageRegionAppend (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
DamageDamageRegion (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
&damage_region);
RegionUninit(&damage_region);
crtc->shadowClear = TRUE;
Expand Down

0 comments on commit f36153e

Please sign in to comment.