[PATCH 2/3] rootless: RootlessAlphaMask is configured the same way everywhere.

Jamey Sharp jamey at minilop.net
Thu Jul 15 09:28:50 PDT 2010


Notably, there's another copy of this macro in miexpose.c, and
presumably they should always match.

With this patch, rootless almost builds cleanly on Linux. Of course
nothing uses it, but I like being able to at least compile-test as much
xserver source as possible.

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>
Cc: Colin Harrison <colin.harrison at virgin.net>
---
 miext/rootless/README.txt       |   17 ++++-------------
 miext/rootless/rootlessConfig.h |    7 -------
 miext/rootless/rootlessGC.c     |    2 ++
 3 files changed, 6 insertions(+), 20 deletions(-)

diff --git a/miext/rootless/README.txt b/miext/rootless/README.txt
index cea2c01..3ae5ce5 100644
--- a/miext/rootless/README.txt
+++ b/miext/rootless/README.txt
@@ -76,13 +76,6 @@ rootlessConfig.h to specify compile time options for its platform.
         The following compile-time options are defined in 
 rootlessConfig.h:
 
-      o RootlessAlphaMask(bpp): By default for a color bit depth of 24 and 32
-        bits per pixel, fb will overwrite the "unused" 8 bits to optimize
-        drawing speed. Rootless ensures that the alpha channel of frames is
-        protected and is not modified when drawing to them. The bits
-        containing the alpha channel are defined by this macro, which should
-        return a bit mask for various bits per pixel.
-
       o ROOTLESS_REDISPLAY_DELAY: Time in milliseconds between updates to
         the underlying window server. Most operations will be buffered until
         this time has expired.
@@ -129,12 +122,10 @@ Alpha Channel Protection
 contents of the extra bits are undefined by the X11 protocol. Some window
 systems will use these extra bits as an alpha channel. The generic rootless
 layer will protect these bits and make sure they are not modified by other
-parts of the X server. To protect the alpha channel RootlessAlphaMask(bpp)
-must be set appropriately as described under the compile time options. This
-ensures that the X11 graphics primitives do not overwrite the alpha channel
-in an attempt to optimize drawing. In addition, the window functions
-PaintWindow() and Composite() must be replaced by alpha channel safe
-variants. These are provided in rootless/safeAlpha.
+parts of the X server. This ensures that the X11 graphics primitives do not
+overwrite the alpha channel in an attempt to optimize drawing. In addition,
+the window functions PaintWindow() and Composite() must be replaced by
+alpha channel safe variants. These are provided in rootless/safeAlpha.
 
 
 Credits
diff --git a/miext/rootless/rootlessConfig.h b/miext/rootless/rootlessConfig.h
index 222be53..8fb502d 100644
--- a/miext/rootless/rootlessConfig.h
+++ b/miext/rootless/rootlessConfig.h
@@ -40,11 +40,6 @@
 # define ROOTLESS_RESIZE_GRAVITY TRUE
 /*# define ROOTLESSDEBUG*/
 
-/* Bit mask for alpha channel with a particular number of bits per
-   pixel. Note that we only care for 32bpp data. Mac OS X uses planar
-   alpha for 16bpp. */
-# define RootlessAlphaMask(bpp) ((bpp) == 32 ? 0xFF000000 : 0)
-
 #endif /* __APPLE__ */
 
 #if defined(__CYGWIN__) || defined(WIN32)
@@ -53,8 +48,6 @@
 # undef  ROOTLESS_RESIZE_GRAVITY
 /*# define ROOTLESSDEBUG*/
 
-# define RootlessAlphaMask(bpp) ((bpp) == 32 ? 0xFF000000 : 0)
-
 #endif /* __CYGWIN__ */
 
 #endif /* _ROOTLESSCONFIG_H */
diff --git a/miext/rootless/rootlessGC.c b/miext/rootless/rootlessGC.c
index a9cb413..878e847 100644
--- a/miext/rootless/rootlessGC.c
+++ b/miext/rootless/rootlessGC.c
@@ -187,6 +187,8 @@ static GCOps rootlessGCOps = {
 
  */
 
+#define RootlessAlphaMask(bpp) ((bpp) == 32 ? 0xFF000000 : 0)
+
 #define GC_SAVE(pGC) 				\
     unsigned long _save_fg = (pGC)->fgPixel;	\
     unsigned long _save_bg = (pGC)->bgPixel;	\
-- 
1.7.0



More information about the xorg-devel mailing list