xserver/hw/xgl xglcopy.c, 1.5, 1.6 xglfill.c, 1.4, 1.5 xglgc.c, 1.6, 1.7 xglshm.c, 1.2, 1.3 xglsync.c, 1.5, 1.6 xgltrap.c, 1.3, 1.4 xglwindow.c, 1.4, 1.5

David Reveman xserver-commit at pdx.freedesktop.org
Wed Mar 16 12:05:21 PST 2005


Committed by: davidr

Update of /cvs/xserver/xserver/hw/xgl
In directory gabe:/tmp/cvs-serv32265/hw/xgl

Modified Files:
	xglcopy.c xglfill.c xglgc.c xglshm.c xglsync.c xgltrap.c 
	xglwindow.c 
Log Message:
Fix a few problems in Xgl

Index: xglcopy.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/xgl/xglcopy.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- xglcopy.c	11 Mar 2005 00:58:49 -0000	1.5
+++ xglcopy.c	16 Mar 2005 20:05:19 -0000	1.6
@@ -38,45 +38,25 @@
     int		    srcXoff, srcYoff;
     int		    dstXoff, dstYoff;
 
+    XGL_SCREEN_PRIV (pDst->pScreen);
     XGL_DRAWABLE_PIXMAP_PRIV (pSrc);
-
+    
     if (!nBox)
 	return TRUE;
 
-    /* source is all in software and damaged, fall-back is probably more
-       efficient */
-    if (pPixmapPriv->allBits &&
-	pPixmapPriv->pDamage &&
-	REGION_NOTEMPTY (pDrawable->pScreen,
-			 DamageRegion (pPixmapPriv->pDamage)))
+    if (!xglPrepareTarget (pDst))
 	return FALSE;
 
-    if (xglPrepareTarget (pDst))
-    {
-	XGL_SCREEN_PRIV (pDst->pScreen);
-	
-	if (!xglSyncSurface (pSrc))
-	    return FALSE;
-
-	XGL_GET_DRAWABLE (pDst, dst, dstXoff, dstYoff);
-
-	/* blit to screen */
-	if (dst == pScreenPriv->surface)
-	    XGL_INCREMENT_PIXMAP_SCORE (pPixmapPriv, 5000);
-    }
-    else
-    {
-	if (!xglPrepareTarget (pSrc))
-	    return FALSE;
-	
-	if (!xglSyncSurface (pDst))
-	    return FALSE;
-	
-	XGL_GET_DRAWABLE (pDst, dst, dstXoff, dstYoff);
-    }
-
+    if (!xglSyncSurface (pSrc))
+	return FALSE;
+    
     XGL_GET_DRAWABLE (pSrc, src, srcXoff, srcYoff);
-	
+    XGL_GET_DRAWABLE (pDst, dst, dstXoff, dstYoff);
+
+    /* blit to screen */
+    if (dst == pScreenPriv->surface)
+	XGL_INCREMENT_PIXMAP_SCORE (pPixmapPriv, 5000);
+    
     glitz_surface_set_clip_region (dst,
 				   dstXoff, dstYoff,
 				   (glitz_box_t *) pBox, nBox);

Index: xglfill.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/xgl/xglfill.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- xglfill.c	11 Mar 2005 12:26:20 -0000	1.4
+++ xglfill.c	16 Mar 2005 20:05:19 -0000	1.5
@@ -188,10 +188,13 @@
 		  pExtent->x2 - pExtent->x1, pExtent->y2 - pExtent->y1,
 		  pBox, nBox))
     {
-	RegionRec region;
-	Bool      overlap;
+	RegionRec	region;
+	RegionPtr       pDamageRegion;
+	glitz_surface_t *surface;
+	int             xOff, yOff;
 
 	XGL_DRAWABLE_PIXMAP (pDrawable);
+	XGL_PIXMAP_PRIV (pPixmap);
 
 	if (!xglMapPixmapBits (pPixmap))
 	    FatalError (XGL_SW_FAILURE_STRING);
@@ -209,21 +212,34 @@
 		FatalError (XGL_SW_FAILURE_STRING);
 	    break;
 	}
+
+	pDamageRegion = DamageRegion (pPixmapPriv->pDamage);
 	
