dix, composite: Optimize setting window backing store state

We hide CWBackingStore from the screen hook if nothing's actually
changing, which means compChangeWindowAttributes no longer needs to
compare the requested state with the present one.
This commit is contained in:
Adam Jackson 2019-03-14 16:34:40 -04:00 committed by Adam Jackson
parent 4e101e7e3b
commit 0f477cc68b
2 changed files with 8 additions and 2 deletions

View File

@ -108,11 +108,11 @@ compInstallColormap(ColormapPtr pColormap)
static void
compCheckBackingStore(WindowPtr pWin)
{
if (pWin->backingStore != NotUseful && !pWin->backStorage) {
if (pWin->backingStore != NotUseful) {
compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic);
pWin->backStorage = TRUE;
}
else if (pWin->backingStore == NotUseful && pWin->backStorage) {
else {
compUnredirectWindow(serverClient, pWin,
CompositeRedirectAutomatic);
pWin->backStorage = FALSE;

View File

@ -1328,6 +1328,12 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
client->errorValue = val;
goto PatchUp;
}
/* if we're not actually changing the window's state, hide
* CWBackingStore from vmaskCopy so it doesn't get passed to
* ->ChangeWindowAttributes below
*/
if (pWin->backingStore == val)
continue;
pWin->backingStore = val;
break;
case CWBackingPlanes: