[PATCH 1/8] dix: Add 'paintable' bit to the window state (v2)

Keith Packard keithp at keithp.com
Fri Nov 21 23:16:20 PST 2014


Adam Jackson <ajax at redhat.com> writes:

> A paintable window is a window whose pixels are (potentially) modifiable
> by rendering commands.  Right now that just means the same thing as
> viewable; it will soon also include unmapped windows with backing store
> set to Always.
>
> v2:
> Set paintable in dix not ddx (Keith Packard)
>
> Signed-off-by: Adam Jackson <ajax at redhat.com>


> ---
>  dix/window.c        | 5 +++++
>  include/windowstr.h | 1 +
>  2 files changed, 6 insertions(+)
>
> diff --git a/dix/window.c b/dix/window.c
> index d43ef03..431566d 100644
> --- a/dix/window.c
> +++ b/dix/window.c
> @@ -367,6 +367,7 @@ SetWindowToDefaults(WindowPtr pWin)
>      pWin->mapped = FALSE;       /* off */
>      pWin->realized = FALSE;     /* off */
>      pWin->viewable = FALSE;
> +    pWin->paintable = FALSE;
>      pWin->visibility = VisibilityNotViewable;
>      pWin->overrideRedirect = FALSE;
>      pWin->saveUnder = FALSE;
> @@ -934,6 +935,7 @@ CrushTree(WindowPtr pWin)
>              FreeResource(pChild->drawable.id, RT_WINDOW);
>              pSib = pChild->nextSib;
>              pChild->viewable = FALSE;
> +            pChild->paintable = FALSE;
>              if (pChild->realized) {
>                  pChild->realized = FALSE;
>                  (*UnrealizeWindow) (pChild);
> @@ -2492,6 +2494,7 @@ RealizeTree(WindowPtr pWin)
>          if (pChild->mapped) {
>              pChild->realized = TRUE;
>              pChild->viewable = (pChild->drawable.class == InputOutput);
> +            pChild->paintable = (pChild->drawable.class == InputOutput);
>              (*Realize) (pChild);
>              if (pChild->firstChild) {
>                  pChild = pChild->firstChild;
> @@ -2589,6 +2592,7 @@ MapWindow(WindowPtr pWin, ClientPtr client)
>          pWin->mapped = TRUE;
>          pWin->realized = TRUE;  /* for roots */
>          pWin->viewable = pWin->drawable.class == InputOutput;
> +        pWin->paintable = pWin->drawable.class == InputOutput;
>          /* We SHOULD check for an error value here XXX */
>          (*pScreen->RealizeWindow) (pWin);
>          if (pScreen->ClipNotify)
> @@ -2695,6 +2699,7 @@ UnrealizeTree(WindowPtr pWin, Bool fromConfigure)
>              DeleteWindowFromAnyEvents(pChild, FALSE);
>              if (pChild->viewable) {
>                  pChild->viewable = FALSE;
> +                pChild->paintable = FALSE;
>                  (*MarkUnrealizedWindow) (pChild, pWin, fromConfigure);
>                  pChild->drawable.serialNumber = NEXT_SERIAL_NUMBER;
>              }

The above part is

Reviewed-by: Keith Packard <keithp at keithp.com>

> diff --git a/include/windowstr.h b/include/windowstr.h
> index 740f4a6..6443ead 100644
> --- a/include/windowstr.h
> +++ b/include/windowstr.h
> @@ -158,6 +158,7 @@ typedef struct _Window {
>      unsigned mapped:1;
>      unsigned realized:1;        /* ancestors are all mapped */
>      unsigned viewable:1;        /* realized && InputOutput */
> +    unsigned paintable:1;
>      unsigned dontPropagate:3;   /* index into DontPropagateMasks */
>      unsigned forcedBS:1;        /* system-supplied backingStore */
>      unsigned redirectDraw:2;    /* COMPOSITE rendering redirect */

My only concern here is that when ROOTLESS is defined, we're using
exactly 32 bits in the long list of bitfields (unless I've
miscounted). I assume that this will cause the struct to grow by 4
bytes?

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20141121/d21a3b72/attachment.sig>


More information about the xorg-devel mailing list