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

Adam Jackson ajax at redhat.com
Tue Jul 24 19:47:28 UTC 2018


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 8789a5ece5..ea3920c869 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -492,6 +492,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;
@@ -1056,6 +1057,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);
@@ -2614,6 +2616,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;
@@ -2711,6 +2714,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)
@@ -2817,6 +2821,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;
             }
diff --git a/include/windowstr.h b/include/windowstr.h
index 4383dabdcf..ae75c96f17 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 */
-- 
2.17.0



More information about the xorg-devel mailing list