summaryrefslogtreecommitdiff
path: root/exa/exa_render.c
diff options
context:
space:
mode:
authorMaarten Maathuis <madman2003@gmail.com>2008-08-29 22:15:23 +0200
committerMaarten Maathuis <madman2003@gmail.com>2008-08-29 22:15:23 +0200
commit1861250cd7e84b05e8298b74e3c7e97da72ddfba (patch)
tree1027bb4b5830f0ec336e9e082f4b5dc73fe4bea8 /exa/exa_render.c
parent5af77d43fe812e127d5d335527fa940ab9d95f38 (diff)
{damage,exa}: sanitise damage
- Redo damage naming for more consistency. - Call post submission functions only where appropriate. - EXA can now live without it's odd damage workarounds.
Diffstat (limited to 'exa/exa_render.c')
-rw-r--r--exa/exa_render.c45
1 files changed, 22 insertions, 23 deletions
diff --git a/exa/exa_render.c b/exa/exa_render.c
index bafa30999..9f6ac3f92 100644
--- a/exa/exa_render.c
+++ b/exa/exa_render.c
@@ -466,11 +466,11 @@ exaCompositeRects(CARD8 op,
{
PixmapPtr pPixmap = exaGetDrawablePixmap(pDst->pDrawable);
ExaPixmapPriv(pPixmap);
- RegionRec region;
int n;
ExaCompositeRectPtr r;
if (pExaPixmap->pDamage) {
+ RegionRec region;
int x1 = MAXSHORT;
int y1 = MAXSHORT;
int x2 = MINSHORT;
@@ -518,7 +518,9 @@ exaCompositeRects(CARD8 op,
REGION_INIT(pScreen, &region, &box, 1);
- exaDamageDestForMigration(pDst->pDrawable, pPixmap, &region);
+ DamageRegionPending(pDst->pDrawable, &region);
+
+ REGION_UNINIT(pScreen, &region);
}
/************************************************************/
@@ -543,13 +545,10 @@ exaCompositeRects(CARD8 op,
if (pExaPixmap->pDamage) {
/* Now we have to flush the damage out from pendingDamage => damage
- * Calling DamageDamageRegion has that effect. (We could pass
- * in an empty region here, but we pass in the same region we
- * use above; the effect is the same.)
+ * Calling DamageRegionSubmitted has that effect.
*/
- DamageDamageRegion(pDst->pDrawable, &region);
- REGION_UNINIT(pScreen, &region);
+ DamageRegionSubmitted(pDst->pDrawable);
}
}
@@ -1064,16 +1063,20 @@ exaTrapezoids (CARD8 op, PicturePtr pSrc, PicturePtr pDst,
DrawablePtr pDraw = pDst->pDrawable;
PixmapPtr pixmap = exaGetDrawablePixmap (pDraw);
ExaPixmapPriv (pixmap);
- RegionRec migration;
+ /* Damage manually, because Trapezoids expects to hit Composite normally. */
+ /* Composite is wrapped by damage, but Trapezoids isn't. */
if (pExaPixmap->pDamage) {
+ RegionRec migration;
+
bounds.x1 += pDraw->x;
bounds.y1 += pDraw->y;
bounds.x2 += pDraw->x;
bounds.y2 += pDraw->y;
REGION_INIT(pScreen, &migration, &bounds, 1);
- exaDamageDestForMigration(pDraw, pixmap, &migration);
+ DamageRegionPending(pDraw, &migration);
+ REGION_UNINIT(pScreen, &migration);
}
exaPrepareAccess(pDraw, EXA_PREPARE_DEST);
@@ -1083,12 +1086,8 @@ exaTrapezoids (CARD8 op, PicturePtr pSrc, PicturePtr pDst,
exaFinishAccess(pDraw, EXA_PREPARE_DEST);
- /* Damage manually, because Trapezoids expects to hit Composite normally. */
- /* Composite is wrapped by damage, but Trapezoids isn't. */
- if (pExaPixmap->pDamage) {
- DamageDamageRegion(pDraw, &migration);
- REGION_UNINIT(pScreen, &migration);
- }
+ if (pExaPixmap->pDamage)
+ DamageRegionSubmitted(pDraw);
}
else if (maskFormat)
{
@@ -1168,28 +1167,28 @@ exaTriangles (CARD8 op, PicturePtr pSrc, PicturePtr pDst,
DrawablePtr pDraw = pDst->pDrawable;
PixmapPtr pixmap = exaGetDrawablePixmap (pDraw);
ExaPixmapPriv (pixmap);
- RegionRec migration;
+ /* Damage manually, because Triangles expects to hit Composite normally. */
+ /* Composite is wrapped by damage, but Triangles isn't. */
if (pExaPixmap->pDamage) {
+ RegionRec migration;
+
bounds.x1 += pDraw->x;
bounds.y1 += pDraw->y;
bounds.x2 += pDraw->x;
bounds.y2 += pDraw->y;
REGION_INIT(pScreen, &migration, &bounds, 1);
- exaDamageDestForMigration(pDraw, pixmap, &migration);
+ DamageRegionPending(pDraw, &migration);
+ REGION_UNINIT(pScreen, &migration);
}
exaPrepareAccess(pDraw, EXA_PREPARE_DEST);
(*ps->AddTriangles) (pDst, 0, 0, ntri, tris);
exaFinishAccess(pDraw, EXA_PREPARE_DEST);
- /* Damage manually, because Triangles expects to hit Composite normally. */
- /* Composite is wrapped by damage, but Triangles isn't. */
- if (pExaPixmap->pDamage) {
- DamageDamageRegion(pDraw, &migration);
- REGION_UNINIT(pScreen, &migration);
- }
+ if (pExaPixmap->pDamage)
+ DamageRegionSubmitted(pDraw);
}
else if (maskFormat)
{