[PATCH 4/4] composite: Copy the window contents back from the pixmap
Keith Packard
keithp at keithp.com
Mon Dec 20 10:16:22 PST 2010
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.
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
-------------- 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/20101220/af305500/attachment.pgp>
More information about the xorg-devel
mailing list