[PATCH 1/2] rootless: ROOTLESS_TRACK_DAMAGE is never set, so unifdef it.

Jamey Sharp jamey at minilop.net
Wed Jul 14 11:44:38 PDT 2010


Signed-off-by: Jamey Sharp <jamey at minilop.net>
Cc: Jeremy Huddleston <jeremyhu at apple.com>
Cc: Jon TURNEY <jon.turney at dronecode.org.uk>
---
 miext/rootless/rootlessConfig.h |    2 --
 hw/xwin/winscrinit.c            |    2 --
 miext/rootless/README.txt       |   19 ++-----------------
 miext/rootless/rootless.h       |   16 +++-------------
 miext/rootless/rootlessCommon.c |   35 -----------------------------------
 miext/rootless/rootlessWindow.c |   18 ------------------
 6 files changed, 5 insertions(+), 87 deletions(-)

diff --git a/miext/rootless/rootlessConfig.h b/miext/rootless/rootlessConfig.h
index 50bac3f..9082ac2 100644
--- a/miext/rootless/rootlessConfig.h
+++ b/miext/rootless/rootlessConfig.h
@@ -40,7 +40,6 @@
 # define ROOTLESS_PROTECT_ALPHA TRUE
 # define ROOTLESS_REDISPLAY_DELAY 10
 # define ROOTLESS_RESIZE_GRAVITY TRUE
