[xserver-commit] xserver/render mipict.c,1.15,1.16 picture.c,1.32,1.33

Keith Packard xserver-commit@pdx.freedesktop.org
Tue, 04 Nov 2003 21:45:33 -0800


Committed by: keithp

Update of /cvs/xserver/xserver/render
In directory pdx:/tmp/cvs-serv6826/render

Modified Files:
	mipict.c picture.c 
Log Message:
	* Makefile.am:
	* composite/Makefile.am:
	* composite/compalloc.c: (compReportDamage), (compDestroyDamage),
	(compAllocPixmap), (compFreePixmap), (compReallocPixmap):
	* composite/compinit.c: (compCloseScreen), (compScreenUpdate),
	(compBlockHandler), (compScreenInit), (CompositeExtensionInit):
	* composite/compint.h:
	* composite/compwindow.c: (compCheckWindow), (compCheckTree),
	(compSetPixmapVisitWindow), (compSetPixmap),
	(compShouldBeRedirected), (compCheckRedirect),
	(compPositionWindow), (compRealizeWindow), (compUnrealizeWindow),
	(compReparentWindow), (compCopyWindow), (compCreateWindow),
	(compDestroyWindow), (compRedirectBorderClip),
	(compGetWindowVisual), (compWindowFormat),
	(compWindowUpdateAutomatic), (compWindowPaintBackground),
	(compWindowUpdate):
	* configure.ac:
	* dix/window.c: (SetWinSize), (SetBorderSize):
	* fb/fb.h:
	* fb/fbpict.c: (fbIn24), (fbCompositeTrans_0565xnx0565),
	(fbCompositeSrcSrc_nxn), (fbComposite):
	* fb/fbpict.h:
	* include/picturestr.h:
	* include/windowstr.h:
	* mi/Makefile.am:
	* mi/mi.h:
	* mi/miinitext.c:
	* mi/mivaltree.c: (miRegisterRedirectBorderClipProc),
	(miGetRedirectBorderClipProc), (miComputeClips):
	* miext/damage/damage.c: (damageDestroyPixmap):
	* render/mipict.c: (miValidatePicture):
	* render/picture.c: (SetPictureClipRects), (SetPictureClipRegion):
	* xfixes/region.c: (ProcXFixesSetPictureClipRegion):
	Initial import of Composite extension along with
	name change from Apportion.
	Added some accelerated code to fbpict to make this initial
	hack a bit faster.  "real" extension bits to follow.


Index: mipict.c
===================================================================
RCS file: /cvs/xserver/xserver/render/mipict.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- mipict.c	11 Sep 2003 05:12:51 -0000	1.15
+++ mipict.c	5 Nov 2003 05:45:31 -0000	1.16
@@ -209,10 +209,26 @@
 
 	    /* XXX should we translate by drawable.x/y here ? */
 	    /* If you want pixmaps in offscreen memory, yes */
-	    pixbounds.x1 = pDrawable->x;
-	    pixbounds.y1 = pDrawable->y;
-	    pixbounds.x2 = pDrawable->x + pDrawable->width;
-	    pixbounds.y2 = pDrawable->y + pDrawable->height;
+	    if (pDrawable->x >= 0)
+	    {
+		pixbounds.x1 = pDrawable->x;
+		pixbounds.x2 = pDrawable->x + pDrawable->width;
+	    }
+	    else
+	    {
+		pixbounds.x1 = 0;
+		pixbounds.x2 = pDrawable->width;
+	    }
+	    if (pDrawable->y >= 0)
+	    {
+		pixbounds.y1 = pDrawable->y;
+		pixbounds.y2 = pDrawable->y + pDrawable->height;
+	    }
+	    else
+	    {
+		pixbounds.y1 = 0;
+		pixbounds.y2 = pDrawable->height;
+	    }
 
 	    if (pPicture->freeCompClip)
 	    {

Index: picture.c
===================================================================
RCS file: /cvs/xserver/xserver/render/picture.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- picture.c	30 Sep 2003 20:13:45 -0000	1.32
+++ picture.c	5 Nov 2003 05:45:31 -0000	1.33
@@ -1012,7 +1012,6 @@
     PictureScreenPtr	ps = GetPictureScreen(pScreen);
     RegionPtr		clientClip;
     int			result;
-
     clientClip = RECTS_TO_REGION(pScreen,
 				 nRect, rects, CT_UNSORTED);
     if (!clientClip)
@@ -1030,6 +1029,50 @@
 }
 
 int
+SetPictureClipRegion (PicturePtr    pPicture,
+		      int	    xOrigin,
+		      int	    yOrigin,
+		      RegionPtr	    pRegion)
+{
+    ScreenPtr		pScreen = pPicture->pDrawable->pScreen;
+    PictureScreenPtr	ps = GetPictureScreen(pScreen);
+    RegionPtr		clientClip;
+    int			result;
+    int			type;
+
+    if (pRegion)
+    {
+	type = CT_REGION;
+	clientClip = REGION_CREATE (pScreen, 
+				    REGION_EXTENTS(pScreen, pRegion),
+				    REGION_NUM_RECTS(pRegion));
+	if (!clientClip)
+	    return BadAlloc;
+	if (!REGION_COPY (pSCreen, clientClip, pRegion))
+	{
+	    REGION_DESTROY (pScreen, clientClip);
+	    return BadAlloc;
+	}
+    }
+    else
+    {
+	type = CT_NONE;
+	clientClip = 0;
+    }
+
+    result =(*ps->ChangePictureClip) (pPicture, type, 
+				      (pointer) clientClip, 0);
+    if (result == Success)
+    {
+	pPicture->clipOrigin.x = xOrigin;
+	pPicture->clipOrigin.y = yOrigin;
+	pPicture->stateChanges |= CPClipXOrigin|CPClipYOrigin|CPClipMask;
+	pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT;
+    }
+    return result;
+}
+
+int
 SetPictureTransform (PicturePtr	    pPicture,
 		     PictTransform  *transform)
 {