-	REGION_INIT (pGC->pScreen, &region, pBox, nBox);
+	XGL_GET_DRAWABLE (pDrawable, surface, xOff, yOff);
+	
+	pPixmapPriv->damageBox = miEmptyBox;
 	
 	while (nBox--)
 	{
 	    fbFill (pDrawable, pGC,
 		    pBox->x1, pBox->y1,
 		    pBox->x2 - pBox->x1, pBox->y2 - pBox->y1);
+
+	    if (pPixmapPriv->format)
+	    {
+		part.x1 = pBox->x1 + xOff;
+		part.y1 = pBox->y1 + yOff;
+		part.x2 = pBox->x2 + xOff;
+		part.y2 = pBox->y2 + yOff;
+		
+		REGION_INIT (pDrawable->pScreen, &region, &part, 1);
+		REGION_UNION (pDrawable->pScreen,
+			      pDamageRegion, pDamageRegion, &region);
+		REGION_UNINIT (pDrawable->pScreen, &region);
+	    }
+	    
 	    pBox++;
 	}
-
-	/* hmm, overlap can't be good, don't know what to do about that */
-	REGION_VALIDATE (pGC->pScreen, &region, &overlap);
-	xglAddSurfaceDamage (pDrawable, &region);
-	REGION_UNINIT (pGC->pScreen, &region);
     } else
 	xglAddCurrentBitDamage (pDrawable);
 
@@ -241,6 +257,9 @@
     BoxPtr	   pExtent;
     xglGeometryPtr pGeometry;
 
+    if (n < 1)
+	return TRUE;
+
     pExtent = REGION_EXTENTS (pDrawable->pScreen, pGC->pCompositeClip);
 
     pGeometry = xglGetScratchVertexGeometry (pGC->pScreen, 2 * n);
@@ -272,6 +291,9 @@
     xglGeometryPtr pGeometry;
     Bool	   coincident_endpoints;
 
+    if (npt < 2)
+	return TRUE;
+    
     pExtent = REGION_EXTENTS (pDrawable->pScreen, pGC->pCompositeClip);
 
     coincident_endpoints = FALSE;
@@ -342,6 +364,9 @@
     BoxPtr	   pExtent;
     xglGeometryPtr pGeometry;
 
+    if (nsegInit < 1)
+	return TRUE;
+
     pExtent = REGION_EXTENTS (pDrawable->pScreen, pGC->pCompositeClip);
 
     pGeometry = xglGetScratchVertexGeometry (pGC->pScreen, 2 * nsegInit);
@@ -376,6 +401,9 @@
     BoxPtr	   pExtent;
     xglGeometryRec geometry;
 
+    if (nGlyph < 1)
+	return TRUE;
+
     pExtent = REGION_EXTENTS (pDrawable->pScreen, pGC->pCompositeClip);
 
     x += pDrawable->x;

Index: xglgc.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/xgl/xglgc.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- xglgc.c	8 Mar 2005 09:03:38 -0000	1.6
+++ xglgc.c	16 Mar 2005 20:05:19 -0000	1.7
@@ -206,7 +206,7 @@
     box.x2 = box.x1 + w;
     box.y2 = box.y1 + h;
 
-    if (pGCPriv->flags &= ~xglGCReadOnlyDrawableFlag)
+    if (pGC->alu != GXcopy || (pGCPriv->flags &= ~xglGCReadOnlyDrawableFlag))
     {
 	if (!xglSyncBits (pSrc, &box))
 	    FatalError (XGL_SW_FAILURE_STRING);

Index: xglshm.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/xgl/xglshm.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- xglshm.c	11 Mar 2005 00:58:49 -0000	1.2
+++ xglshm.c	16 Mar 2005 20:05:19 -0000	1.3
@@ -46,6 +46,9 @@
     ScreenPtr pScreen = pDrawable->pScreen;
     PixmapPtr pPixmapHeader = NULL;
     PixmapPtr pPixmap;
+    int	      saveTarget;
+
+    XGL_DRAWABLE_PIXMAP_PRIV (pDrawable);
 
     if ((format == ZPixmap) || (depth == 1))
     {
@@ -53,7 +56,9 @@
 	    GetScratchPixmapHeader (pScreen, w, h, depth,
 				    BitsPerPixel (depth),
 				    PixmapBytePad (w, depth),
-				    (pointer) data);
+				    (pointer) data);	
+	if (pPixmap)
+	    XGL_GET_PIXMAP_PRIV (pPixmap)->format = NULL;
     }
     else
     {
@@ -95,6 +100,10 @@
     if (!pPixmap)
 	return;
 
+    /* CopyArea should always be done in software */
+    saveTarget = pPixmapPriv->target;
+    pPixmapPriv->target = xglPixmapTargetNo;
+
     if (format == XYBitmap)
 	(*pGC->ops->CopyPlane) ((DrawablePtr) pPixmap, pDrawable, pGC,
 				sx, sy, sw, sh, dx, dy, 1L);
@@ -102,6 +111,8 @@
 	(*pGC->ops->CopyArea) ((DrawablePtr) pPixmap, pDrawable, pGC,
 			       sx, sy, sw, sh, dx, dy);
 
+    pPixmapPriv->target = saveTarget;
+	
     if (pPixmapHeader)
 	FreeScratchPixmapHeader (pPixmapHeader);
     else

Index: xglsync.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/xgl/xglsync.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- xglsync.c	11 Mar 2005 00:58:49 -0000	1.5
+++ xglsync.c	16 Mar 2005 20:05:19 -0000	1.6
@@ -237,9 +237,6 @@
 	    return FALSE;
     }
 