-# undef  ROOTLESS_TRACK_DAMAGE
 /*# define ROOTLESSDEBUG*/
 
 /* Bit mask for alpha channel with a particular number of bits per
@@ -56,7 +55,6 @@
 # define ROOTLESS_PROTECT_ALPHA NO
 # define ROOTLESS_REDISPLAY_DELAY 10
 # undef  ROOTLESS_RESIZE_GRAVITY
-# undef  ROOTLESS_TRACK_DAMAGE
 /*# define ROOTLESSDEBUG*/
 
 # define RootlessAlphaMask(bpp) ((bpp) == 32 ? 0xFF000000 : 0)
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
index 47e9b6d..1b40933 100644
--- a/hw/xwin/winscrinit.c
+++ b/hw/xwin/winscrinit.c
@@ -54,9 +54,7 @@ winMWExtWMProcs = {
   winMWExtWMStartDrawing,
   winMWExtWMStopDrawing,
   winMWExtWMUpdateRegion,
-#ifndef ROOTLESS_TRACK_DAMAGE
   winMWExtWMDamageRects,
-#endif
   winMWExtWMRootlessSwitchWindow,
   NULL,//winMWExtWMDoReorderWindow,
   NULL,//winMWExtWMHideWindow,
diff --git a/miext/rootless/README.txt b/miext/rootless/README.txt
index 2c3fbb0..8a6df74 100644
--- a/miext/rootless/README.txt
+++ b/miext/rootless/README.txt
@@ -105,18 +105,6 @@ rootlessConfig.h:
         during resizing and rely on the frame contents being preserved
         accordingly.
 
-      o ROOTLESS_TRACK_DAMAGE: The generic rootless layer draws to the
-        frames' backing buffers and periodically flushes the modified
-        regions to the underlying window server. If this option is true,
-        the generic rootless layer will track these damaged regions. 
-        Currently it uses the miRegion code and will not simplify damaged 
-        regions even when updating a bounding region would be more 
-        efficient. Some window systems provide a more efficient way to 
-        track damaged regions. If this option is false, the rootless 
-        implementation function DamageRects() is called whenever a 
-        backing buffer is modified and the rootless implementation is 
-        expected to track the damaged regions itself.
-
         The following runtime options are defined in rootless.h:
 
       o rootlessGlobalOffsetX, rootlessGlobalOffsetY: These are only 
@@ -287,8 +275,7 @@ typedef void (*RootlessStartDrawingProc)
  *  is started again.
  *
  *  wid         Frame id
- *  flush       Flush drawing updates for this frame to the screen. This
- *              will always be FALSE if ROOTLESS_TRACK_DAMAGE is set.
+ *  flush       Flush drawing updates for this frame to the screen.
  */
 typedef void (*RootlessStopDrawingProc)
     (RootlessFrameID wid, Bool flush);
@@ -299,15 +286,13 @@ typedef void (*RootlessStopDrawingProc)
  *
  *  wid         Frame id
  *  pDamage     Region containing all the changed pixels in frame-local
- *              coordinates. This is clipped to the window's clip. This
- *              will be NULL if ROOTLESS_TRACK_DAMAGE is not set.
+ *              coordinates. This is clipped to the window's clip.
  */
 typedef void (*RootlessUpdateRegionProc)
     (RootlessFrameID wid, RegionPtr pDamage);
 
 /*
  * Mark damaged rectangles as requiring redisplay to screen.
- *  This will only be called if ROOTLESS_TRACK_DAMAGE is not set.
  *
  *  wid         Frame id
  *  nrects      Number of damaged rectangles
diff --git a/miext/rootless/rootless.h b/miext/rootless/rootless.h
index 00eac4e..2e6e782 100644
--- a/miext/rootless/rootless.h
+++ b/miext/rootless/rootless.h
@@ -68,10 +68,6 @@ typedef struct _RootlessWindowRec {
 
     PixmapPtr pixmap;
 
-#ifdef ROOTLESS_TRACK_DAMAGE
-    RegionRec damage;
-#endif
-
     unsigned int is_drawing :1;	// Currently drawing?
     unsigned int is_reorder_pending :1;
     unsigned int is_offscreen :1;
@@ -227,8 +223,7 @@ typedef void (*RootlessStartDrawingProc)
  *  is started again.
  *
  *  wid         Frame id
- *  flush       Flush drawing updates for this frame to the screen. This
- *              will always be FALSE if ROOTLESS_TRACK_DAMAGE is set.
+ *  flush       Flush drawing updates for this frame to the screen.
  */
 typedef void (*RootlessStopDrawingProc)
     (RootlessFrameID wid, Bool flush);
@@ -239,15 +234,13 @@ typedef void (*RootlessStopDrawingProc)
  *
  *  wid         Frame id
  *  pDamage     Region containing all the changed pixels in frame-lcoal
- *              coordinates. This is clipped to the window's clip. This
- *              will be NULL if ROOTLESS_TRACK_DAMAGE is not set.
+ *              coordinates. This is clipped to the window's clip.
  */
 typedef void (*RootlessUpdateRegionProc)
     (RootlessFrameID wid, RegionPtr pDamage);
 
 /*
  * Mark damaged rectangles as requiring redisplay to screen.
- *  This will only be called if ROOTLESS_TRACK_DAMAGE is not set.
  *
  *  wid         Frame id
  *  nrects      Number of damaged rectangles
@@ -374,9 +367,7 @@ typedef struct _RootlessFrameProcs {
     RootlessStartDrawingProc StartDrawing;
     RootlessStopDrawingProc StopDrawing;
     RootlessUpdateRegionProc UpdateRegion;
-#ifndef ROOTLESS_TRACK_DAMAGE
     RootlessDamageRectsProc DamageRects;
-#endif
 
     /* Optional frame functions */
     RootlessSwitchWindowProc SwitchWindow;
@@ -426,8 +417,7 @@ void RootlessStartDrawing(WindowPtr pWindow);
 /*
  * Finish drawing to a window's backing buffer.
  *
- *  flush       If true and ROOTLESS_TRACK_DAMAGE is set, damaged areas
- *              are flushed to the screen.
+ *  flush       If true, damaged areas are flushed to the screen.
  */
 void RootlessStopDrawing(WindowPtr pWindow, Bool flush);
 
diff --git a/miext/rootless/rootlessCommon.c b/miext/rootless/rootlessCommon.c
index 82fe0b9..f84214c 100644
--- a/miext/rootless/rootlessCommon.c
+++ b/miext/rootless/rootlessCommon.c
@@ -302,16 +302,11 @@ RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion)
             if (in == rgnIN) {
             /* clip totally contains pRegion */
 
-#ifdef ROOTLESS_TRACK_DAMAGE
-                RegionUnion(&winRec->damage,
-                                 &winRec->damage, (pRegion));
-#else
                 SCREENREC(pWindow->drawable.pScreen)->imp->
                     DamageRects(winRec->wid,
                                 RegionNumRects(pRegion),
                                 RegionRects(pRegion),
                                 -winRec->x, -winRec->y);
-#endif
 
                 RootlessQueueRedisplay(pTop->drawable.pScreen);
                 goto out;
@@ -328,16 +323,11 @@ RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion)
         RegionNull(&clipped);
         RegionIntersect(&clipped, &pWindow->borderClip, pRegion);
 
