Adam Jackson <[email protected]> writes: > Keep the pixmap at unmap, always try to realize backing store, always > mark them when marking, and update paintable when backed.
Reading this reminded me of how Xt applications used backing store 'back
in the day'. Because of the (broken) backing store implementation in the
server, to save the contents of an entire application window, you'd
actually have to set backing store on every single window in the tree.
I think that's going to cause a lot of extra allocations in this code,
but I can't think of a great way to avoid that.
> static void
> +compCheckPaintable(WindowPtr pWin)
> +{
> + pWin->paintable = pWin->viewable || pWin->backingStore == Always;
> +}
> +
What happens when the pixmap allocation fails? Do we handle this case at
all anymore?
> +static void
> compCheckBackingStore(WindowPtr pWin)
> {
> - if (pWin->backingStore != NotUseful && !pWin->backStorage) {
> + Bool should =
> + (pWin->backingStore == Always) ||
> + (pWin->backingStore == WhenMapped && pWin->viewable);
> +
> + if (should && !pWin->backStorage) {
> + compCheckPaintable(pWin);
> compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic);
> pWin->backStorage = TRUE;
> }
> - else if (pWin->backingStore == NotUseful && pWin->backStorage) {
> + else if (!should && pWin->backStorage) {
> + compCheckPaintable(pWin);
> compUnredirectWindow(serverClient, pWin,
> CompositeRedirectAutomatic);
> pWin->backStorage = FALSE;
Were you going to hack this code to avoid redirecting when the window
was Unobscured? Is this code called after the visibility value has been
computed so we could just use that?
> +
> + /* UnrealizeTree walks from root to leaves, so only need to check parent
> */
> + if (backed(pWin) && pWin->parent->paintable)
> + pWin->paintable = TRUE;
> +
What happens when the child is redirected and doesn't have backing store
selected? Does the window pixmap still get allocated?
> @@ -594,6 +643,14 @@ compDestroyWindow(WindowPtr pWin)
> CompSubwindowsPtr csw;
> Bool ret;
>
> + /*
> + * Take down bs explicitly, to get ->backStorage cleared
> + */
> + if (pWin->backingStore != NotUseful) {
> + pWin->backingStore = NotUseful;
> + pScreen->ChangeWindowAttributes(pWin, CWBackingStore);
> + }
> +
That's kinda ugly; any reason you can't just go clear it directly? Avoid
a whole trip through the ChangeWindowAttributes call list?
--
[email protected]
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