-    if (!pPixmapPriv->pDamage)
-	return TRUE;
-    
     pRegion = DamageRegion (pPixmapPriv->pDamage);
 
     if (REGION_NOTEMPTY (pDrawable->pScreen, pRegion))
@@ -375,14 +372,12 @@
 {
     XGL_DRAWABLE_PIXMAP_PRIV (pDrawable);
 
-    if (BOX_NOTEMPTY (&pPixmapPriv->bitBox))
+    if (pPixmapPriv->target == xglPixmapTargetIn &&
+	pPixmapPriv->damageBox.x1 < pPixmapPriv->bitBox.x2 &&
+	pPixmapPriv->damageBox.y1 < pPixmapPriv->bitBox.y2 &&
+	pPixmapPriv->damageBox.x2 > pPixmapPriv->bitBox.x1 &&
+	pPixmapPriv->damageBox.y2 > pPixmapPriv->bitBox.y1)
     {
-	if (pPixmapPriv->damageBox.x1 > pPixmapPriv->bitBox.x2 ||
-	    pPixmapPriv->damageBox.y1 > pPixmapPriv->bitBox.y2 ||
-	    pPixmapPriv->damageBox.x2 < pPixmapPriv->bitBox.x1 ||
-	    pPixmapPriv->damageBox.y2 < pPixmapPriv->bitBox.y1)
-	    return;
-	    
 	pPixmapPriv->bitBox = miEmptyBox;
 	pPixmapPriv->allBits = FALSE;
     }

Index: xgltrap.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/xgl/xgltrap.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- xgltrap.c	11 Mar 2005 00:58:49 -0000	1.3
+++ xgltrap.c	16 Mar 2005 20:05:19 -0000	1.4
@@ -246,9 +246,8 @@
 	       is likely to exceed the size of the mask. */
 	    if ((SMOOTH_TRAPS_ESTIMATE_RECTS (nTrap) * 4) > (width * height))
 		accelerate = FALSE;
-
+	} else
 	    accelerate = FALSE;
-	}
 
 	pMask = xglCreateMaskPicture (pScreen, pDst, maskFormat,
 				      width, height, accelerate);

Index: xglwindow.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/xgl/xglwindow.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- xglwindow.c	11 Feb 2005 20:19:20 -0000	1.4
+++ xglwindow.c	16 Mar 2005 20:05:19 -0000	1.5
@@ -107,10 +107,10 @@
 
     pPixmap = XGL_GET_WINDOW_PIXMAP (pWin);
 
-    box.x1 = pWin->drawable.x + pExtent->x1;
-    box.y1 = pWin->drawable.y + pExtent->y1;
-    box.x2 = pWin->drawable.x + pExtent->x2;
-    box.y2 = pWin->drawable.y + pExtent->y2;
+    box.x1 = pExtent->x1;
+    box.y1 = pExtent->y1;
+    box.x2 = pExtent->x2;
+    box.y2 = pExtent->y2;
 	
     dx = ptOldOrg.x - pWin->drawable.x;
     dy = ptOldOrg.y - pWin->drawable.y;



More information about the xserver-commit mailing list