[PATCH 2/2] composite: Don't backfill non-MapWindow allocations

Aaron Plattner aplattner at nvidia.com
Wed May 5 17:20:24 PDT 2010


On Wed, May 05, 2010 at 01:25:29PM -0700, Adam Jackson wrote:
> Signed-off-by: Adam Jackson <ajax at redhat.com>
> ---
>  composite/compalloc.c |   10 +++++++---
>  1 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/composite/compalloc.c b/composite/compalloc.c
> index d21b41d..d5cde58 100644
> --- a/composite/compalloc.c
> +++ b/composite/compalloc.c
> @@ -472,7 +472,7 @@ compUnredirectOneSubwindow (WindowPtr pParent, WindowPtr pWin)
>  }
>  
>  static PixmapPtr
> -compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
> +compNewPixmap (WindowPtr pWin, int x, int y, int w, int h, Bool map)
>  {
>      ScreenPtr	    pScreen = pWin->drawable.pScreen;
>      WindowPtr	    pParent = pWin->parent;
> @@ -493,6 +493,10 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
>      if (pWin->background.pixmap != None)
>          return pPixmap;
>  
> +    /* if this isn't an allocation in service of MapWindow, we're done */
> +    if (!map)
> +        return pPixmap;

Just to make sure I understand this right, does this work because the
compReallocPixmap callers always go through the compCopyWindow path and use
CopyArea to initialize the new pixmap?  It would be nice if that were
described in the commit log, and maybe in the source code.

>      if (pParent->drawable.depth == pWin->drawable.depth)
>      {
>  	GCPtr	pGC = GetScratchGC (pWin->drawable.depth, pScreen);
> @@ -562,7 +566,7 @@ compAllocPixmap (WindowPtr pWin)
>      int		    y = pWin->drawable.y - bw;
>      int		    w = pWin->drawable.width + (bw << 1);
>      int		    h = pWin->drawable.height + (bw << 1);
> -    PixmapPtr	    pPixmap = compNewPixmap (pWin, x, y, w, h);
> +    PixmapPtr	    pPixmap = compNewPixmap (pWin, x, y, w, h, TRUE);
>      CompWindowPtr   cw = GetCompWindow (pWin);
>  
>      if (!pPixmap)
> @@ -636,7 +640,7 @@ compReallocPixmap (WindowPtr pWin, int draw_x, int draw_y,
>      pix_h = h + (bw << 1);
>      if (pix_w != pOld->drawable.width || pix_h != pOld->drawable.height)
>      {
> -	pNew = compNewPixmap (pWin, pix_x, pix_y, pix_w, pix_h);
> +	pNew = compNewPixmap (pWin, pix_x, pix_y, pix_w, pix_h, FALSE);
>  	if (!pNew)
>  	    return FALSE;
>  	cw->pOldPixmap = pOld;
> -- 
> 1.6.5.2


More information about the xorg-devel mailing list