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

Adam Jackson ajax at redhat.com
Mon Nov 17 12:41:08 PST 2014


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;
             }
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 */
-- 
1.9.3



More information about the xorg-devel mailing list