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

This commit is contained in:
Huw Davies 2011-07-15 13:05:25 +01:00 committed by Alexandre Julliard
parent 678400b887
commit 56d7e2add9
3 changed files with 6 additions and 4 deletions

View File

@ -1988,9 +1988,11 @@ DWORD X11DRV_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info,
GetObjectW( hbitmap, sizeof(bm), &bm ); GetObjectW( hbitmap, sizeof(bm), &bm );
width = min( width, bm.bmWidth - x ); width = min( width, bm.bmWidth - x );
height = min( height, bm.bmHeight - y ); height = min( height, bm.bmHeight - y );
X11DRV_DIB_Lock( bitmap, DIB_Status_GdiMod );
wine_tsx11_lock(); wine_tsx11_lock();
image = XGetImage( gdi_display, bitmap->pixmap, x, y, width, height, AllPlanes, ZPixmap ); image = XGetImage( gdi_display, bitmap->pixmap, x, y, width, height, AllPlanes, ZPixmap );
wine_tsx11_unlock(); wine_tsx11_unlock();
X11DRV_DIB_Unlock( bitmap, TRUE );
} }
else if (GetObjectType( dev->hdc ) == OBJ_MEMDC) else if (GetObjectType( dev->hdc ) == OBJ_MEMDC)
{ {

View File

@ -101,8 +101,6 @@ enum Rle_EscapeCodes
static INT X11DRV_DIB_Coerce(X_PHYSBITMAP *,INT); 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 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 * 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; INT ret = DIB_Status_None;
@ -4592,7 +4590,7 @@ static INT X11DRV_DIB_Lock(X_PHYSBITMAP *physBitmap, INT req)
/*********************************************************************** /***********************************************************************
* X11DRV_DIB_Unlock * 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 */ if (!physBitmap->image) return; /* not a DIB section */
switch (physBitmap->status) switch (physBitmap->status)

View File

@ -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_CoerceDIBSection(X11DRV_PDEVICE *physDev,INT) DECLSPEC_HIDDEN;
extern INT X11DRV_LockDIBSection(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 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_DeleteDIBSection(X_PHYSBITMAP *physBitmap, DIBSECTION *dib) DECLSPEC_HIDDEN;
extern void X11DRV_DIB_CopyDIBSection(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDevDst, extern void X11DRV_DIB_CopyDIBSection(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDevDst,