From 0998574699502e6ab14fd8899c2e42961d4df7d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Wed, 5 Jan 2011 20:41:05 +0200 Subject: [PATCH] Call SourceValidate even if src == dst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The extra SourceValidate calls from damageCopyArea and damageCopyPlane can be removed. Signed-off-by: Ville Syrjälä Reviewed-by: Keith Packard Reviewed-by: Daniel Stone Signed-off-by: Keith Packard --- doc/xml/Xserver-spec.xml | 3 +-- hw/xfree86/xaa/xaaBitBlt.c | 3 +-- mi/micopy.c | 3 +-- miext/damage/damage.c | 22 ---------------------- 4 files changed, 3 insertions(+), 28 deletions(-) diff --git a/doc/xml/Xserver-spec.xml b/doc/xml/Xserver-spec.xml index f7b2296a2..7d7f9152c 100644 --- a/doc/xml/Xserver-spec.xml +++ b/doc/xml/Xserver-spec.xml @@ -2958,8 +2958,7 @@ The sample server implementation is in Xserver/fb/fbscreen.c. SourceValidate should be called by CopyArea/CopyPlane primitives when -the source drawable is not the same as the destination, and the -SourceValidate function pointer in the screen is non-null. If you know that +the SourceValidate function pointer in the screen is non-null. If you know that you will never need SourceValidate, you can avoid this check. Currently, SourceValidate is used by the mi software cursor code to remove the cursor from the screen when the source rectangle overlaps the cursor position. diff --git a/hw/xfree86/xaa/xaaBitBlt.c b/hw/xfree86/xaa/xaaBitBlt.c index dfe51ea09..049dbfbe7 100644 --- a/hw/xfree86/xaa/xaaBitBlt.c +++ b/hw/xfree86/xaa/xaaBitBlt.c @@ -54,8 +54,7 @@ XAABitBlt( origDest.x = dstx; origDest.y = dsty; - if((pSrcDrawable != pDstDrawable) && - pSrcDrawable->pScreen->SourceValidate) { + if (pSrcDrawable->pScreen->SourceValidate) { (*pSrcDrawable->pScreen->SourceValidate) ( pSrcDrawable, srcx, srcy, width, height, pGC->subWindowMode); diff --git a/mi/micopy.c b/mi/micopy.c index 50e266752..652c6207e 100644 --- a/mi/micopy.c +++ b/mi/micopy.c @@ -183,8 +183,7 @@ miDoCopy (DrawablePtr pSrcDrawable, return NULL; } - if ((pSrcDrawable != pDstDrawable) && - pSrcDrawable->pScreen->SourceValidate) + if (pSrcDrawable->pScreen->SourceValidate) { (*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, xIn, yIn, widthSrc, heightSrc, pGC->subWindowMode); diff --git a/miext/damage/damage.c b/miext/damage/damage.c index d0e0fe4d3..566995c41 100644 --- a/miext/damage/damage.c +++ b/miext/damage/damage.c @@ -891,17 +891,6 @@ damageCopyArea(DrawablePtr pSrc, RegionPtr ret; DAMAGE_GC_OP_PROLOGUE(pGC, pDst); - /* The driver will only call SourceValidate() when pSrc != pDst, - * but the software sprite (misprite.c) always need to know when a - * drawable is copied so it can remove the sprite. See #1030. */ - if ((pSrc == pDst) && pSrc->pScreen->SourceValidate && - pSrc->type == DRAWABLE_WINDOW && - ((WindowPtr)pSrc)->viewable) - { - (*pSrc->pScreen->SourceValidate) (pSrc, srcx, srcy, width, height, - pGC->subWindowMode); - } - if (checkGCDamage (pDst, pGC)) { BoxRec box; @@ -938,17 +927,6 @@ damageCopyPlane(DrawablePtr pSrc, RegionPtr ret; DAMAGE_GC_OP_PROLOGUE(pGC, pDst); - /* The driver will only call SourceValidate() when pSrc != pDst, - * but the software sprite (misprite.c) always need to know when a - * drawable is copied so it can remove the sprite. See #1030. */ - if ((pSrc == pDst) && pSrc->pScreen->SourceValidate && - pSrc->type == DRAWABLE_WINDOW && - ((WindowPtr)pSrc)->viewable) - { - (*pSrc->pScreen->SourceValidate) (pSrc, srcx, srcy, width, height, - pGC->subWindowMode); - } - if (checkGCDamage (pDst, pGC)) { BoxRec box;