[PATCH] composite: Convert compWindowUpdate to use TraverseTree

Keith Packard keithp at keithp.com
Wed Sep 8 12:35:15 PDT 2010


On Wed,  8 Sep 2010 14:04:40 -0400, Adam Jackson <ajax at redhat.com> wrote:
> Signed-off-by: Adam Jackson <ajax at redhat.com>
> ---
>  composite/compwindow.c |   36 +++++++++++++++++-------------------
>  1 files changed, 17 insertions(+), 19 deletions(-)
> 
> diff --git a/composite/compwindow.c b/composite/compwindow.c
> index 160b764..df06c88 100644
> --- a/composite/compwindow.c
> +++ b/composite/compwindow.c
> @@ -639,10 +639,9 @@ compWindowFormat (WindowPtr pWin)
>  }
>  
>  static void
> -compWindowUpdateAutomatic (WindowPtr pWin)
> +compWindowUpdateAutomatic (WindowPtr pWin, ScreenPtr pScreen)
>  {
>      CompWindowPtr   cw = GetCompWindow (pWin);
> -    ScreenPtr	    pScreen = pWin->drawable.pScreen;
>      WindowPtr	    pParent = pWin->parent;
>      PixmapPtr	    pSrcPixmap = (*pScreen->GetWindowPixmap) (pWin);
>      PictFormatPtr   pSrcFormat = compWindowFormat (pWin);
> @@ -665,8 +664,7 @@ compWindowUpdateAutomatic (WindowPtr pWin)
>      /*
>       * First move the region from window to screen coordinates
>       */
> -    RegionTranslate(pRegion,
> -		      pWin->drawable.x, pWin->drawable.y);
> +    RegionTranslate(pRegion, pWin->drawable.x, pWin->drawable.y);
>  
>      /*
>       * Clip against the "real" border clip
> @@ -676,8 +674,7 @@ compWindowUpdateAutomatic (WindowPtr pWin)
>      /*
>       * Now translate from screen to dest coordinates
>       */
> -    RegionTranslate(pRegion,
> -		      -pParent->drawable.x, -pParent->drawable.y);
> +    RegionTranslate(pRegion, -pParent->drawable.x, -pParent->drawable.y);
>  
>      /*
>       * Clip the picture
> @@ -706,23 +703,24 @@ compWindowUpdateAutomatic (WindowPtr pWin)
>      DamageEmpty (cw->damage);
>  }
>  
> -void
> -compWindowUpdate (WindowPtr pWin)
> +static int
> +compWindowUpdateVisit(WindowPtr pWin, void *data)
>  {
> -    WindowPtr	pChild;
> -
> -    for (pChild = pWin->lastChild; pChild; pChild = pChild->prevSib)
> -	compWindowUpdate (pChild);
> -    if (pWin->redirectDraw != RedirectDrawNone)
> +    if (pWin->redirectDraw == RedirectDrawAutomatic)

This should not be necessary; I'd love to see proof that it changes what
the server does.

>      {
> -	CompWindowPtr	cw = GetCompWindow(pWin);
> -
> +	CompWindowPtr cw = GetCompWindow(pWin);
>  	if (cw->damaged)
> -	{
> -	    compWindowUpdateAutomatic (pWin);
> -	    cw->damaged = FALSE;
> -	}
> +	    compWindowUpdateAutomatic(pWin, data);
> +	cw->damaged = FALSE;

We've already tested for this; no reason to dirty the cache line; you're
not saving a branch.

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100908/0f732b26/attachment.pgp>


More information about the xorg-devel mailing list