diff options
author | marha <marha@users.sourceforge.net> | 2010-10-19 19:56:00 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-10-19 19:56:00 +0000 |
commit | 6ab3babba7b1b74528c2194a495fa1e2e67faa55 (patch) | |
tree | ed84a65e3d6f8bebb29359424d69d37b416754a5 /xorg-server/composite | |
parent | d621ea397a3d181e7a0bf07d72bd21e116fccdb8 (diff) | |
download | vcxsrv-6ab3babba7b1b74528c2194a495fa1e2e67faa55.tar.gz vcxsrv-6ab3babba7b1b74528c2194a495fa1e2e67faa55.tar.bz2 vcxsrv-6ab3babba7b1b74528c2194a495fa1e2e67faa55.zip |
xserver update 19/10/2010
Diffstat (limited to 'xorg-server/composite')
-rw-r--r-- | xorg-server/composite/compalloc.c | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/xorg-server/composite/compalloc.c b/xorg-server/composite/compalloc.c index 28e55754d..95f390286 100644 --- a/xorg-server/composite/compalloc.c +++ b/xorg-server/composite/compalloc.c @@ -472,8 +472,19 @@ 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)
+compNewPixmap (WindowPtr pWin, int x, int y, int w, int h, Bool map)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
WindowPtr pParent = pWin->parent;
@@ -487,15 +498,30 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h) pPixmap->screen_x = x;
pPixmap->screen_y = y;
-
+
+ /* resize allocations will update later in compCopyWindow, not here */
+ if (!map)
+ return pPixmap;
+
+ /*
+ * 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;
+
+ /*
+ * Copy bits from the parent into the new pixmap so that it will
+ * have "reasonable" contents in case for background None areas.
+ */
if (pParent->drawable.depth == pWin->drawable.depth)
{
GCPtr pGC = GetScratchGC (pWin->drawable.depth, pScreen);
- /*
- * Copy bits from the parent into the new pixmap so that it will
- * have "reasonable" contents in case for background None areas.
- */
if (pGC)
{
ChangeGCVal val;
@@ -558,7 +584,7 @@ compAllocPixmap (WindowPtr pWin) int y = pWin->drawable.y - bw;
int w = pWin->drawable.width + (bw << 1);
int h = pWin->drawable.height + (bw << 1);
- PixmapPtr pPixmap = compNewPixmap (pWin, x, y, w, h);
+ PixmapPtr pPixmap = compNewPixmap (pWin, x, y, w, h, TRUE);
CompWindowPtr cw = GetCompWindow (pWin);
if (!pPixmap)
@@ -632,7 +658,7 @@ compReallocPixmap (WindowPtr pWin, int draw_x, int draw_y, pix_h = h + (bw << 1);
if (pix_w != pOld->drawable.width || pix_h != pOld->drawable.height)
{
- pNew = compNewPixmap (pWin, pix_x, pix_y, pix_w, pix_h);
+ pNew = compNewPixmap (pWin, pix_x, pix_y, pix_w, pix_h, FALSE);
if (!pNew)
return FALSE;
cw->pOldPixmap = pOld;
|