diff options
author | Adam Jackson <ajax@redhat.com> | 2013-08-26 14:03:51 -0400 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2013-09-10 14:28:35 -0400 |
commit | d08966227e7d567df8d26eebc80f35f886e59a4a (patch) | |
tree | 582089dde20de0aab4e987b42d220a016c96b580 | |
parent | 28708a045de7d9043d20fb06b61c44a46eb5526b (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>
-rw-r--r-- | composite/compalloc.c | 4 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86Rotate.c | 6 | ||||
-rw-r--r-- | mi/misprite.c | 3 | ||||
-rw-r--r-- | miext/damage/damage.c | 5 | ||||
-rw-r--r-- | miext/damage/damage.h | 2 | ||||
-rw-r--r-- | miext/shadow/shadow.c | 2 |
6 files changed, 9 insertions, 13 deletions
diff --git a/composite/compalloc.c b/composite/compalloc.c index cc69c68f2..b7d731e33 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -205,7 +205,7 @@ compRedirectWindow(ClientPtr pClient, WindowPtr pWin, int update) anyMarked = compMarkWindows(pWin, &pLayerWin); if (cw->damageRegistered) { - DamageUnregister(&pWin->drawable, cw->damage); + DamageUnregister(cw->damage); cw->damageRegistered = FALSE; } cw->update = CompositeRedirectManual; @@ -638,7 +638,7 @@ compSetParentPixmap(WindowPtr pWin) CompWindowPtr cw = GetCompWindow(pWin); if (cw->damageRegistered) { - DamageUnregister(&pWin->drawable, cw->damage); + DamageUnregister(cw->damage); cw->damageRegistered = FALSE; DamageEmpty(cw->damage); } diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index a3937478f..495af9ba7 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -272,14 +272,10 @@ xf86RotateDestroy(xf86CrtcPtr crtc) screenDrawable = &pScreen->root->drawable; /* Free damage structure */ if (xf86_config->rotation_damage_registered) { - if (screenDrawable) - DamageUnregister(screenDrawable, - xf86_config->rotation_damage); xf86_config->rotation_damage_registered = FALSE; DisableLimitedSchedulingLatency(); } - if (screenDrawable) - DamageDestroy(xf86_config->rotation_damage); + DamageDestroy(xf86_config->rotation_damage); xf86_config->rotation_damage = NULL; } } diff --git a/mi/misprite.c b/mi/misprite.c index 8163f5b95..85ca022ed 100644 --- a/mi/misprite.c +++ b/mi/misprite.c @@ -146,8 +146,7 @@ static void miSpriteDisableDamage(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv) { if (pScreenPriv->damageRegistered) { - DamageUnregister(&(pScreen->GetScreenPixmap(pScreen)->drawable), - pScreenPriv->pDamage); + DamageUnregister(pScreenPriv->pDamage); pScreenPriv->damageRegistered = 0; } } 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; |