From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/bitblt.c | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-)
diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 4fce6cbd363..384ee3f0f2e 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1841,13 +1841,11 @@ static BOOL destroy_shm_image( XImage *image, x11drv_xshm_info_t *shminfo ) return TRUE; }
-static BOOL put_shm_image( XImage *image, x11drv_xshm_info_t *shminfo, Window window, - GC gc, const RECT *rect, const RECT *dirty ) +static BOOL put_shm_image( XImage *image, x11drv_xshm_info_t *shminfo, Window window, GC gc, const RECT *dirty ) { if (shminfo->shmid == -1) return FALSE;
- XShmPutImage( gdi_display, window, gc, image, dirty->left, - dirty->top, rect->left + dirty->left, rect->top + dirty->top, + XShmPutImage( gdi_display, window, gc, image, dirty->left, dirty->top, dirty->left, dirty->top, dirty->right - dirty->left, dirty->bottom - dirty->top, False );
return TRUE; @@ -1866,8 +1864,7 @@ static BOOL destroy_shm_image( XImage *image, x11drv_xshm_info_t *shminfo ) return FALSE; }
-static BOOL put_shm_image( XImage *image, x11drv_xshm_info_t *shminfo, Window window, - GC gc, const RECT *rect, const RECT *dirty ) +static BOOL put_shm_image( XImage *image, x11drv_xshm_info_t *shminfo, Window window, GC gc, const RECT *dirty ) { return FALSE; } @@ -2020,10 +2017,9 @@ static BOOL x11drv_surface_flush( struct window_surface *window_surface, const R ptr[x] |= surface->alpha_bits; }
- if (!put_shm_image( ximage, &surface->image->shminfo, surface->window, surface->gc, rect, dirty )) - XPutImage( gdi_display, surface->window, surface->gc, ximage, dirty->left, - dirty->top, rect->left + dirty->left, rect->top + dirty->top, - dirty->right - dirty->left, dirty->bottom - dirty->top ); + if (!put_shm_image( ximage, &surface->image->shminfo, surface->window, surface->gc, dirty )) + XPutImage( gdi_display, surface->window, surface->gc, ximage, dirty->left, dirty->top, + dirty->left, dirty->top, dirty->right - dirty->left, dirty->bottom - dirty->top );
XFlush( gdi_display );
@@ -2184,17 +2180,13 @@ HRGN expose_surface( struct window_surface *window_surface, const RECT *rect ) }
-static BOOL get_surface_rect( const RECT *visible_rect, RECT *surface_rect ) +static RECT get_surface_rect( RECT rect ) { - *surface_rect = NtUserGetVirtualScreenRect(); - - if (!intersect_rect( surface_rect, surface_rect, visible_rect )) return FALSE; - OffsetRect( surface_rect, -visible_rect->left, -visible_rect->top ); - surface_rect->left &= ~31; - surface_rect->top &= ~31; - surface_rect->right = max( surface_rect->left + 32, (surface_rect->right + 31) & ~31 ); - surface_rect->bottom = max( surface_rect->top + 32, (surface_rect->bottom + 31) & ~31 ); - return TRUE; + OffsetRect( &rect, -rect.left, -rect.top ); + /* round surface size to avoid re-creating them on every resize */ + rect.right = max( rect.left + 32, (rect.right + 31) & ~31 ); + rect.bottom = max( rect.top + 32, (rect.bottom + 31) & ~31 ); + return rect; }
@@ -2221,7 +2213,7 @@ BOOL X11DRV_CreateWindowSurface( HWND hwnd, UINT swp_flags, const RECT *visible_ if (data->client_window) goto done; /* draw directly to the window */ if (!client_side_graphics && !layered) goto done; /* draw directly to the window */
- if (!get_surface_rect( visible_rect, &surface_rect )) goto done; + surface_rect = get_surface_rect( *visible_rect ); if (data->surface) { if (EqualRect( &data->surface->rect, &surface_rect ))