[Xquartz-changes] xserver: Branch 'master' - 16 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Wed Apr 27 17:27:08 PDT 2011


 configure.ac                   |    2 -
 exa/exa_unaccel.c              |    7 +---
 fb/fbtrap.c                    |   63 ++++++++++++++++++++++-------------------
 glx/glxdri.c                   |   17 ++++++++---
 hw/xwin/InitOutput.c           |    2 -
 hw/xwin/man/XWin.man           |    3 +
 hw/xwin/winclipboardxevents.c  |    5 ++-
 hw/xwin/winmonitors.c          |    2 -
 hw/xwin/winmultiwindowicons.c  |    3 +
 hw/xwin/winmultiwindowwindow.c |   30 ++++++++++++++-----
 hw/xwin/winmultiwindowwm.c     |   46 ++++++++++++++++++++++++++++-
 hw/xwin/winpfbdd.c             |    3 +
 hw/xwin/winprefs.c             |   26 +---------------
 hw/xwin/winprefs.h             |    2 -
 hw/xwin/winscrinit.c           |    4 ++
 hw/xwin/winshaddd.c            |    3 +
 hw/xwin/winshadddnl.c          |    3 +
 hw/xwin/winshadgdi.c           |    3 +
 hw/xwin/winwin32rootless.c     |   20 ++++++-------
 include/regionstr.h            |    5 +++
 render/picture.c               |   58 -------------------------------------
 render/picturestr.h            |   48 -------------------------------
 22 files changed, 159 insertions(+), 196 deletions(-)

New commits:
commit f6d4e75ec55ac6812f9dead42ecdffb9614578c7
Merge: ec9ea40... 4318e6a...
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Apr 27 12:08:51 2011 -0700

    Merge remote-tracking branch 'jturney/master'

commit ec9ea4017885cefe5519a4e890b0ff1a5518235a
Merge: c6cb70b... 6f29dbf...
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Apr 27 12:01:56 2011 -0700

    Merge remote-tracking branch 'jeremyhu/master'

commit 4318e6a147e78b2663c5e0ea6ba0d351a1e87f98
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sat Mar 5 17:34:42 2011 +0000

    Cygwin/X: Handle failure during winScreenInit()
    
    Handle failure during winScreenInit() a bit more cleanly, rather than crashing
    
    This avoids a crash with 'XWin -fullscreen -screen 0 @2 -screen 1 @1'
    
    Also document that fullscreen may only be applied to one screen.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Tested-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/man/XWin.man b/hw/xwin/man/XWin.man
index e7933c9..aad29cf 100644
--- a/hw/xwin/man/XWin.man
+++ b/hw/xwin/man/XWin.man
@@ -67,7 +67,7 @@ The default behaviour is to create a single screen 0 that is roughly the
 size of useful area of the primary monitor (allowing for any window
 decorations and the task-bar).
 
-Screen specific parameters, such as \fB\-fullscreen\fP, can be applied as a
+Screen specific parameters can be applied as a
 default to all screens by placing those screen specific parameters
 before any \fB\-screen\fP parameter.  Screen specific parameters placed after
 the first \fB\-screen\fP parameter will apply only to the immediately
@@ -108,6 +108,7 @@ in \fB-multiwindow\fP or \fB-rootless\fP mode.
 .B "\-fullscreen"
 The X server window takes the full screen, covering completely the
 \fIWindows\fP desktop.
+Currently \fB\-fullscreen\fP may only be applied to one X screen.
 .TP 8
 .B \-nodecoration
 Do not give the Cygwin/X window a \fIWindows\fP window border, title bar,
diff --git a/hw/xwin/winpfbdd.c b/hw/xwin/winpfbdd.c
index c0bca71..a399020 100644
--- a/hw/xwin/winpfbdd.c
+++ b/hw/xwin/winpfbdd.c
@@ -294,7 +294,8 @@ winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen)
 
   /* Call the wrapped CloseScreen procedure */
   WIN_UNWRAP(CloseScreen);
-  fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
+  if (pScreen->CloseScreen)
+    fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
 
   /* Delete the window property */
   RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP);
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
index 691237e..983ff57 100644
--- a/hw/xwin/winscrinit.c
+++ b/hw/xwin/winscrinit.c
@@ -220,6 +220,10 @@ winScreenInit (int index,
   if (!((*pScreenPriv->pwinFinishScreenInit) (index, pScreen, argc, argv)))
     {
       ErrorF ("winScreenInit - winFinishScreenInit () failed\n");
+
+      /* call the engine dependent screen close procedure to clean up from a failure */
+      pScreenPriv->pwinCloseScreen(index, pScreen);
+
       return FALSE;
     }
 
diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c
index 00d7a37..6dad278 100644
--- a/hw/xwin/winshaddd.c
+++ b/hw/xwin/winshaddd.c
@@ -728,7 +728,8 @@ winCloseScreenShadowDD (int nIndex, ScreenPtr pScreen)
 
   /* Call the wrapped CloseScreen procedure */
   WIN_UNWRAP(CloseScreen);
-  fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
+  if (pScreen->CloseScreen)
+    fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
 
   winFreeFBShadowDD(pScreen);
 
diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c
index 0a0b4ae..63d48ad 100644
--- a/hw/xwin/winshadddnl.c
+++ b/hw/xwin/winshadddnl.c
@@ -802,7 +802,8 @@ winCloseScreenShadowDDNL (int nIndex, ScreenPtr pScreen)
 
   /* Call the wrapped CloseScreen procedure */
   WIN_UNWRAP(CloseScreen);
-  fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
+  if (pScreen->CloseScreen)
+    fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
 
   winFreeFBShadowDDNL(pScreen);
 
diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c
index 4990376..1e7cb00 100644
--- a/hw/xwin/winshadgdi.c
+++ b/hw/xwin/winshadgdi.c
@@ -636,7 +636,8 @@ winCloseScreenShadowGDI (int nIndex, ScreenPtr pScreen)
 
   /* Call the wrapped CloseScreen procedure */
   WIN_UNWRAP(CloseScreen);
-  fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
+  if (pScreen->CloseScreen)
+    fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
 
   /* Delete the window property */
   RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP);
commit ce6136f8c553bbc6d3e3affa0faa2afbf8054f44
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Tue Mar 23 20:06:33 2010 +0000

    Cygwin/X: Make winOverrrideStyle() thread-safe
    
    Make winOverrrideStyle() thread-safe
    
    winOverrideStyle() is called from the internal WM client thread.
    
    Accessing server-internal data structures to get window name and
    class is not safe, as there is no lock to ensure we do not collide
    with these data structures being updated in the server thread.
    
    Rewrite so the internal client thread uses X client calls to
    obtain this data safely
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Tested-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index ef0c7cf..67a58a0 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -1576,7 +1576,6 @@ winApplyHints (Display *pDisplay, Window iWindow, HWND hWnd, HWND *zstyle)
   Atom			type, *pAtom = NULL;
   int			format;
   unsigned long		hint = 0, maxmin = 0, style, nitems = 0 , left = 0;
-  WindowPtr		pWin = GetProp (hWnd, WIN_WINDOW_PROP);
   MwmHints              *mwm_hint = NULL;
 
   if (!hWnd) return;
@@ -1669,7 +1668,26 @@ winApplyHints (Display *pDisplay, Window iWindow, HWND hWnd, HWND *zstyle)
   }
 
   /* Override hint settings from above with settings from config file */
-  style = winOverrideStyle((unsigned long)pWin);
+  {
+    XClassHint class_hint = {0,0};
+    char *window_name = 0;
+
+    if (XGetClassHint(pDisplay, iWindow, &class_hint))
+      {
+        XFetchName(pDisplay, iWindow, &window_name);
+
+        style = winOverrideStyle(class_hint.res_name, class_hint.res_class, window_name);
+
+        if (class_hint.res_name) XFree(class_hint.res_name);
+        if (class_hint.res_class) XFree(class_hint.res_class);
+        if (window_name) XFree(window_name);
+      }
+    else
+      {
+        style = STYLE_NONE;
+      }
+  }
+
   if (style & STYLE_TOPMOST) *zstyle = HWND_TOPMOST;
   else if (style & STYLE_MAXIMIZE) maxmin = (hint & ~HINT_MIN) | HINT_MAX;
   else if (style & STYLE_MINIMIZE) maxmin = (hint & ~HINT_MAX) | HINT_MIN;
diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c
index 4ccb4ff..d941c51 100644
--- a/hw/xwin/winprefs.c
+++ b/hw/xwin/winprefs.c
@@ -813,40 +813,20 @@ LoadPreferences (void)
  * STYLES{} section in the prefs file, and return the style type
  */
 unsigned long
