Commit 66add27b authored by Alexandre Julliard's avatar Alexandre Julliard

Store DIB section information directly in the phys bitmap structure

and get rid of the X11DRV_DIBSECTION structure. Get rid of the unused AuxMod DIB state.
parent 9b626b7b
......@@ -424,7 +424,11 @@ BOOL X11DRV_DeleteBitmap( HBITMAP hbitmap )
if (physBitmap)
{
if (physBitmap->dib) X11DRV_DIB_DeleteDIBSection( physBitmap );
DIBSECTION dib;
if (GetObjectW( hbitmap, sizeof(dib), &dib ) == sizeof(dib))
X11DRV_DIB_DeleteDIBSection( physBitmap, &dib );
wine_tsx11_lock();
if (physBitmap->pixmap) XFreePixmap( gdi_display, physBitmap->pixmap );
wine_tsx11_unlock();
......@@ -468,12 +472,11 @@ X_PHYSBITMAP *X11DRV_init_phys_bitmap( HBITMAP hbitmap )
{
if (!(ret = bmp->physBitmap))
{
if ((ret = HeapAlloc( GetProcessHeap(), 0, sizeof(*ret) )) != NULL)
if ((ret = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ret) )) != NULL)
{
ret->hbitmap = hbitmap;
ret->pixmap = 0;
ret->pixmap_depth = bmp->bitmap.bmBitsPixel;
ret->dib = NULL;
bmp->physBitmap = ret;
}
}
......
......@@ -84,7 +84,16 @@ typedef struct
HBITMAP hbitmap;
Pixmap pixmap;
int pixmap_depth;
struct _X11DRV_DIBSECTION *dib;
/* the following fields are only used for DIB section bitmaps */
int status, p_status; /* mapping status */
XImage *image; /* cached XImage */
int *colorMap; /* color map info */
int nColorMap;
RGBQUAD *colorTable; /* original dib color table converted to rgb values if usage was DIB_PAL_COLORS */
CRITICAL_SECTION lock; /* GDI access lock */
#ifdef HAVE_LIBXXSHM
XShmSegmentInfo shminfo; /* shared memory segment info */
#endif
} X_PHYSBITMAP;
/* X physical font */
......@@ -261,7 +270,7 @@ extern void X11DRV_XDND_LeaveEvent( HWND hWnd, XClientMessageEvent *event );
/* exported dib functions for now */
/* DIB Section sync state */
enum { DIB_Status_None, DIB_Status_InSync, DIB_Status_GdiMod, DIB_Status_AppMod, DIB_Status_AuxMod };
enum { DIB_Status_None, DIB_Status_InSync, DIB_Status_GdiMod, DIB_Status_AppMod };
typedef struct {
void (*Convert_5x5_asis)(int width, int height,
......@@ -402,7 +411,7 @@ extern void X11DRV_UnlockDIBSection(X11DRV_PDEVICE *physDev,BOOL);
extern HBITMAP X11DRV_DIB_CreateDIBSection(X11DRV_PDEVICE *physDev, const BITMAPINFO *bmi, UINT usage,
VOID **bits, HANDLE section, DWORD offset, DWORD ovr_pitch);
extern void X11DRV_DIB_DeleteDIBSection(X_PHYSBITMAP *physBitmap);
extern void X11DRV_DIB_DeleteDIBSection(X_PHYSBITMAP *physBitmap, DIBSECTION *dib);
void X11DRV_DIB_CopyDIBSection(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDevDst,
DWORD xSrc, DWORD ySrc, DWORD xDest, DWORD yDest,
DWORD width, DWORD height);
......
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