debrix/miext/damage Imakefile, 1.1, 1.2 damage.c, 1.1.2.1, 1.1.2.2 damage.h, 1.1.2.1, 1.1.2.2 damagestr.h, 1.1.2.1, 1.1.2.2

Daniel Stone xserver-commit at pdx.freedesktop.org
Fri Jun 11 05:50:07 EST 2004


Committed by: daniel

Update of /cvs/xserver/debrix/miext/damage
In directory pdx:/home/daniel/x/debrix/debrix/miext/damage

Modified Files:
      Tag: DAMAGE-XFIXES
	damage.c damage.h damagestr.h 
Added Files:
	Imakefile 
Log Message:
Add #include <config.h> stanza as part of modular-tree import.



Index: damage.c
===================================================================
RCS file: /cvs/xserver/debrix/miext/damage/Attic/damage.c,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- damage.c	30 Mar 2004 17:41:24 -0000	1.1.2.1
+++ damage.c	10 Jun 2004 19:50:05 -0000	1.1.2.2
@@ -109,10 +109,28 @@
     RegionRec	    tmpRegion;
     BoxRec	    tmpBox;
     int		    draw_x, draw_y;
+#ifdef COMPOSITE
+    int             screen_x = 0, screen_y = 0;
+#endif
 
     /* short circuit for empty regions */
     if (!REGION_NOTEMPTY(pScreen, pRegion))
 	return;
+
+#ifdef COMPOSITE
+    /*
+     * When drawing to a pixmap which is storing window contents,
+     * the region presented is in pixmap relative coordinates which
+     * need to be converted to screen relative coordinates
+     */
+    if (pDrawable->type != DRAWABLE_WINDOW)
+    {
+        screen_x = ((PixmapPtr) pDrawable)->screen_x;
+        screen_y = ((PixmapPtr) pDrawable)->screen_y;
+    }
+    if (screen_x || screen_y)
+        REGION_TRANSLATE (pScreen, pRegion, screen_x, screen_y);
+#endif
     
     REGION_INIT (pScreen, &clippedRec, NullBox, 0);
     for (; pDamage; pDamage = pNext)
@@ -175,6 +193,18 @@
 	 */
 	draw_x = pDamage->pDrawable->x;
 	draw_y = pDamage->pDrawable->y;
+#ifdef COMPOSITE
+        /*
+         * Need to move everyone to screen coordinates
+         * XXX what about off-screen pixmaps with non-zero x/y?
+         */
+        if (pDamage->pDrawable->type != DRAWABLE_WINDOW)
+        {
+            draw_x += ((PixmapPtr) pDamage->pDrawable)->screen_x;
+            draw_y += ((PixmapPtr) pDamage->pDrawable)->screen_y;
+        }
+#endif
+
 	if (draw_x || draw_y)
 	    REGION_TRANSLATE (pScreen, pDamageRegion, -draw_x, -draw_y);
 	






More information about the xserver-commit mailing list