winex11.drv: Delete the tile pixmap whenever the drawable is changed.

This commit is contained in:
Huw Davies 2007-03-29 12:10:24 +01:00 committed by Alexandre Julliard
parent 232c16fadb
commit 13c0c0d047
1 changed files with 21 additions and 19 deletions

View File

@ -571,18 +571,7 @@ BOOL X11DRV_XRender_SelectFont(X11DRV_PDEVICE *physDev, HFONT hfont)
*/ */
void X11DRV_XRender_DeleteDC(X11DRV_PDEVICE *physDev) void X11DRV_XRender_DeleteDC(X11DRV_PDEVICE *physDev)
{ {
wine_tsx11_lock(); X11DRV_XRender_UpdateDrawable(physDev);
if(physDev->xrender->tile_pict)
pXRenderFreePicture(gdi_display, physDev->xrender->tile_pict);
if(physDev->xrender->tile_xpm)
XFreePixmap(gdi_display, physDev->xrender->tile_xpm);
if(physDev->xrender->pict) {
TRACE("freeing pict = %lx dc = %p\n", physDev->xrender->pict, physDev->hdc);
pXRenderFreePicture(gdi_display, physDev->xrender->pict);
}
wine_tsx11_unlock();
EnterCriticalSection(&xrender_cs); EnterCriticalSection(&xrender_cs);
if(physDev->xrender->cache_index != -1) if(physDev->xrender->cache_index != -1)
@ -598,19 +587,32 @@ void X11DRV_XRender_DeleteDC(X11DRV_PDEVICE *physDev)
* X11DRV_XRender_UpdateDrawable * X11DRV_XRender_UpdateDrawable
* *
* This gets called from X11DRV_SetDrawable and X11DRV_SelectBitmap. * This gets called from X11DRV_SetDrawable and X11DRV_SelectBitmap.
* It deletes the pict when the drawable changes. * It deletes the pict and tile when the drawable changes.
*/ */
void X11DRV_XRender_UpdateDrawable(X11DRV_PDEVICE *physDev) void X11DRV_XRender_UpdateDrawable(X11DRV_PDEVICE *physDev)
{ {
if(physDev->xrender->pict) {
TRACE("freeing pict %08lx from dc %p drawable %08lx\n", physDev->xrender->pict,
physDev->hdc, physDev->drawable);
wine_tsx11_lock(); wine_tsx11_lock();
if(physDev->xrender->pict)
{
TRACE("freeing pict = %lx dc = %p\n", physDev->xrender->pict, physDev->hdc);
XFlush(gdi_display); XFlush(gdi_display);
pXRenderFreePicture(gdi_display, physDev->xrender->pict); pXRenderFreePicture(gdi_display, physDev->xrender->pict);
wine_tsx11_unlock();
}
physDev->xrender->pict = 0; physDev->xrender->pict = 0;
}
if(physDev->xrender->tile_pict)
{
pXRenderFreePicture(gdi_display, physDev->xrender->tile_pict);
physDev->xrender->tile_pict = 0;
}
if(physDev->xrender->tile_xpm)
{
XFreePixmap(gdi_display, physDev->xrender->tile_xpm);
physDev->xrender->tile_xpm = 0;
}
wine_tsx11_unlock();
return; return;
} }