Store the handle to the stock bitmap when the first DC is created to
avoid exporting the DEFAULT_BITMAP define.
This commit is contained in:
parent
c91df67f11
commit
3a522f3d71
|
@ -28,6 +28,9 @@
|
|||
#define METAFILE_MEMORY 1
|
||||
#define METAFILE_DISK 2
|
||||
|
||||
/* extra stock object: default 1x1 bitmap for memory DCs */
|
||||
#define DEFAULT_BITMAP (STOCK_LAST+1)
|
||||
|
||||
struct gdi_obj_funcs
|
||||
{
|
||||
HGDIOBJ (*pSelectObject)( HGDIOBJ handle, void *obj, HDC hdc );
|
||||
|
|
|
@ -34,7 +34,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(x11drv);
|
|||
|
||||
/* GCs used for B&W and color bitmap operations */
|
||||
GC BITMAP_monoGC = 0, BITMAP_colorGC = 0;
|
||||
Pixmap BITMAP_stock_pixmap; /* pixmap for the default stock bitmap */
|
||||
HBITMAP BITMAP_stock_bitmap = 0; /* default stock bitmap */
|
||||
Pixmap BITMAP_stock_pixmap = 0; /* pixmap for the default stock bitmap */
|
||||
|
||||
/***********************************************************************
|
||||
* X11DRV_BITMAP_Init
|
||||
|
@ -76,7 +77,7 @@ HBITMAP X11DRV_SelectBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap )
|
|||
if(physDev->xrender)
|
||||
X11DRV_XRender_UpdateDrawable( physDev );
|
||||
|
||||
if (hbitmap == GetStockObject(DEFAULT_BITMAP))
|
||||
if (hbitmap == BITMAP_stock_bitmap)
|
||||
physDev->drawable = BITMAP_stock_pixmap;
|
||||
else
|
||||
physDev->drawable = (Pixmap)bmp->physBitmap;
|
||||
|
@ -128,7 +129,7 @@ BOOL X11DRV_CreateBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap )
|
|||
GDI_ReleaseObj( hbitmap );
|
||||
return FALSE;
|
||||
}
|
||||
if (hbitmap == GetStockObject(DEFAULT_BITMAP))
|
||||
if (hbitmap == BITMAP_stock_bitmap)
|
||||
{
|
||||
ERR( "called for stock bitmap, please report\n" );
|
||||
GDI_ReleaseObj( hbitmap );
|
||||
|
|
|
@ -139,6 +139,7 @@ BOOL X11DRV_CreateDC( HDC hdc, X11DRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR de
|
|||
|
||||
if (GetObjectType( hdc ) == OBJ_MEMDC)
|
||||
{
|
||||
if (!BITMAP_stock_bitmap) BITMAP_stock_bitmap = GetCurrentObject( hdc, OBJ_BITMAP );
|
||||
physDev->drawable = BITMAP_stock_pixmap;
|
||||
physDev->depth = 1;
|
||||
}
|
||||
|
|
|
@ -111,6 +111,7 @@ typedef struct
|
|||
|
||||
/* GCs used for B&W and color bitmap operations */
|
||||
extern GC BITMAP_monoGC, BITMAP_colorGC;
|
||||
extern HBITMAP BITMAP_stock_bitmap; /* default stock bitmap */
|
||||
extern Pixmap BITMAP_stock_pixmap; /* pixmap for the default stock bitmap */
|
||||
|
||||
#define BITMAP_GC(bmp) \
|
||||
|
|
|
@ -65,9 +65,6 @@ typedef struct tagGDIOBJHDR
|
|||
struct hdc_list *hdcs;
|
||||
} GDIOBJHDR;
|
||||
|
||||
/* extra stock object: default 1x1 bitmap for memory DCs */
|
||||
#define DEFAULT_BITMAP (STOCK_LAST+1)
|
||||
|
||||
/* bitmap object */
|
||||
|
||||
typedef struct tagBITMAPOBJ
|
||||
|
|
Loading…
Reference in New Issue