Commit 56d7e2ad authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

winex11: Sync a dib-section before accessing the image bits.

parent 678400b8
......@@ -1988,9 +1988,11 @@ DWORD X11DRV_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info,
GetObjectW( hbitmap, sizeof(bm), &bm );
width = min( width, bm.bmWidth - x );
height = min( height, bm.bmHeight - y );
X11DRV_DIB_Lock( bitmap, DIB_Status_GdiMod );
wine_tsx11_lock();
image = XGetImage( gdi_display, bitmap->pixmap, x, y, width, height, AllPlanes, ZPixmap );
wine_tsx11_unlock();
X11DRV_DIB_Unlock( bitmap, TRUE );
}
else if (GetObjectType( dev->hdc ) == OBJ_MEMDC)
{
......
......@@ -101,8 +101,6 @@ enum Rle_EscapeCodes
static INT X11DRV_DIB_Coerce(X_PHYSBITMAP *,INT);
static INT X11DRV_DIB_Lock(X_PHYSBITMAP *,INT);
static void X11DRV_DIB_Unlock(X_PHYSBITMAP *,BOOL);
/*
Some of the following helper functions are duplicated in
......@@ -4576,7 +4574,7 @@ static INT X11DRV_DIB_Coerce(X_PHYSBITMAP *physBitmap, INT req)
/***********************************************************************
* X11DRV_DIB_Lock
*/
static INT X11DRV_DIB_Lock(X_PHYSBITMAP *physBitmap, INT req)
INT X11DRV_DIB_Lock(X_PHYSBITMAP *physBitmap, INT req)
{
INT ret = DIB_Status_None;
......@@ -4592,7 +4590,7 @@ static INT X11DRV_DIB_Lock(X_PHYSBITMAP *physBitmap, INT req)
/***********************************************************************
* X11DRV_DIB_Unlock
*/
static void X11DRV_DIB_Unlock(X_PHYSBITMAP *physBitmap, BOOL commit)
void X11DRV_DIB_Unlock(X_PHYSBITMAP *physBitmap, BOOL commit)
{
if (!physBitmap->image) return; /* not a DIB section */
switch (physBitmap->status)
......
......@@ -481,6 +481,8 @@ extern INT X11DRV_DIB_MaskToShift(DWORD mask) DECLSPEC_HIDDEN;
extern INT X11DRV_CoerceDIBSection(X11DRV_PDEVICE *physDev,INT) DECLSPEC_HIDDEN;
extern INT X11DRV_LockDIBSection(X11DRV_PDEVICE *physDev,INT) DECLSPEC_HIDDEN;
extern void X11DRV_UnlockDIBSection(X11DRV_PDEVICE *physDev,BOOL) DECLSPEC_HIDDEN;
extern INT X11DRV_DIB_Lock(X_PHYSBITMAP *,INT) DECLSPEC_HIDDEN;
extern void X11DRV_DIB_Unlock(X_PHYSBITMAP *,BOOL) DECLSPEC_HIDDEN;
extern void X11DRV_DIB_DeleteDIBSection(X_PHYSBITMAP *physBitmap, DIBSECTION *dib) DECLSPEC_HIDDEN;
extern void X11DRV_DIB_CopyDIBSection(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDevDst,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment