[PATCH 18/37] dix: Add 'paintable' bit to the window state

Adam Jackson ajax at redhat.com
Wed Oct 8 08:04:42 PDT 2014


A paintable window is a window whose pixels are (potentially) modifiable
by rendering commands.  Right now this is effectively a shadow of the
viewable bit, but set by DDX instead of DIX.  Later in this series it
will also indicate a window with allocated backing store.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 dix/window.c        | 1 +
 fb/fbwindow.c       | 2 ++
 hw/dmx/dmxwindow.c  | 5 +++++
 hw/xnest/Window.c   | 2 ++
 include/windowstr.h | 1 +
 5 files changed, 11 insertions(+)

diff --git a/dix/window.c b/dix/window.c
index 99024de..39cb6f7 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;
diff --git a/fb/fbwindow.c b/fb/fbwindow.c
index 7a5fac8..8ac6aba 100644
--- a/fb/fbwindow.c
+++ b/fb/fbwindow.c
@@ -48,6 +48,7 @@ fbDestroyWindow(WindowPtr pWin)
 Bool
 fbRealizeWindow(WindowPtr pWindow)
 {
+    pWindow->paintable = (pWindow->drawable.class == InputOutput);
     return TRUE;
 }
 
@@ -60,6 +61,7 @@ fbPositionWindow(WindowPtr pWin, int x, int y)
 Bool
 fbUnrealizeWindow(WindowPtr pWindow)
 {
+    pWindow->paintable = FALSE;
     return TRUE;
 }
 
diff --git a/hw/dmx/dmxwindow.c b/hw/dmx/dmxwindow.c
index c753735..5eb4ee9 100644
--- a/hw/dmx/dmxwindow.c
+++ b/hw/dmx/dmxwindow.c
@@ -622,6 +622,9 @@ dmxRealizeWindow(WindowPtr pWindow)
         ret = pScreen->RealizeWindow(pWindow);
 #endif
 
+    /* tell DIX this window is paintable */
+    pWindow->paintable = (pWindow->drawable.class == InputOutput);
+
     /* Determine if the window is completely off the visible portion of
        the screen */
     pWinPriv->offscreen = DMX_WINDOW_OFFSCREEN(pWindow);
@@ -662,6 +665,8 @@ dmxUnrealizeWindow(WindowPtr pWindow)
         ret = pScreen->UnrealizeWindow(pWindow);
 #endif
 
+    pWindow->paintable = FALSE;
+
     if (pWinPriv->window) {
         /* Unrealize window on back-end server */
         XUnmapWindow(dmxScreen->beDisplay, pWinPriv->window);
diff --git a/hw/xnest/Window.c b/hw/xnest/Window.c
index 8d9c672..ccdc3e3 100644
--- a/hw/xnest/Window.c
+++ b/hw/xnest/Window.c
@@ -352,6 +352,7 @@ xnestChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
 Bool
 xnestRealizeWindow(WindowPtr pWin)
 {
+    pWin->paintable = (pWin->drawable.class == InputOutput);
     xnestConfigureWindow(pWin, CWStackingOrder);
     xnestShapeWindow(pWin);
     XMapWindow(xnestDisplay, xnestWindow(pWin));
@@ -362,6 +363,7 @@ xnestRealizeWindow(WindowPtr pWin)
 Bool
 xnestUnrealizeWindow(WindowPtr pWin)
 {
+    pWin->paintable = FALSE;
     XUnmapWindow(xnestDisplay, xnestWindow(pWin));
 
     return True;
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