[PATCH 1/3] rootless: ROOTLESS_PROTECT_ALPHA is always set, so unifdef it.

Jon TURNEY jon.turney at dronecode.org.uk
Thu Jul 15 13:30:21 PDT 2010


On 15/07/2010 17:28, Jamey Sharp wrote:
> The settings for each platform in rootlessConfig.h were misleading. On
> Apple builds, ROOTLESS_PROTECT_ALPHA was defined to TRUE; on Windows it
> was defined to NO. Both cases enabled alpha channel protection though,
> because the test in rootlessGC.c was a simple #ifdef.
>
> Colin Harrison says that for Xming builds he's always patched it to
> define ROOTLESS_PROTECT_ALPHA to TRUE for Windows as well, and that
> unconditionally enabling alpha-channel protection would be appropriate.

I'm not sure I understand this well enough to know if this is wrong or right.

It's unclear to me what this protected alpha channel is supposed to be used 
for.  If it's for use by the native window manager in alpha blending the 
window into the native desktop, that's something we make no attempt to do on 
Windows, and so there's no point in doing the extra work in rootless to 
protect that alpha channel.

Or maybe I've completely misunderstood the purposes of this...

> ---
>   miext/rootless/README.txt       |   34 ++++++++++++++++------------------
>   miext/rootless/rootlessConfig.h |    2 --
>   miext/rootless/rootlessGC.c     |   15 +++++----------
>   3 files changed, 21 insertions(+), 30 deletions(-)
>
> diff --git a/miext/rootless/README.txt b/miext/rootless/README.txt
> index 754715d..cea2c01 100644
> --- a/miext/rootless/README.txt
> +++ b/miext/rootless/README.txt
> @@ -76,13 +76,12 @@ rootlessConfig.h to specify compile time options for its platform.
>           The following compile-time options are defined in
>   rootlessConfig.h:
>
> -      o ROOTLESS_PROTECT_ALPHA: 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. If this is true, the alpha channel of frames is
> -        protected and is not modified when drawing to them. The bits
> -        containing the alpha channel are defined by the macro
> -        RootlessAlphaMask(bpp), which should return a bit mask for
> -        various bits per pixel.
> +      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
> @@ -126,17 +125,16 @@ functions should be used instead of fb.
>
>   Alpha Channel Protection
>
> -	If the bits per pixel is greater then the color bit depth, the 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 can
> -be configured to protect these bits and make sure they are not modified by
> -other parts of the X server. To protect the alpha channel
> -ROOTLESS_PROTECT_ALPHA and 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.
> +        If the bits per pixel is greater then the color bit depth, the
> +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.

rootless/safeAlpha no longer exists, being removed some time ago, so this text 
is still wrong :-)


More information about the xorg-devel mailing list