-#ifdef ROOTLESS_TRACK_DAMAGE
-        RegionUnion(&winRec->damage,
-                     &winRec->damage, (pRegion));
-#else
         SCREENREC(pWindow->drawable.pScreen)->imp->
             DamageRects(winRec->wid,
                         RegionNumRects(&clipped),
                         RegionRects(&clipped),
                         -winRec->x, -winRec->y);
-#endif
 
         RegionUninit(&clipped);
 
@@ -412,32 +402,7 @@ RootlessDamageRect(WindowPtr pWindow, int x, int y, int w, int h)
 void
 RootlessRedisplay(WindowPtr pWindow)
 {
-#ifdef ROOTLESS_TRACK_DAMAGE
-
-    RootlessWindowRec *winRec = WINREC(pWindow);
-    ScreenPtr pScreen = pWindow->drawable.pScreen;
-
-    RootlessStopDrawing(pWindow, FALSE);
-
-    if (RegionNotEmpty(&winRec->damage)) {
-        RL_DEBUG_MSG("Redisplay Win 0x%x, %i x %i @ (%i, %i)\n",
-                     pWindow, winRec->width, winRec->height,
-                     winRec->x, winRec->y);
-
-        // move region to window local coords
-        RegionTranslate(&winRec->damage,
-                         -winRec->x, -winRec->y);
-
-        SCREENREC(pScreen)->imp->UpdateRegion(winRec->wid, &winRec->damage);
-
-        RegionEmpty(&winRec->damage);
-    }
-
-#else   /* !ROOTLESS_TRACK_DAMAGE */
-
     RootlessStopDrawing(pWindow, TRUE);
-
-#endif
 }
 
 
diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index 7fe5e1d..72208cb 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -180,11 +180,6 @@ static void
 RootlessDestroyFrame(WindowPtr pWin, RootlessWindowPtr winRec)
 {
     SCREENREC(pWin->drawable.pScreen)->imp->DestroyFrame(winRec->wid);
-
-#ifdef ROOTLESS_TRACK_DAMAGE
-    RegionUninit(&winRec->damage);
-#endif
-
     free(winRec);
     SETWINREC(pWin, NULL);
 }
@@ -341,15 +336,6 @@ RootlessPositionWindow(WindowPtr pWin, int x, int y)
 
             winRec->pixmap->devPrivate.ptr = winRec->pixelData;
             SetPixmapBaseToScreen(winRec->pixmap, x - bw, y - bw);
-
-#ifdef ROOTLESS_TRACK_DAMAGE
-            // Move damaged region to correspond to new window position
-            if (RegionNotEmpty(&winRec->damage)) {
-                RegionTranslate(&winRec->damage,
-                                 x - bw - winRec->x,
-                                 y - bw - winRec->y);
-            }
-#endif
         }
     }
 
@@ -381,10 +367,6 @@ RootlessInitializeFrame(WindowPtr pWin, RootlessWindowRec *winRec)
     winRec->width = d->width + 2*bw;
     winRec->height = d->height + 2*bw;
     winRec->borderWidth = bw;
-
-#ifdef ROOTLESS_TRACK_DAMAGE
-    RegionNull(&winRec->damage);
-#endif
 }
 
 /*
-- 
1.7.0



More information about the xorg-devel mailing list