summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2010-10-18 15:50:37 -0400
committerAdam Jackson <ajax@redhat.com>2010-10-18 17:37:10 -0400
commit6dd775f57d2f94f0ddaee324aeec33b9b66ed5bc (patch)
tree0b7835861d1c8cea7021faac97bdcb67c892afa2
parentd2064fbb687839c297a851a5d85f32dfbbe4a0d5 (diff)
composite: Don't backfill non-bg-None windows
If there's a defined background then backfilling is a waste of effort, since exposure processing will paint that in for us. But note that we have to backfill if any children are bg=None to preserve semantics with non-composited servers. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r--composite/compalloc.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/composite/compalloc.c b/composite/compalloc.c
index d8ccc1181..253acb31d 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -472,6 +472,17 @@ compUnredirectOneSubwindow (WindowPtr pParent, WindowPtr pWin)
return Success;
}
+static int
+bgNoneVisitWindow(WindowPtr pWin, void *null)
+{
+ if (pWin->backgroundState != BackgroundPixmap)
+ return WT_WALKCHILDREN;
+ if (pWin->background.pixmap != None)
+ return WT_WALKCHILDREN;
+
+ return WT_STOPWALKING;
+}
+
static PixmapPtr
compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
{
@@ -487,7 +498,18 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
pPixmap->screen_x = x;
pPixmap->screen_y = y;
-
+
+ /*
+ * If there's no bg=None in the tree, we're done.
+ *
+ * We could optimize this more by collection the regions of all the
+ * bg=None subwindows and feeding that in as the clip for the
+ * CopyArea below, but since window trees are shallow these days it
+ * might not be worth the effort.
+ */
+ if (TraverseTree(pWin, bgNoneVisitWindow, NULL) == WT_NOMATCH)
+ return pPixmap;
+
if (pParent->drawable.depth == pWin->drawable.depth)
{
GCPtr pGC = GetScratchGC (pWin->drawable.depth, pScreen);