[PATCH 4/4] composite: Copy the window contents back from the pixmap

Ville Syrjälä ville.syrjala at nokia.com
Mon Dec 20 10:39:50 PST 2010


On Mon, Dec 20, 2010 at 10:16:22AM -0800, ext Keith Packard wrote:
> On Mon, 20 Dec 2010 18:05:42 +0200, ville.syrjala at nokia.com wrote:
> 
> > -void
> > +PixmapPtr
> >  compFreePixmap (WindowPtr pWin)
> >  {
> >      ScreenPtr	    pScreen = pWin->drawable.pScreen;
> > @@ -612,7 +647,8 @@ compFreePixmap (WindowPtr pWin)
> >      pParentPixmap = (*pScreen->GetWindowPixmap) (pWin->parent);
> >      pWin->redirectDraw = RedirectDrawNone;
> >      compSetPixmap (pWin, pParentPixmap);
> > -    (*pScreen->DestroyPixmap) (pRedirectPixmap);
> > +
> > +    return pRedirectPixmap;
> >  }
> 
> This doesn't free the pixmap anymore, so it needs to be renamed, perhaps
> to compSetParentPixmap? Also, it shouldn't be returning the pixmap,
> instead it should remain a void function and the caller should be
> responsible for fetching the pixmap beforehand and freeing afterwards.

OK. I'll adjust the patch accordingly.

> Alternatively, (and I think this is uglier), compCheckRedirect could
> bump the pixmap ref count before calling compFreePixmap and then destroy
> the pixmap after copying the bits.
> 
> 
> -- 
> keith.packard at intel.com



-- 
Ville Syrjälä


More information about the xorg-devel mailing list