summaryrefslogtreecommitdiff
path: root/composite
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-10-27 13:38:21 -0700
committerKeith Packard <keithp@keithp.com>2014-10-27 13:38:21 -0700
commit5574a0a07e83ff989c074c44d3ea9db0a819f472 (patch)
treebf34f5408a3a6765a87d8a2348d6a4d4905c0104 /composite
parentdf6a3a07f60c40bab2b59b9b3ba0c20c8fb7e95d (diff)
composite: Skip SetWindowPixmap when pixmap isn't changing
Check the current window pixmap to see if it matches the new pixmap and avoid calling SetWindowPixmap in that case. x11perf -ucreate highlights an instance where compCreateWindow reassigns the same Pixmap to the Window. Currently this triggers an expensive invalidation of the entire window hierachy, making sure that DRI2 clients are kept informed of the handle changes. However, as the backing Pixmap for the Window is actually unchanged, there is no need to do anything in this case. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'composite')
-rw-r--r--composite/compwindow.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/composite/compwindow.c b/composite/compwindow.c
index 9a6b2dae8..77bdfa23c 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -567,10 +567,11 @@ compCreateWindow(WindowPtr pWin)
if (pWin->parent && ret) {
CompSubwindowsPtr csw = GetCompSubwindows(pWin->parent);
CompClientWindowPtr ccw;
+ PixmapPtr parent_pixmap = (*pScreen->GetWindowPixmap)(pWin->parent);
+ PixmapPtr window_pixmap = (*pScreen->GetWindowPixmap)(pWin);
- (*pScreen->SetWindowPixmap) (pWin,
- (*pScreen->GetWindowPixmap) (pWin->
- parent));
+ if (window_pixmap != parent_pixmap)
+ (*pScreen->SetWindowPixmap) (pWin, parent_pixmap);
if (csw)
for (ccw = csw->clients; ccw; ccw = ccw->next)
compRedirectWindow(clients[CLIENT_ID(ccw->id)],