From aa85f33c313a64fa07df93791cf929116a209912 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 3 Dec 2012 15:26:27 +0100 Subject: [PATCH] winex11: Store a copy of the surface region. --- dlls/winex11.drv/bitblt.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 23837de1acc..c5a6bd06bf5 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1565,6 +1565,7 @@ struct x11drv_window_surface BOOL byteswap; BOOL is_argb; COLORREF color_key; + HRGN region; void *bits; #ifdef HAVE_LIBXXSHM XShmSegmentInfo shminfo; @@ -1857,16 +1858,25 @@ static void x11drv_surface_set_region( struct window_surface *window_surface, HR TRACE( "updating surface %p with %p\n", surface, region ); + window_surface->funcs->lock( window_surface ); if (!region) { + if (surface->region) DeleteObject( surface->region ); + surface->region = 0; XSetClipMask( gdi_display, surface->gc, None ); } - else if ((data = X11DRV_GetRegionData( region, 0 ))) + else { - XSetClipRectangles( gdi_display, surface->gc, 0, 0, - (XRectangle *)data->Buffer, data->rdh.nCount, YXBanded ); - HeapFree( GetProcessHeap(), 0, data ); + if (!surface->region) surface->region = CreateRectRgn( 0, 0, 0, 0 ); + CombineRgn( surface->region, region, 0, RGN_COPY ); + if ((data = X11DRV_GetRegionData( surface->region, 0 ))) + { + XSetClipRectangles( gdi_display, surface->gc, 0, 0, + (XRectangle *)data->Buffer, data->rdh.nCount, YXBanded ); + HeapFree( GetProcessHeap(), 0, data ); + } } + window_surface->funcs->unlock( window_surface ); } /*********************************************************************** @@ -1955,6 +1965,7 @@ static void x11drv_surface_destroy( struct window_surface *window_surface ) } surface->crit.DebugInfo->Spare[0] = 0; DeleteCriticalSection( &surface->crit ); + if (surface->region) DeleteObject( surface->region ); HeapFree( GetProcessHeap(), 0, surface ); }