-winOverrideStyle (unsigned long longpWin)
+winOverrideStyle (char *res_name, char *res_class, char *wmName)
 {
-  WindowPtr pWin = (WindowPtr) longpWin;
-  char *res_name, *res_class;
   int i;
-  char *wmName;
-
-  if (pWin==NULL)
-    return STYLE_NONE;
-
-  /* If we can't find the class, we can't override from default! */
-  if (!winMultiWindowGetClassHint (pWin, &res_name, &res_class))
-    return STYLE_NONE;
-
-  winMultiWindowGetWMName (pWin, &wmName);
 
   for (i=0; i<pref.styleItems; i++) {
-    if (!strcmp(pref.style[i].match, res_name) ||
-	!strcmp(pref.style[i].match, res_class) ||
+    if ((res_name && !strcmp(pref.style[i].match, res_name)) ||
+	(res_class && !strcmp(pref.style[i].match, res_class)) ||
 	(wmName && strstr(wmName, pref.style[i].match)))
       {
-	free (res_name);
-	free (res_class);
-	free(wmName);
-
 	if (pref.style[i].type)
 	  return pref.style[i].type;
       }
   }
 
   /* Didn't find the style, fail gracefully */
-  free (res_name);
-  free (res_class);
-  free(wmName);
-
   return STYLE_NONE;
 }
diff --git a/hw/xwin/winprefs.h b/hw/xwin/winprefs.h
index 33b496d..ecd0a3f 100644
--- a/hw/xwin/winprefs.h
+++ b/hw/xwin/winprefs.h
@@ -180,7 +180,7 @@ HICON
 winOverrideIcon (unsigned long longpWin);
 
 unsigned long
-winOverrideStyle (unsigned long longpWin);
+winOverrideStyle (char *res_name, char *res_class, char *wmName);
 
 HICON
 winTaskbarIcon(void);
commit 0c603509eb7f9c83baf4e00b4558dce78f897ebf
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Feb 11 13:15:40 2011 +0000

    Cygwin/X: Cosmetic fixes to logging of result from X*TextPropertyToTextList()
    
    Report XLocaleNotSupported result from X*TextPropertyToTextList()
    Fix formatting for unknown results reported for X*TextPropertyToTextList()
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Tested-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winclipboardxevents.c b/hw/xwin/winclipboardxevents.c
index 8b502b1..b0006a0 100644
--- a/hw/xwin/winclipboardxevents.c
+++ b/hw/xwin/winclipboardxevents.c
@@ -636,11 +636,14 @@ winClipboardFlushXEvents (HWND hwnd,
 		case XNoMemory:
 		  ErrorF ("XNoMemory\n");
 		  break;
+		case XLocaleNotSupported:
+		  ErrorF ("XLocaleNotSupported\n");
+		  break;
 		case XConverterNotFound:
 		  ErrorF ("XConverterNotFound\n");
 		  break;
 		default:
-		  ErrorF ("%d", iReturn);
+		  ErrorF ("%d\n", iReturn);
 		  break;
 		}
 	      pszReturnData = malloc (1);
commit 71550a8665d861384332d81239ca0c1586a17137
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Jan 28 20:17:22 2011 +0000

    Cygwin/X: Decorate function pointers retrieved via GetProcAddress with WINAPI
    
    Decorate function pointers retrieved via GetProcAddress which are currently
    missing it with WINAPI, to ensure stdcall convention is used when calling them.
    
    This fixes a crash currently seen when compiled -O2 and the -screen option uses
    a size and monitor number e.g. -screen 0 1280x1000 at 2
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Tested-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index 7faed01..22ef8da 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -49,7 +49,7 @@ from The Open Group.
 #endif
 #ifdef RELOCATE_PROJECTROOT
 #include <shlobj.h>
-typedef HRESULT (*SHGETFOLDERPATHPROC)(
+typedef WINAPI HRESULT (*SHGETFOLDERPATHPROC)(
     HWND hwndOwner,
     int nFolder,
     HANDLE hToken,
diff --git a/hw/xwin/winmonitors.c b/hw/xwin/winmonitors.c
index 63af803..a9d46f9 100644
--- a/hw/xwin/winmonitors.c
+++ b/hw/xwin/winmonitors.c
@@ -53,7 +53,7 @@ wBOOL CALLBACK getMonitorInfo(HMONITOR hMonitor, HDC hdc, LPRECT rect, LPARAM _d
   return TRUE;
 }
 
-typedef wBOOL (*ENUMDISPLAYMONITORSPROC)(HDC,LPCRECT,MONITORENUMPROC,LPARAM);
+typedef WINAPI wBOOL (*ENUMDISPLAYMONITORSPROC)(HDC,LPCRECT,MONITORENUMPROC,LPARAM);
 ENUMDISPLAYMONITORSPROC _EnumDisplayMonitors;
 
 wBOOL CALLBACK getMonitorInfo(HMONITOR hMonitor, HDC hdc, LPRECT rect, LPARAM _data);
commit 38a1f5c613a48ef9fd6ba043bc3028f487750d3a
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Tue Oct 12 17:12:02 2010 +0100

    Cygwin/X: Don't make InputOnly windows visible
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Tested-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index 61305e1..21b818b 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -506,12 +506,16 @@ winCreateWindowsWindow (WindowPtr pWin)
   iWidth = pWin->drawable.width;
   iHeight = pWin->drawable.height;
 
-  /* ensure window actually ends up somewhere visible */
-  if (iX > GetSystemMetrics (SM_CXVIRTUALSCREEN))
-    iX = CW_USEDEFAULT;
+  /* If it's an InputOutput window, and so is going to end up being made visible,
+     make sure the window actually ends up somewhere where it will be visible */
+  if (pWin->drawable.class != InputOnly)
+    {
+      if ((iX < GetSystemMetrics (SM_XVIRTUALSCREEN)) || (iX > GetSystemMetrics (SM_CXVIRTUALSCREEN)))
+        iX = CW_USEDEFAULT;
 
-  if (iY > GetSystemMetrics (SM_CYVIRTUALSCREEN))
-    iY = CW_USEDEFAULT;
+      if ((iY < GetSystemMetrics (SM_YVIRTUALSCREEN)) || (iY > GetSystemMetrics (SM_CYVIRTUALSCREEN)))
+        iY = CW_USEDEFAULT;
+    }
 
   if (winMultiWindowGetTransientFor (pWin, &pDaddy))
     {
@@ -666,7 +670,8 @@ winUpdateWindowsWindow (WindowPtr pWin)
 	}
 
       /* Display the window without activating it */
-      ShowWindow (pWinPriv->hWnd, SW_SHOWNOACTIVATE);
+      if (pWin->drawable.class != InputOnly)
+        ShowWindow (pWinPriv->hWnd, SW_SHOWNOACTIVATE);
 
       /* Send first paint message */
       UpdateWindow (pWinPriv->hWnd);
commit bd288c3458bc1ba2cbb4c8416e5b2dfd849581e6
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Jul 22 18:36:51 2010 +0100

    Cygwin/X: Fix a GDI bitmap resource leak of window icons
    
    Ensure any icon created specially for a window is destroyed when
    the window is destroyed
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Tested-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winmultiwindowicons.c b/hw/xwin/winmultiwindowicons.c
index 1ca3f91..44956e3 100644
--- a/hw/xwin/winmultiwindowicons.c
+++ b/hw/xwin/winmultiwindowicons.c
@@ -624,6 +624,7 @@ void winSelectIcons(WindowPtr pWin, HICON *pIcon, HICON *pSmallIcon)
     *pIcon = hIcon;
   else
     winDestroyIcon(hIcon);
+
   if (pSmallIcon)
     *pSmallIcon = hSmallIcon;
   else
@@ -632,7 +633,7 @@ void winSelectIcons(WindowPtr pWin, HICON *pIcon, HICON *pSmallIcon)
 
 void winDestroyIcon(HICON hIcon)
 {
-  /* Delete the icon if its not the default */
+  /* Delete the icon if its not one of the application defaults or an override */
   if (hIcon &&
       hIcon != g_hIconX &&
       hIcon != g_hSmallIconX &&
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index 7efc360..61305e1 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -592,7 +592,9 @@ winDestroyWindowsWindow (WindowPtr pWin)
   MSG			msg;
   winWindowPriv(pWin);
   BOOL			oldstate = winInDestroyWindowsWindow;
-  
+  HICON hIcon;
+  HICON hIconSm;
+
 #if CYGMULTIWINDOW_DEBUG
   ErrorF ("winDestroyWindowsWindow\n");
 #endif
@@ -603,13 +605,22 @@ winDestroyWindowsWindow (WindowPtr pWin)
 
   winInDestroyWindowsWindow = TRUE;
 
+  /* Store the info we need to destroy after this window is gone */
+  hIcon = (HICON)SendMessage(pWinPriv->hWnd, WM_GETICON, ICON_BIG, 0);
+  hIconSm = (HICON)SendMessage(pWinPriv->hWnd, WM_GETICON, ICON_SMALL, 0);
+
   SetProp (pWinPriv->hWnd, WIN_WINDOW_PROP, NULL);
+
   /* Destroy the Windows window */
   DestroyWindow (pWinPriv->hWnd);
 
   /* Null our handle to the Window so referencing it will cause an error */
   pWinPriv->hWnd = NULL;
 
+  /* Destroy any icons we created for this window */
+  winDestroyIcon(hIcon);
+  winDestroyIcon(hIconSm);
+
   /* Process all messages on our queue */
   while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
     {
diff --git a/hw/xwin/winwin32rootless.c b/hw/xwin/winwin32rootless.c
index 75142f1..8f9917a 100644
--- a/hw/xwin/winwin32rootless.c
+++ b/hw/xwin/winwin32rootless.c
@@ -366,8 +366,8 @@ void
 winMWExtWMDestroyFrame (RootlessFrameID wid)
 {
   win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
-  HICON			hiconClass;
-  HICON			hiconSmClass;
+  HICON			hIcon;
+  HICON			hIconSm;
   HMODULE		hInstance;
   int			iReturn;
   char			pszClass[CLASS_NAME_LENGTH];
@@ -398,8 +398,8 @@ winMWExtWMDestroyFrame (RootlessFrameID wid)
 
   /* Store the info we need to destroy after this window is gone */
   hInstance = (HINSTANCE) GetClassLongPtr (pRLWinPriv->hWnd, GCLP_HMODULE);
-  hiconClass = (HICON) GetClassLongPtr (pRLWinPriv->hWnd, GCLP_HICON);
-  hiconSmClass = (HICON) GetClassLongPtr (pRLWinPriv->hWnd, GCLP_HICONSM);
+  hIcon = (HICON)SendMessage(pRLWinPriv->hWnd, WM_GETICON, ICON_BIG, 0);
+  hIconSm = (HICON)SendMessage(pRLWinPriv->hWnd, WM_GETICON, ICON_SMALL, 0);
   iReturn = GetClassName (pRLWinPriv->hWnd, pszClass, CLASS_NAME_LENGTH);
 
   pRLWinPriv->fClose = TRUE;
@@ -415,14 +415,14 @@ winMWExtWMDestroyFrame (RootlessFrameID wid)
       winDebug ("winMWExtWMDestroyFrame - Unregistering %s: ", pszClass);
 #endif
       iReturn = UnregisterClass (pszClass, hInstance);
-      
+    }
+
 #if CYGMULTIWINDOW_DEBUG
-      winDebug ("winMWExtWMDestroyFramew - %d Deleting Icon: ", iReturn);
+  winDebug ("winMWExtWMDestroyFramew - Deleting Icon\n");
 #endif
-      
-      winDestroyIcon(hiconClass);
-      winDestroyIcon(hiconSmClass);
-    }
+
+  winDestroyIcon(hIcon);
+  winDestroyIcon(hIconSm);
 
 #if CYGMULTIWINDOW_DEBUG
   winDebug ("winMWExtWMDestroyFrame - done\n");
commit 19e764eee0c8b74d877fb2b1d6aedc933976660e
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Wed Jul 21 18:11:13 2010 +0100

    Cygwin/X: Internal WM workaround for Java AWT bug
    
    Java applications using AWT on JRE 1.6.0 break with non-reparenting WMs AWT
    doesn't explicitly know about (See sun bug #6434227)
    
    XDecoratedPeer.handleConfigureNotifyEvent() only processes non-synthetic
    ConfigureNotify events to update window location if it's identified the
    WM as a non-reparenting WM it knows about (compiz or lookingglass)
    
    Rather than tell all sorts of lies to get XWM to recognize us as one of
    those, simply send a synthetic ConfigureNotify for every non-synthetic one
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Tested-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index c9b1584..ef0c7cf 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -1114,6 +1114,30 @@ winMultiWindowXMsgProc (void *pArg)
                 }
             }
         }
+      else if (event.type == ConfigureNotify)
+        {
+          if (!event.xconfigure.send_event)
+            {
+              /*
+                Java applications using AWT on JRE 1.6.0 break with non-reparenting WMs AWT
+                doesn't explicitly know about (See sun bug #6434227)
+
+                XDecoratedPeer.handleConfigureNotifyEvent() only processes non-synthetic
+                ConfigureNotify events to update window location if it's identified the
+                WM as a non-reparenting WM it knows about (compiz or lookingglass)
+
+                Rather than tell all sorts of lies to get XWM to recognize us as one of
+                those, simply send a synthetic ConfigureNotify for every non-synthetic one
+               */
+              XEvent event_send = event;
+              event_send.xconfigure.send_event = TRUE;
+              event_send.xconfigure.event = event.xconfigure.window;
+              XSendEvent(event.xconfigure.display,
+                         event.xconfigure.window,
+                         True, StructureNotifyMask,
+                         &event_send);
+            }
+        }
       else if (event.type == PropertyNotify
 	       && event.xproperty.atom == atmWmName)
 	{
commit c6cb70be1ed7cf73bd3411b8d66ec05a9efcfeb9
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Mon Mar 28 13:30:52 2011 -0400

    Fix trapezoid and triangle rendering to windows
    
    For fbAdd{Traps,Triangles}() and fbRasterizeTrapezoid() this is just a
    matter of adding the image offsets to the trap offsets.
    
    For fbShapes, the story is more complicated:
    
    The recently added pixman API did not allow offsetting
    trapezoids. Instead, it would use x_dst and y_dst in such a way that
    the effect was to only offset the source image.
    
    In pixman 0.21.8, this API has changed such that all the traps are
    conceptually rendered to an infinitely big image, and the source and
    destination coordinates are then aligned with (0, 0) of that
    image. This means offsetting dst_x and dst_y will now offset the
    entire drawing, which is similar to how other composite functions
    work.
    
    This patch then changes fbComposite{Triangles,Traps} such that the
    source image is aligned with the shapes, and the destination
    coordinates offset according to drawable->{x, y}.
    
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Soren Sandmann <ssp at redhat.com>

diff --git a/configure.ac b/configure.ac
index 56e51a4..e2b3fa6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -797,7 +797,7 @@ LIBPCIACCESS="pciaccess >= 0.8.0"
 LIBUDEV="libudev >= 143"
 LIBSELINUX="libselinux >= 2.0.86"
 LIBDBUS="dbus-1 >= 1.0"
-LIBPIXMAN="pixman-1 >= 0.21.6"
+LIBPIXMAN="pixman-1 >= 0.21.8"
 
 dnl Pixman is always required, but we separate it out so we can link
 dnl specific modules against it
diff --git a/fb/fbtrap.c b/fb/fbtrap.c
index b5c5a61..0b5a638 100644
--- a/fb/fbtrap.c
+++ b/fb/fbtrap.c
@@ -38,13 +38,14 @@ fbAddTraps (PicturePtr	pPicture,
 	    int		ntrap,
 	    xTrap	*traps)
 {
-    int image_xoff, image_yoff;
-    pixman_image_t *image = image_from_pict (pPicture, FALSE, &image_xoff, &image_yoff);
+    pixman_image_t *image;
+    int dst_xoff, dst_yoff;
 
-    if (!image)
+    if (!(image = image_from_pict (pPicture, FALSE, &dst_xoff, &dst_yoff)))
 	return;
     
-    pixman_add_traps (image, x_off, y_off, ntrap, (pixman_trap_t *)traps);
+    pixman_add_traps (image, x_off + dst_xoff, y_off + dst_yoff,
+		      ntrap, (pixman_trap_t *)traps);
 
     free_pixman_pict (pPicture, image);
 }
@@ -55,13 +56,15 @@ fbRasterizeTrapezoid (PicturePtr    pPicture,
 		      int	    x_off,
 		      int	    y_off)
 {
-    int	mask_xoff, mask_yoff;
-    pixman_image_t *image = image_from_pict (pPicture, FALSE, &mask_xoff, &mask_yoff);
+    pixman_image_t *image;
+    int	dst_xoff, dst_yoff;
 
-    if (!image)
+    if (!(image = image_from_pict (pPicture, FALSE, &dst_xoff, &dst_yoff)))
 	return;
 
-    pixman_rasterize_trapezoid (image, (pixman_trapezoid_t *)trap, x_off, y_off);
+    pixman_rasterize_trapezoid (image, (pixman_trapezoid_t *)trap,
+				x_off + dst_xoff,
+				y_off + dst_yoff);
 
     free_pixman_pict (pPicture, image);
 }
@@ -73,14 +76,15 @@ fbAddTriangles (PicturePtr  pPicture,
 		int	    ntri,
 		xTriangle *tris)
 {
-    int image_xoff, image_yoff;
-    pixman_image_t *image =
-	image_from_pict (pPicture, FALSE, &image_xoff, &image_yoff);
+    pixman_image_t *image;
+    int dst_xoff, dst_yoff;
 
-    if (!image)
+    if (!(image = image_from_pict (pPicture, FALSE, &dst_xoff, &dst_yoff)))
 	return;
     
-    pixman_add_triangles (image, x_off, y_off, ntri, (pixman_triangle_t *)tris);
+    pixman_add_triangles (image,
+			  dst_xoff + x_off, dst_yoff + y_off,
+			  ntri, (pixman_triangle_t *)tris);
 
     free_pixman_pict (pPicture, image);
 }
@@ -101,8 +105,6 @@ fbShapes (CompositeShapesFunc	composite,
 	  PictFormatPtr		maskFormat,
 	  int16_t		xSrc,
 	  int16_t		ySrc,
-	  int16_t		xDst,
-	  int16_t		yDst,
 	  int			nshapes,
 	  int			shape_size,
 	  const uint8_t *	shapes)
@@ -136,8 +138,8 @@ fbShapes (CompositeShapesFunc	composite,
 		composite (op, src, dst, format,
 			   xSrc + src_xoff,
 			   ySrc + src_yoff,
-			   xDst + dst_xoff,
-			   yDst + dst_yoff,
+			   dst_xoff,
+			   dst_yoff,
 			   1, shapes + i * shape_size);
 	    }
 	}
@@ -162,8 +164,8 @@ fbShapes (CompositeShapesFunc	composite,
 	    composite (op, src, dst, format,
 		       xSrc + src_xoff,
 		       ySrc + src_yoff,
-		       xDst + dst_xoff,
-		       yDst + dst_yoff,
+		       dst_xoff,
+		       dst_yoff,
 		       nshapes, shapes);
 	}
 
@@ -184,14 +186,12 @@ fbTrapezoids (CARD8	    op,
 	      int	    ntrap,
 	      xTrapezoid    *traps)
 {
-    int xDst, yDst;
-
-    xDst = traps[0].left.p1.x >> 16;
-    yDst = traps[0].left.p1.y >> 16;
+    xSrc -= (traps[0].left.p1.x >> 16);
+    ySrc -= (traps[0].left.p1.y >> 16);
     
     fbShapes ((CompositeShapesFunc)pixman_composite_trapezoids,
 	      op, pSrc, pDst, maskFormat,
-	      xSrc, ySrc, xDst, yDst,
+	      xSrc, ySrc,
 	      ntrap, sizeof (xTrapezoid), (const uint8_t *)traps);
 }
 
@@ -205,13 +205,11 @@ fbTriangles (CARD8	    op,
 	     int	    ntris,
 	     xTriangle    *tris)
 { 
-    int xDst, yDst;
-
-    xDst = tris[0].p1.x >> 16;
-    yDst = tris[0].p1.y >> 16;
+    xSrc -= (tris[0].p1.x >> 16);
+    ySrc -= (tris[0].p1.y >> 16);
     
     fbShapes ((CompositeShapesFunc)pixman_composite_triangles,
 	      op, pSrc, pDst, maskFormat,
-	      xSrc, ySrc, xDst, yDst,
+	      xSrc, ySrc,
 	      ntris, sizeof (xTriangle), (const uint8_t *)tris);
 }
commit 1b96a99d8edd9016bc4a35348f9d5ddb45832f14
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Thu Mar 10 08:52:41 2011 -0500

    fb: Call miCompositeSourceValidate() on the source in fbShapes()
    
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Soren Sandmann <ssp at redhat.com>

diff --git a/fb/fbtrap.c b/fb/fbtrap.c
index 612fae7..b5c5a61 100644
--- a/fb/fbtrap.c
+++ b/fb/fbtrap.c
@@ -111,6 +111,8 @@ fbShapes (CompositeShapesFunc	composite,
     int src_xoff, src_yoff;
     int dst_xoff, dst_yoff;
 
+    miCompositeSourceValidate (pSrc);
+
     src = image_from_pict (pSrc, FALSE, &src_xoff, &src_yoff);
     dst = image_from_pict (pDst, TRUE, &dst_xoff, &dst_yoff);
 
commit 04635069554859ec67003b89f56965421cba7f52
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Tue Mar 29 00:11:00 2011 -0400

    render: Remove unused TriStrip and TriFan typedefs
    
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Soren Sandmann <ssp at redhat.com>

diff --git a/render/picturestr.h b/render/picturestr.h
index c536c38..7b7f911 100644
--- a/render/picturestr.h
+++ b/render/picturestr.h
@@ -260,24 +260,6 @@ typedef void	(*TrianglesProcPtr)	    (CARD8	    op,
 					     int	    ntri,
 					     xTriangle	    *tris);
 
-typedef void	(*TriStripProcPtr)	    (CARD8	    op,
-					     PicturePtr	    pSrc,
-					     PicturePtr	    pDst,
-					     PictFormatPtr  maskFormat,
-					     INT16	    xSrc,
-					     INT16	    ySrc,
-					     int	    npoint,
-					     xPointFixed    *points);
-
-typedef void	(*TriFanProcPtr)	    (CARD8	    op,
-					     PicturePtr	    pSrc,
-					     PicturePtr	    pDst,
-					     PictFormatPtr  maskFormat,
-					     INT16	    xSrc,
-					     INT16	    ySrc,
-					     int	    npoint,
-					     xPointFixed    *points);
-
 typedef Bool	(*InitIndexedProcPtr)	    (ScreenPtr	    pScreen,
 					     PictFormatPtr  pFormat);
 
commit 2b0cabec620f3a2a5e431052441b092ef979bf94
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Tue Mar 29 00:07:44 2011 -0400

    render: Remove unused fields in the source picture structs
    
    The fields class, stopRange, colorTable and colorTableSize are not
    used by any current code.
    
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Soren Sandmann <ssp at redhat.com>

diff --git a/render/picture.c b/render/picture.c
index 058db2b..49e83ed 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -843,11 +843,6 @@ static void initGradient(SourcePictPtr pGradient, int stopCount,
         pGradient->gradient.stops[i].x = stopPoints[i];
         pGradient->gradient.stops[i].color = stopColors[i];
     }
-
-    pGradient->gradient.class	       = SourcePictClassUnknown;
-    pGradient->gradient.stopRange      = 0xffff;
-    pGradient->gradient.colorTable     = NULL;
-    pGradient->gradient.colorTableSize = 0;
 }
 
 static PicturePtr createSourcePicture(void)
@@ -922,8 +917,6 @@ CreateLinearGradientPicture (Picture pid, xPointFixed *p1, xPointFixed *p2,
     return pPicture;
 }
 
-#define FixedToDouble(x) ((x)/65536.)
-
 PicturePtr
 CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer,
                              xFixed innerRadius, xFixed outerRadius,
@@ -959,12 +952,6 @@ CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer
     radial->c2.x = outer->x;
     radial->c2.y = outer->y;
     radial->c2.radius = outerRadius;
-    radial->cdx = (radial->c2.x - radial->c1.x) / 65536.;
-    radial->cdy = (radial->c2.y - radial->c1.y) / 65536.;
-    radial->dr = (radial->c2.radius - radial->c1.radius) / 65536.;
-    radial->A = (  radial->cdx * radial->cdx
-		   + radial->cdy * radial->cdy
-		   - radial->dr  * radial->dr);
     
     initGradient(pPicture->pSourcePict, nStops, stops, colors, error);
     if (*error) {
diff --git a/render/picturestr.h b/render/picturestr.h
index 8b387f7..c536c38 100644
--- a/render/picturestr.h
+++ b/render/picturestr.h
@@ -65,13 +65,8 @@ typedef struct pixman_transform PictTransform, *PictTransformPtr;
 #define SourcePictTypeRadial 2
 #define SourcePictTypeConical 3
 
-#define SourcePictClassUnknown    0
-#define SourcePictClassHorizontal 1
-#define SourcePictClassVertical   2
-
 typedef struct _PictSolidFill {
     unsigned int type;
-    unsigned int class;
     CARD32 color;
 } PictSolidFill, *PictSolidFillPtr;
 
@@ -82,22 +77,14 @@ typedef struct _PictGradientStop {
 
 typedef struct _PictGradient {
     unsigned int type;
-    unsigned int class;
     int nstops;
     PictGradientStopPtr stops;
-    int stopRange;
-    CARD32 *colorTable;
-    int colorTableSize;
 } PictGradient, *PictGradientPtr;
 
 typedef struct _PictLinearGradient {
     unsigned int type;
-    unsigned int class;
     int nstops;
     PictGradientStopPtr stops;
-    int stopRange;
-    CARD32 *colorTable;
-    int colorTableSize;
     xPointFixed p1;
     xPointFixed p2;
 } PictLinearGradient, *PictLinearGradientPtr;
@@ -110,28 +97,16 @@ typedef struct _PictCircle {
 
 typedef struct _PictRadialGradient {
     unsigned int type;
-    unsigned int class;
     int nstops;
     PictGradientStopPtr stops;
-    int stopRange;
-    CARD32 *colorTable;
-    int colorTableSize;
     PictCircle c1;
     PictCircle c2;
-    double cdx;
-    double cdy;
-    double dr;
-    double A;
 } PictRadialGradient, *PictRadialGradientPtr;
 
 typedef struct _PictConicalGradient {
     unsigned int type;
-    unsigned int class;
     int nstops;
     PictGradientStopPtr stops;
-    int stopRange;
-    CARD32 *colorTable;
-    int colorTableSize;
     xPointFixed center;
     xFixed angle;
 } PictConicalGradient, *PictConicalGradientPtr;
commit b0d84f94393edab395d65d2b2cb983fc9fec3d36
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Mon Mar 28 20:59:34 2011 -0400

    render: Delete PictureGradientColor()
    
    PictureGradientColor(), INTERPOLATE_PIXEL_256() and premultiply() are
    not used by anything.
    
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Soren Sandmann <ssp at redhat.com>

diff --git a/render/picture.c b/render/picture.c
index e7e1f2b..058db2b 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -811,51 +811,6 @@ static CARD32 xRenderColorToCard32(xRenderColor c)
         (c.blue >> 8);
 }
 
-static unsigned int premultiply(unsigned int x)
-{
-    unsigned int a = x >> 24;
-    unsigned int t = (x & 0xff00ff) * a + 0x800080;
-    t = (t + ((t >> 8) & 0xff00ff)) >> 8;
-    t &= 0xff00ff;
-
-    x = ((x >> 8) & 0xff) * a + 0x80;
-    x = (x + ((x >> 8) & 0xff));
-    x &= 0xff00;
-    x |= t | (a << 24);
-    return x;
-}
-
-static unsigned int INTERPOLATE_PIXEL_256(unsigned int x, unsigned int a,
-                                          unsigned int y, unsigned int b)
-{
-    CARD32 t = (x & 0xff00ff) * a + (y & 0xff00ff) * b;
-    t >>= 8;
-    t &= 0xff00ff;
-
-    x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b;
-    x &= 0xff00ff00;
-    x |= t;
-    return x;
-}
-
-CARD32
-PictureGradientColor (PictGradientStopPtr stop1,
-		      PictGradientStopPtr stop2,
-		      CARD32	          x)
-{
-     CARD32 current_color, next_color;
-     int	   dist, idist;
-
-     current_color = xRenderColorToCard32 (stop1->color);
-     next_color    = xRenderColorToCard32 (stop2->color);
-
-     dist  = (int) (256 * (x - stop1->x) / (stop2->x - stop1->x));
-     idist = 256 - dist;
-
-     return premultiply (INTERPOLATE_PIXEL_256 (current_color, idist,
-					       next_color, dist));
-}
-
 static void initGradient(SourcePictPtr pGradient, int stopCount,
                          xFixed *stopPoints, xRenderColor *stopColors, int *error)
 {
diff --git a/render/picturestr.h b/render/picturestr.h
index 7c7edb1..8b387f7 100644
--- a/render/picturestr.h
+++ b/render/picturestr.h
@@ -614,11 +614,6 @@ CompositeTriFan (CARD8		op,
 		 int		npoints,
 		 xPointFixed	*points);
 
-extern _X_EXPORT CARD32
-PictureGradientColor (PictGradientStopPtr stop1,
-		      PictGradientStopPtr stop2,
-		      CARD32	          x);
-
 extern _X_EXPORT void RenderExtensionInit (void);
 
 Bool
commit 61a92a78cd49969f74a046fa26c3199e06365814
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Tue Mar 29 13:06:36 2011 -0400

    Add RegionInitBoxes(), and fix some buggy callers of RegionInit().
    
    The interface to RegionInit():
    
        RegionInit (RegionPtr pReg, BoxPtr rect, int size);
    
    is very confusing because it doesn't take a list of boxes, it takes
    *one* box, but if that box is NULL, it initializes an empty region
    with 'size' rectangles preallocated.
    
    Most callers of this function were correctly passing either NULL or
    just one box, but there were three confused cases, where the code
    seems to expect a region to be created from a list of boxes.
    
    This patch adds a new function RegionInitBoxes() and fixes those
    instances to call that instead.
    
    And yes, the pixman function to initialize a region from a list of
    boxes is called init_rects() because pixman is also awesome.
    
    V2: Make RegionInitBoxes() return a Bool indicating whether the call
        succeeded, and fix the callers to check this return value.
    
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Søren Sandmann <ssp at redhat.com>

diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index bd533c4..078b91c 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -127,11 +127,10 @@ ExaCheckCopyNtoN (DrawablePtr pSrc, DrawablePtr pDst,  GCPtr pGC,
     EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrc, pDst,
 		  exaDrawableLocation(pSrc), exaDrawableLocation(pDst)));
 
-    if (pExaScr->prepare_access_reg) {
+    if (pExaScr->prepare_access_reg && RegionInitBoxes(&reg, pbox, nbox)) {
 	PixmapPtr pPixmap = exaGetDrawablePixmap(pSrc);
 
 	exaGetDrawableDeltas(pSrc, pPixmap, &xoff, &yoff);
-	RegionInit(&reg, pbox, nbox);
 	RegionTranslate(&reg, xoff + dx, yoff + dy);
 	pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_SRC, &reg);
 	RegionUninit(&reg);
@@ -140,11 +139,11 @@ ExaCheckCopyNtoN (DrawablePtr pSrc, DrawablePtr pDst,  GCPtr pGC,
 
     if (pExaScr->prepare_access_reg &&
 	!exaGCReadsDestination(pDst, pGC->planemask, pGC->fillStyle,
-			       pGC->alu, pGC->clientClipType)) {
+			       pGC->alu, pGC->clientClipType) &&
+	RegionInitBoxes (&reg, pbox, nbox)) {
 	PixmapPtr pPixmap = exaGetDrawablePixmap(pDst);
 
 	exaGetDrawableDeltas(pSrc, pPixmap, &xoff, &yoff);
-	RegionInit(&reg, pbox, nbox);
 	RegionTranslate(&reg, xoff, yoff);
 	pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_DEST, &reg);
 	RegionUninit(&reg);
diff --git a/glx/glxdri.c b/glx/glxdri.c
index c87ac9a..244eac6 100644
--- a/glx/glxdri.c
+++ b/glx/glxdri.c
@@ -817,10 +817,19 @@ static void __glXReportDamage(__DRIdrawable *driDraw,
 
     __glXenterServer(GL_FALSE);
 
-    RegionInit(&region, (BoxPtr) rects, num_rects);
-    RegionTranslate(&region, pDraw->x, pDraw->y);
-    DamageDamageRegion(pDraw, &region);
-    RegionUninit(&region);
+    if (RegionInitBoxes(&region, (BoxPtr) rects, num_rects)) {
+	RegionTranslate(&region, pDraw->x, pDraw->y);
+	DamageDamageRegion(pDraw, &region);
+	RegionUninit(&region);
+    }
+    else {
+	while (num_rects--) {
+	    RegionInit (&region, (BoxPtr) rects++, 1);
+	    RegionTranslate(&region, pDraw->x, pDraw->y);
+	    DamageDamageRegion(pDraw, &region);
+	    RegionUninit(&region);
+	}
+    }
 
     __glXleaveServer(GL_FALSE);
 }
diff --git a/include/regionstr.h b/include/regionstr.h
index 3759fe1..3dfef5c 100644
--- a/include/regionstr.h
+++ b/include/regionstr.h
@@ -132,6 +132,11 @@ static inline void RegionInit(RegionPtr _pReg, BoxPtr _rect, int _size)
     }
 }
 
+static inline Bool RegionInitBoxes(RegionPtr pReg, BoxPtr boxes, int nBoxes)
+{
+    return pixman_region_init_rects (pReg, boxes, nBoxes);
+}
+
 static inline void RegionUninit(RegionPtr _pReg)
 {
     if ((_pReg)->data && (_pReg)->data->size) {
commit c7bce22b58530239e583d91ae56312bad1630da4
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Mon Mar 28 11:38:11 2011 -0400

    Track damage for fbTrapezoids() and fbTriangles().
    
    These calls no longer go through the CompositePicture() hook, so
    damage was no longer generated for them. This patch simply damages the
    entire destination clip region.
    
    It would be possible to generate tighter damage for certain operators
    such as Over and Add, where blank source pixels have no effect on the
    destination, but given that virtually all trapezoid rendering takes
    place on pixmaps, it's unlikely that anybody would actually benefit
    from this optimization, and the miTrapezoidBounds function did
    sometimes show up on profiles, probably because it does several
    divisions per trapezoid.
    
    V2: Call DamageRegionProcessPending() - pointed out by Michel Dänzer.
    V3: Call DamageRegionProcessPending() *after* rendering -
            pointed out by Maarten Maathuis
    
    Reviewed-by: Michel Dänzer <daenzer at vmware.com>
    Signed-off-by: Søren Sandmann <ssp at redhat.com>

diff --git a/fb/fbtrap.c b/fb/fbtrap.c
index 2554fcc..612fae7 100644
--- a/fb/fbtrap.c
+++ b/fb/fbtrap.c
@@ -29,6 +29,7 @@
 #include "picturestr.h"
 #include "mipict.h"
 #include "fbpict.h"
+#include "damage.h"
 
 void
 fbAddTraps (PicturePtr	pPicture,
@@ -117,6 +118,8 @@ fbShapes (CompositeShapesFunc	composite,
     {
 	pixman_format_code_t format;
 
+	DamageRegionAppend (pDst->pDrawable, pDst->pCompositeClip);
+
 	if (!maskFormat)
 	{
 	    int i;
@@ -161,6 +164,8 @@ fbShapes (CompositeShapesFunc	composite,
 		       yDst + dst_yoff,
 		       nshapes, shapes);
 	}
+
+	DamageRegionProcessPending (pDst->pDrawable);
     }
 
     free_pixman_pict (pSrc, src);


More information about the Xquartz-changes mailing list