"Jasper St. Pierre" <[email protected]> writes:

> +static Bool
> +needsPixmapCopy(WindowPtr pWin)
> +{
> +    WindowPtr pChild;
> +
> +    if (pWin->bitGravity != ForgetGravity)
> +        return TRUE;
> +
> +    for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
> +        if (needsPixmapCopy(pChild))
> +            return TRUE;
> +
> +    return FALSE;
> +}

I think you can use TraverseTree here; that has the advantage of not
being recursive.

> +
>  static PixmapPtr
>  compNewPixmap(WindowPtr pWin, int x, int y, int w, int h)
>  {
> @@ -542,54 +557,56 @@ compNewPixmap(WindowPtr pWin, int x, int y, int w, int 
> h)
>      pPixmap->screen_x = x;
>      pPixmap->screen_y = y;
>  
> -    if (pParent->drawable.depth == pWin->drawable.depth) {
> -        GCPtr pGC = GetScratchGC(pWin->drawable.depth, pScreen);
> -
> -        if (pGC) {
> -            ChangeGCVal val;
> -
> -            val.val = IncludeInferiors;
> -            ChangeGC(NullClient, pGC, GCSubwindowMode, &val);
> -            ValidateGC(&pPixmap->drawable, pGC);
> -            (*pGC->ops->CopyArea) (&pParent->drawable,
> -                                   &pPixmap->drawable,
> -                                   pGC,
> -                                   x - pParent->drawable.x,
> -                                   y - pParent->drawable.y, w, h, 0, 0);
> -            FreeScratchGC(pGC);
> +    if (needsPixmapCopy(pWin)) {

I think this part could be replaced with

        if (!needsPixmapCopy(pWin))
                return pPixmap;

That would, at least, be easier to review.

-- 
-keith

Attachment: signature.asc
Description: PGP signature

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to