summaryrefslogtreecommitdiff
path: root/miext
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2013-08-26 14:03:51 -0400
committerAdam Jackson <ajax@redhat.com>2013-09-10 14:28:35 -0400
commitd08966227e7d567df8d26eebc80f35f886e59a4a (patch)
tree582089dde20de0aab4e987b42d220a016c96b580 /miext
parent28708a045de7d9043d20fb06b61c44a46eb5526b (diff)
damage: Simplify DamageUnregister
You can only register one drawable on a given damage, so there's no reason to require the caller to specify the drawable, the damage is enough. The implementation would do something fairly horrible if you _did_ pass mismatched drawable and damage, so let's avoid the problem entirely. v2: Simplify xf86RotateDestroy even more [anholt] Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'miext')
-rw-r--r--miext/damage/damage.c5
-rw-r--r--miext/damage/damage.h2
-rw-r--r--miext/shadow/shadow.c2
3 files changed, 5 insertions, 4 deletions
diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index cf4b61a20..2b9c35040 100644
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -1843,8 +1843,9 @@ DamageDrawInternal(ScreenPtr pScreen, Bool enable)
}
void
-DamageUnregister(DrawablePtr pDrawable, DamagePtr pDamage)
+DamageUnregister(DamagePtr pDamage)
{
+ DrawablePtr pDrawable = pDamage->pDrawable;
ScreenPtr pScreen = pDrawable->pScreen;
damageScrPriv(pScreen);
@@ -1888,7 +1889,7 @@ DamageDestroy(DamagePtr pDamage)
damageScrPriv(pScreen);
if (pDamage->pDrawable)
- DamageUnregister(pDamage->pDrawable, pDamage);
+ DamageUnregister(pDamage);
if (pDamage->damageDestroy)
(*pDamage->damageDestroy) (pDamage, pDamage->closure);
diff --git a/miext/damage/damage.h b/miext/damage/damage.h
index c2c313a15..e5d6913d4 100644
--- a/miext/damage/damage.h
+++ b/miext/damage/damage.h
@@ -80,7 +80,7 @@ extern _X_EXPORT void
DamageRegister(DrawablePtr pDrawable, DamagePtr pDamage);
extern _X_EXPORT void
- DamageUnregister(DrawablePtr pDrawable, DamagePtr pDamage);
+ DamageUnregister(DamagePtr pDamage);
extern _X_EXPORT void
DamageDestroy(DamagePtr pDamage);
diff --git a/miext/shadow/shadow.c b/miext/shadow/shadow.c
index 2d869e54b..1a9088c43 100644
--- a/miext/shadow/shadow.c
+++ b/miext/shadow/shadow.c
@@ -219,7 +219,7 @@ shadowRemove(ScreenPtr pScreen, PixmapPtr pPixmap)
shadowBuf(pScreen);
if (pBuf->pPixmap) {
- DamageUnregister(&pBuf->pPixmap->drawable, pBuf->pDamage);
+ DamageUnregister(pBuf->pDamage);
pBuf->update = 0;
pBuf->window = 0;
pBuf->randr = 0;