[xserver-commit] xserver/composite compinit.c,1.9,1.10 compint.h,1.7,1.8 compwindow.c,1.10,1.11
Keith Packard
xserver-commit@pdx.freedesktop.org
Mon, 01 Dec 2003 17:59:40 -0800
Committed by: keithp
Update of /cvs/xserver/xserver/composite
In directory pdx:/tmp/cvs-serv28394/composite
Modified Files:
compinit.c compint.h compwindow.c
Log Message:
* composite/compinit.c: (compCloseScreen), (compScreenInit):
* composite/compint.h:
* composite/compwindow.c: (compPositionWindow), (compClipNotify),
(compWindowUpdateAutomatic):
Wrap ClipNotify to see region motions during MoveWindow.
Check window reorigin in PositionWindow and bump pixmap
serial numbers to revalidate GCs.
Fix picture clip region origin in automatic update
* damageext/damageext.c: (DamageClientCallback):
Initialize client private 'critical' value
* fb/fbpixmap.c: (fbValidateBits), (fbValidateDrawable):
* fb/fbscreen.c: (fbFinishScreenInit):
Clean up pixmap bounds checking code to only affect
contents allocated by fb.
* render/mipict.c: (miCompositeSourceValidate),
(miComputeCompositeRegion):
Oops. Call SourceValidate for Composite operations.
* configure.ac:
* hw/kdrive/Makefile.am:
* hw/kdrive/chips/.cvsignore:
* hw/kdrive/chips/Imakefile:
* hw/kdrive/chips/Makefile.am:
* hw/kdrive/chips/chips.c: (chipsRandRSetConfig), (chipsRandRInit),
(chipsFinishInitScreen), (chipsCreateResources):
* hw/kdrive/chips/chipsdraw.c: (chipsWaitIdle),
(chipsPrepareSolid), (chipsPrepareCopy), (chipsDrawInit),
(chipsDrawEnable):
Add Xchips server (vesa based)
Index: compinit.c
===================================================================
RCS file: /cvs/xserver/xserver/composite/compinit.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- compinit.c 22 Nov 2003 02:19:44 -0000 1.9
+++ compinit.c 2 Dec 2003 01:59:38 -0000 1.10
@@ -45,6 +45,7 @@
pScreen->ResizeWindow = cs->ResizeWindow;
pScreen->ChangeBorderWidth = cs->ChangeBorderWidth;
+ pScreen->ClipNotify = cs->ClipNotify;
pScreen->PaintWindowBackground = cs->PaintWindowBackground;
pScreen->UnrealizeWindow = cs->UnrealizeWindow;
pScreen->RealizeWindow = cs->RealizeWindow;
@@ -276,6 +277,9 @@
cs->PaintWindowBackground = pScreen->PaintWindowBackground;
pScreen->PaintWindowBackground = compPaintWindowBackground;
+ cs->ClipNotify = pScreen->ClipNotify;
+ pScreen->ClipNotify = compClipNotify;
+
cs->MoveWindow = pScreen->MoveWindow;
pScreen->MoveWindow = compMoveWindow;
Index: compint.h
===================================================================
RCS file: /cvs/xserver/xserver/composite/compint.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- compint.h 20 Nov 2003 03:31:29 -0000 1.7
+++ compint.h 2 Dec 2003 01:59:38 -0000 1.8
@@ -85,6 +85,7 @@
RealizeWindowProcPtr RealizeWindow;
UnrealizeWindowProcPtr UnrealizeWindow;
PaintWindowProcPtr PaintWindowBackground;
+ ClipNotifyProcPtr ClipNotify;
/*
* Called from ConfigureWindow, these
* three track changes to the offscreen storage
@@ -204,6 +205,9 @@
compPaintWindowBackground (WindowPtr pWin, RegionPtr pRegion, int what);
void
+compClipNotify (WindowPtr pWin, int dx, int dy);
+
+void
compMoveWindow (WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind);
void
Index: compwindow.c
===================================================================
RCS file: /cvs/xserver/xserver/composite/compwindow.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- compwindow.c 22 Nov 2003 00:49:11 -0000 1.10
+++ compwindow.c 2 Dec 2003 01:59:38 -0000 1.11
@@ -130,6 +130,20 @@
*/
if (pWin->redirectDraw != (pWin->viewable && (GetCompWindow(pWin) != NULL)))
abort ();
+ if (pWin->redirectDraw)
+ {
+ PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin);
+ int bw = wBorderWidth (pWin);
+ int nx = pWin->drawable.x - bw;
+ int ny = pWin->drawable.y - bw;
+
+ if (pPixmap->screen_x != nx || pPixmap->screen_y != ny)
+ {
+ pPixmap->screen_x = nx;
+ pPixmap->screen_y = ny;
+ pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+ }
+ }
if (!(*pScreen->PositionWindow) (pWin, x, y))
ret = FALSE;
@@ -189,6 +203,39 @@
}
/*
+ * Called after the borderClip for the window has settled down
+ * We use this to make sure our extra borderClip has the right origin
+ */
+
+void
+compClipNotify (WindowPtr pWin, int dx, int dy)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ CompScreenPtr cs = GetCompScreen (pScreen);
+ CompWindowPtr cw = GetCompWindow (pWin);
+
+ if (cw)
+ {
+ if (cw->borderClipX != pWin->drawable.x ||
+ cw->borderClipY != pWin->drawable.y)
+ {
+ REGION_TRANSLATE (pScreen, &cw->borderClip,
+ pWin->drawable.x - cw->borderClipX,
+ pWin->drawable.y - cw->borderClipY);
+ cw->borderClipX = pWin->drawable.x;
+ cw->borderClipY = pWin->drawable.y;
+ }
+ }
+ if (cs->ClipNotify)
+ {
+ pScreen->ClipNotify = cs->ClipNotify;
+ (*pScreen->ClipNotify) (pWin, dx, dy);
+ cs->ClipNotify = pScreen->ClipNotify;
+ pScreen->ClipNotify = compClipNotify;
+ }
+}
+
+/*
* Returns TRUE if the window needs server-provided automatic redirect,
* which is true if the child and parent aren't both regular or ARGB visuals
*/
@@ -601,11 +648,10 @@
REGION_TRANSLATE (pScreen, pRegion,
pSrcPixmap->screen_x, pSrcPixmap->screen_y);
REGION_INTERSECT (pScreen, pRegion, pRegion, &cw->borderClip);
+ REGION_TRANSLATE (pScreen, pRegion,
+ -pSrcPixmap->screen_x, -pSrcPixmap->screen_y);
- SetPictureClipRegion (pDstPicture,
- -pDstPixmap->screen_x,
- -pDstPixmap->screen_y,
- pRegion);
+ SetPictureClipRegion (pSrcPicture, 0, 0, pRegion);
CompositePicture (PictOpSrc,
pSrcPicture,
@@ -615,7 +661,7 @@
0,
0, 0,
pSrcPixmap->screen_x - pDstPixmap->screen_x,
- pSrcPixmap->screen_y - pDstPixmap->screen_x,
+ pSrcPixmap->screen_y - pDstPixmap->screen_y,
pSrcPixmap->drawable.width,
pSrcPixmap->drawable.height);
FreePicture (pSrcPicture, 0);