summaryrefslogtreecommitdiff
path: root/composite
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-09-19 07:25:55 -0400
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-09-19 07:25:55 -0400
commit97c150b61bbe436453b05d3c07cd2173870aac40 (patch)
tree5335d0df93703e7ca8617cfae57315709d032a29 /composite
parent57907e0943da0c3fd3bf6c128d210b544629ce72 (diff)
parent547ad2125ece93bbe01f6d09a3baf176ebd16bb3 (diff)
Merge branch 'master' into XACE-SELINUX
Conflicts: afb/afbpntwin.c afb/afbscrinit.c afb/afbwindow.c cfb/cfb.h cfb/cfballpriv.c cfb/cfbscrinit.c cfb/cfbwindow.c configure.ac fb/wfbrename.h hw/xfree86/xf4bpp/ppcIO.c hw/xfree86/xf4bpp/ppcPntWin.c hw/xfree86/xf4bpp/ppcWindow.c hw/xfree86/xf8_32bpp/cfbscrinit.c mfb/mfb.h mfb/mfbpntwin.c mfb/mfbscrinit.c mfb/mfbwindow.c mi/miexpose.c Note: conflicts caused by devPrivates rework vs. paintwindow changes.
Diffstat (limited to 'composite')
-rw-r--r--composite/compalloc.c73
-rw-r--r--composite/compinit.c4
-rw-r--r--composite/compint.h7
-rw-r--r--composite/compwindow.c19
4 files changed, 60 insertions, 43 deletions
diff --git a/composite/compalloc.c b/composite/compalloc.c
index dbb7f3a05..4666ff01f 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -461,7 +461,6 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
ScreenPtr pScreen = pWin->drawable.pScreen;
WindowPtr pParent = pWin->parent;
PixmapPtr pPixmap;
- GCPtr pGC;
pPixmap = (*pScreen->CreatePixmap) (pScreen, w, h, pWin->drawable.depth);
@@ -471,25 +470,63 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
pPixmap->screen_x = x;
pPixmap->screen_y = y;
- 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)
+ if (pParent->drawable.depth == pWin->drawable.depth)
{
- XID val = IncludeInferiors;
+ GCPtr pGC = GetScratchGC (pWin->drawable.depth, pScreen);
- ValidateGC(&pPixmap->drawable, pGC);
- dixChangeGC (serverClient, pGC, GCSubwindowMode, &val, NULL);
- (*pGC->ops->CopyArea) (&pParent->drawable,
- &pPixmap->drawable,
- pGC,
- x - pParent->drawable.x,
- y - pParent->drawable.y,
- w, h, 0, 0);
- FreeScratchGC (pGC);
+ /*
+ * Copy bits from the parent into the new pixmap so that it will
+ * have "reasonable" contents in case for background None areas.
+ */
+ if (pGC)
+ {
+ XID val = IncludeInferiors;
+
+ ValidateGC(&pPixmap->drawable, pGC);
+ dixChangeGC (serverClient, pGC, GCSubwindowMode, &val, NULL);
+ (*pGC->ops->CopyArea) (&pParent->drawable,
+ &pPixmap->drawable,
+ pGC,
+ x - pParent->drawable.x,
+ y - pParent->drawable.y,
+ w, h, 0, 0);
+ FreeScratchGC (pGC);
+ }
+ }
+ else
+ {
+ PictFormatPtr pSrcFormat = compWindowFormat (pParent);
+ PictFormatPtr pDstFormat = compWindowFormat (pWin);
+ XID inferiors = IncludeInferiors;
+ int error;
+
+ PicturePtr pSrcPicture = CreatePicture (None,
+ &pParent->drawable,
+ pSrcFormat,
+ CPSubwindowMode,
+ &inferiors,
+ serverClient, &error);
+
+ PicturePtr pDstPicture = CreatePicture (None,
+ &pPixmap->drawable,
+ pDstFormat,
+ 0, 0,
+ serverClient, &error);
+
+ if (pSrcPicture && pDstPicture)
+ {
+ CompositePicture (PictOpSrc,
+ pSrcPicture,
+ NULL,
+ pDstPicture,
+ x - pParent->drawable.x,
+ y - pParent->drawable.y,
+ 0, 0, 0, 0, w, h);
+ }
+ if (pSrcPicture)
+ FreePicture (pSrcPicture, 0);
+ if (pDstPicture)
+ FreePicture (pDstPicture, 0);
}
return pPixmap;
}
diff --git a/composite/compinit.c b/composite/compinit.c
index 757d92913..49b2044b0 100644
--- a/composite/compinit.c
+++ b/composite/compinit.c
@@ -69,7 +69,6 @@ compCloseScreen (int index, ScreenPtr pScreen)
pScreen->ChangeBorderWidth = cs->ChangeBorderWidth;
pScreen->ClipNotify = cs->ClipNotify;
- pScreen->PaintWindowBackground = cs->PaintWindowBackground;
pScreen->UnrealizeWindow = cs->UnrealizeWindow;
pScreen->RealizeWindow = cs->RealizeWindow;
pScreen->DestroyWindow = cs->DestroyWindow;
@@ -411,9 +410,6 @@ compScreenInit (ScreenPtr pScreen)
cs->UnrealizeWindow = pScreen->UnrealizeWindow;
pScreen->UnrealizeWindow = compUnrealizeWindow;
- cs->PaintWindowBackground = pScreen->PaintWindowBackground;
- pScreen->PaintWindowBackground = compPaintWindowBackground;
-
cs->ClipNotify = pScreen->ClipNotify;
pScreen->ClipNotify = compClipNotify;
diff --git a/composite/compint.h b/composite/compint.h
index 79699e4c1..4b0fe0834 100644
--- a/composite/compint.h
+++ b/composite/compint.h
@@ -124,7 +124,6 @@ typedef struct _CompScreen {
DestroyWindowProcPtr DestroyWindow;
RealizeWindowProcPtr RealizeWindow;
UnrealizeWindowProcPtr UnrealizeWindow;
- PaintWindowProcPtr PaintWindowBackground;
ClipNotifyProcPtr ClipNotify;
/*
* Called from ConfigureWindow, these
@@ -241,6 +240,9 @@ compCheckTree (ScreenPtr pScreen);
#define compCheckTree(s)
#endif
+PictFormatPtr
+compWindowFormat (WindowPtr pWin);
+
void
compSetPixmap (WindowPtr pWin, PixmapPtr pPixmap);
@@ -257,9 +259,6 @@ Bool
compUnrealizeWindow (WindowPtr pWin);
void
-compPaintWindowBackground (WindowPtr pWin, RegionPtr pRegion, int what);
-
-void
compClipNotify (WindowPtr pWin, int dx, int dy);
void
diff --git a/composite/compwindow.c b/composite/compwindow.c
index a4c4e6f32..579236713 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -99,7 +99,7 @@ compRepaintBorder (ClientPtr pClient, pointer closure)
REGION_NULL(pScreen, &exposed);
REGION_SUBTRACT(pScreen, &exposed, &pWindow->borderClip, &pWindow->winSize);
- (*pWindow->drawable.pScreen->PaintWindowBorder)(pWindow, &exposed, PW_BORDER);
+ miPaintWindow(pWindow, &exposed, PW_BORDER);
REGION_UNINIT(pScreen, &exposed);
}
return TRUE;
@@ -240,21 +240,6 @@ compUnrealizeWindow (WindowPtr pWin)
return ret;
}
-void
-compPaintWindowBackground (WindowPtr pWin, RegionPtr pRegion, int what)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- CompSubwindowsPtr csw = GetCompSubwindows (pWin);
- CompScreenPtr cs = GetCompScreen (pScreen);
-
- if (csw && csw->update == CompositeRedirectManual)
- return;
- pScreen->PaintWindowBackground = cs->PaintWindowBackground;
- (*pScreen->PaintWindowBackground) (pWin, pRegion, what);
- cs->PaintWindowBackground = pScreen->PaintWindowBackground;
- pScreen->PaintWindowBackground = compPaintWindowBackground;
-}
-
/*
* Called after the borderClip for the window has settled down
* We use this to make sure our extra borderClip has the right origin
@@ -685,7 +670,7 @@ compGetWindowVisual (WindowPtr pWin)
return 0;
}
-static PictFormatPtr
+PictFormatPtr
compWindowFormat (WindowPtr pWin)
{
ScreenPtr pScreen = pWin->drawable.pScreen;