Commit 87f87bf6 authored by Huw D M Davies's avatar Huw D M Davies Committed by Alexandre Julliard

Added pBitmapBits and pCreateBitmap to the GDI function table and

moved the X11 dependent stuff out of objects/bitmap.c into x11drv.
parent 309dbe10
......@@ -17,7 +17,9 @@ static const DC_FUNCTIONS MFDRV_Funcs =
{
MFDRV_Arc, /* pArc */
MFDRV_BitBlt, /* pBitBlt */
NULL, /* pBitmapBits */
MFDRV_Chord, /* pChord */
NULL, /* pCreateBitmap */
NULL, /* no implementation */ /* pCreateDC */
NULL, /* no implementation */ /* pDeleteDC */
NULL, /* pDeleteObject */
......
......@@ -22,7 +22,9 @@ static const DC_FUNCTIONS PSDRV_Funcs =
{
PSDRV_Arc, /* pArc */
NULL, /* pBitBlt */
NULL, /* pBitmapBits */
PSDRV_Chord, /* pChord */
NULL, /* pCreateBitmap */
PSDRV_CreateDC, /* pCreateDC */
PSDRV_DeleteDC, /* pDeleteDC */
NULL, /* pDeleteObject */
......
......@@ -51,7 +51,9 @@ static const DC_FUNCTIONS WIN16DRV_Funcs =
{
NULL, /* pArc */
NULL, /* pBitBlt */
NULL, /* pBitmapBits */
NULL, /* pChord */
NULL, /* pCreateBitmap */
WIN16DRV_CreateDC, /* pCreateDC */
NULL, /* pDeleteDC */
NULL, /* pDeleteObject */
......
......@@ -163,22 +163,34 @@ static void BRUSH_SelectSolidBrush( DC *dc, COLORREF color )
*/
static BOOL32 BRUSH_SelectPatternBrush( DC * dc, HBITMAP32 hbitmap )
{
X11DRV_PHYSBITMAP *pbitmap;
BITMAPOBJ * bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC );
if (!bmp) return FALSE;
if(!bmp->DDBitmap)
if(!X11DRV_CreateBitmap(hbitmap))
return 0;
if(bmp->DDBitmap->funcs != dc->funcs) {
WARN(bitmap, "Trying to select non-X11 DDB into an X11 dc\n");
return 0;
}
pbitmap = bmp->DDBitmap->physBitmap;
if ((dc->w.bitsPerPixel == 1) && (bmp->bitmap.bmBitsPixel != 1))
{
/* Special case: a color pattern on a monochrome DC */
dc->u.x.brush.pixmap = TSXCreatePixmap( display, rootWindow, 8, 8, 1 );
/* FIXME: should probably convert to monochrome instead */
TSXCopyPlane( display, bmp->pixmap, dc->u.x.brush.pixmap,
TSXCopyPlane( display, pbitmap->pixmap, dc->u.x.brush.pixmap,
BITMAP_monoGC, 0, 0, 8, 8, 0, 0, 1 );
}
else
{
dc->u.x.brush.pixmap = TSXCreatePixmap( display, rootWindow,
8, 8, bmp->bitmap.bmBitsPixel );
TSXCopyArea( display, bmp->pixmap, dc->u.x.brush.pixmap,
TSXCopyArea( display, pbitmap->pixmap, dc->u.x.brush.pixmap,
BITMAP_GC(bmp), 0, 0, 8, 8, 0, 0 );
}
......
......@@ -21,10 +21,12 @@ static const DC_FUNCTIONS X11DRV_Funcs =
{
X11DRV_Arc, /* pArc */
X11DRV_BitBlt, /* pBitBlt */
X11DRV_BitmapBits, /* pBitmapBits */
X11DRV_Chord, /* pChord */
X11DRV_CreateBitmap, /* pCreateBitmap */
X11DRV_CreateDC, /* pCreateDC */
X11DRV_DeleteDC, /* pDeleteDC */
NULL, /* pDeleteObject */
X11DRV_DeleteObject, /* pDeleteObject */
X11DRV_Ellipse, /* pEllipse */
X11DRV_EnumDeviceFonts, /* pEnumDeviceFonts */
X11DRV_Escape, /* pEscape */
......@@ -173,10 +175,13 @@ static BOOL32 X11DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
dc->w.devCaps = &X11DRV_DevCaps;
if (dc->w.flags & DC_MEMORY)
{
X11DRV_PHYSBITMAP *pbitmap;
BITMAPOBJ *bmp = (BITMAPOBJ *) GDI_GetObjPtr( dc->w.hBitmap,
BITMAP_MAGIC );
physDev->drawable = bmp->pixmap;
physDev->gc = TSXCreateGC( display, physDev->drawable, 0, NULL );
X11DRV_CreateBitmap( dc->w.hBitmap );
pbitmap = bmp->DDBitmap->physBitmap;
physDev->drawable = pbitmap->pixmap;
physDev->gc = TSXCreateGC(display, physDev->drawable, 0, NULL);
dc->w.bitsPerPixel = bmp->bitmap.bmBitsPixel;
dc->w.totalExtent.left = 0;
......
......@@ -21,6 +21,7 @@ extern HFONT32 X11DRV_FONT_SelectObject( DC * dc, HFONT32 hfont,
FONTOBJ * font );
extern HPEN32 X11DRV_PEN_SelectObject( DC * dc, HPEN32 hpen, PENOBJ * pen );
extern BOOL32 X11DRV_BITMAP_DeleteObject( HBITMAP32 hbitmap, BITMAPOBJ *bmp );
/***********************************************************************
* X11DRV_SelectObject
......@@ -54,3 +55,28 @@ HGDIOBJ32 X11DRV_SelectObject( DC *dc, HGDIOBJ32 handle )
GDI_HEAP_UNLOCK( handle );
return ret;
}
/***********************************************************************
* X11DRV_DeleteObject
*/
BOOL32 X11DRV_DeleteObject( HGDIOBJ32 handle )
{
GDIOBJHDR *ptr = GDI_GetObjPtr( handle, MAGIC_DONTCARE );
BOOL32 ret = 0;
if (!ptr) return FALSE;
switch(ptr->wMagic) {
case BITMAP_MAGIC:
ret = X11DRV_BITMAP_DeleteObject( handle, (BITMAPOBJ *)ptr );
break;
default:
ERR(gdi, "Shouldn't be here!\n");
ret = FALSE;
break;
}
GDI_HEAP_UNLOCK( handle );
return ret;
}
......@@ -8,19 +8,6 @@
#define __WINE_BITMAP_H
#include "gdi.h"
#include "xmalloc.h"
#ifdef PRELIMINARY_WING16_SUPPORT
/* FIXME: this doesn't belong here */
#include "ts_xshm.h"
typedef struct
{
XShmSegmentInfo si;
SEGPTR bits;
} __ShmBitmapCtl;
#endif
/* Additional info for DIB section objects */
typedef struct
......@@ -40,52 +27,51 @@ typedef struct
} DIBSECTIONOBJ;
/* Flags used for BitmapBits. We only use the first two at the moment */
#define DDB_SET 1
#define DDB_GET 2
#define DDB_COPY 4
#define DDB_SETWITHFILLER 8
typedef struct {
const struct tagDC_FUNCS *funcs; /* DC function table */
void *physBitmap; /* ptr to device specific data */
} DDBITMAP;
/* GDI logical bitmap object */
typedef struct
typedef struct tagBITMAPOBJ
{
GDIOBJHDR header;
BITMAP16 bitmap;
Pixmap pixmap;
SIZE16 size; /* For SetBitmapDimension() */
BITMAP32 bitmap;
SIZE32 size; /* For SetBitmapDimension() */
DDBITMAP *DDBitmap;
/* For device-independent bitmaps: */
DIBSECTIONOBJ *dib;
} BITMAPOBJ;
/* GCs used for B&W and color bitmap operations */
extern GC BITMAP_monoGC, BITMAP_colorGC;
#define BITMAP_GC(bmp) \
(((bmp)->bitmap.bmBitsPixel == 1) ? BITMAP_monoGC : BITMAP_colorGC)
#define BITMAP_WIDTH_BYTES(width,bpp) \
(((bpp) == 24) ? (width) * 4 : ( ((bpp) == 15) ? (width) * 2 : \
((width) * (bpp) + 15) / 16 * 2 ))
#define XCREATEIMAGE(image,width,height,bpp) \
{ \
int width_bytes = DIB_GetXImageWidthBytes( (width), (bpp) ); \
(image) = TSXCreateImage(display, DefaultVisualOfScreen(screen), \
(bpp), ZPixmap, 0, xcalloc( (height)*width_bytes ),\
(width), (height), 32, width_bytes ); \
}
/* objects/bitmap.c */
extern BOOL32 BITMAP_Init(void);
extern INT16 BITMAP_GetObject16( BITMAPOBJ * bmp, INT16 count, LPVOID buffer );
extern INT32 BITMAP_GetObject32( BITMAPOBJ * bmp, INT32 count, LPVOID buffer );
extern BOOL32 BITMAP_DeleteObject( HBITMAP16 hbitmap, BITMAPOBJ * bitmap );
extern XImage *BITMAP_GetXImage( const BITMAPOBJ *bmp );
extern INT32 BITMAP_GetBitsPadding( int width, int depth );
extern INT32 BITMAP_GetBitsWidth( int width, int depth );
extern HBITMAP32 BITMAP_LoadBitmap32W(HINSTANCE32 instance,LPCWSTR name,
UINT32 loadflags);
extern HBITMAP32 BITMAP_CopyBitmap( HBITMAP32 hbitmap );
/* objects/dib.c */
extern int DIB_GetDIBWidthBytes( int width, int depth );
extern int DIB_GetXImageWidthBytes( int width, int depth );
extern int DIB_BitmapInfoSize( BITMAPINFO * info, WORD coloruse );
extern int DIB_GetBitmapInfo( const BITMAPINFOHEADER *header, DWORD *width,
int *height, WORD *bpp, WORD *compr );
extern void DIB_UpdateDIBSection( DC *dc, BOOL32 toDIB );
extern void DIB_DeleteDIBSection( BITMAPOBJ *bmp );
extern void DIB_SelectDIBSection( DC *dc, BITMAPOBJ *bmp );
......
......@@ -173,10 +173,12 @@ typedef struct tagDC_FUNCS
{
BOOL32 (*pArc)(DC*,INT32,INT32,INT32,INT32,INT32,INT32,INT32,INT32);
BOOL32 (*pBitBlt)(DC*,INT32,INT32,INT32,INT32,DC*,INT32,INT32,DWORD);
LONG (*pBitmapBits)(HBITMAP32,void*,LONG,WORD);
BOOL32 (*pChord)(DC*,INT32,INT32,INT32,INT32,INT32,INT32,INT32,INT32);
BOOL32 (*pCreateBitmap)(HBITMAP32);
BOOL32 (*pCreateDC)(DC*,LPCSTR,LPCSTR,LPCSTR,const DEVMODE16*);
BOOL32 (*pDeleteDC)(DC*);
BOOL32 (*pDeleteObject)(HGDIOBJ16);
BOOL32 (*pDeleteObject)(HGDIOBJ32);
BOOL32 (*pEllipse)(DC*,INT32,INT32,INT32,INT32);
BOOL32 (*pEnumDeviceFonts)(DC*,LPLOGFONT16,DEVICEFONTENUMPROC,LPARAM);
INT32 (*pEscape)(DC*,INT32,INT32,SEGPTR,SEGPTR);
......
......@@ -9,6 +9,7 @@
#include "ts_xutil.h"
#include "winbase.h"
#include "windows.h"
#include "xmalloc.h" /* for XCREATEIMAGE macro */
/* X physical pen */
typedef struct
......@@ -47,6 +48,17 @@ typedef struct
int textPixel;
} X11DRV_PDEVICE;
typedef struct {
Pixmap pixmap;
} X11DRV_PHYSBITMAP;
/* GCs used for B&W and color bitmap operations */
extern GC BITMAP_monoGC, BITMAP_colorGC;
#define BITMAP_GC(bmp) \
(((bmp)->bitmap.bmBitsPixel == 1) ? BITMAP_monoGC : BITMAP_colorGC)
typedef INT32 (*DEVICEFONTENUMPROC)(LPENUMLOGFONT16,LPNEWTEXTMETRIC16,UINT16,LPARAM);
/* Wine driver X11 functions */
......@@ -111,18 +123,45 @@ extern BOOL32 X11DRV_ExtFloodFill( struct tagDC *dc, INT32 x, INT32 y,
extern BOOL32 X11DRV_ExtTextOut( struct tagDC *dc, INT32 x, INT32 y,
UINT32 flags, const RECT32 *lprect,
LPCSTR str, UINT32 count, const INT32 *lpDx );
extern BOOL32 X11DRV_CreateBitmap( HBITMAP32 hbitmap );
extern BOOL32 X11DRV_DeleteObject( HGDIOBJ32 handle );
extern LONG X11DRV_BitmapBits( HBITMAP32 hbitmap, void *bits, LONG count,
WORD flags );
extern INT32 X11DRV_SetDIBitsToDevice( struct tagDC *dc, INT32 xDest,
INT32 yDest, DWORD cx, DWORD cy,
INT32 xSrc, INT32 ySrc,
UINT32 startscan, UINT32 lines,
LPCVOID bits, const BITMAPINFO *info,
UINT32 coloruse );
extern INT32 X11DRV_DeviceBitmapBits( struct tagDC *dc, HBITMAP32 hbitmap,
WORD fGet, UINT32 startscan,
UINT32 lines, LPSTR bits,
LPBITMAPINFO info, UINT32 coloruse );
/* X11 driver internal functions */
extern BOOL32 X11DRV_BITMAP_Init(void);
extern BOOL32 X11DRV_BRUSH_Init(void);
extern BOOL32 X11DRV_FONT_Init( struct tagDeviceCaps* );
struct tagBITMAPOBJ;
extern XImage *X11DRV_BITMAP_GetXImage( const struct tagBITMAPOBJ *bmp );
extern int X11DRV_DIB_GetXImageWidthBytes( int width, int depth );
extern BOOL32 X11DRV_DIB_Init(void);
extern X11DRV_PHYSBITMAP *X11DRV_AllocBitmap( struct tagBITMAPOBJ *bmp );
/* Xlib critical section */
extern CRITICAL_SECTION X11DRV_CritSection;
extern void _XInitImageFuncPtrs(XImage *);
#define XCREATEIMAGE(image,width,height,bpp) \
{ \
int width_bytes = X11DRV_DIB_GetXImageWidthBytes( (width), (bpp) ); \
(image) = TSXCreateImage(display, DefaultVisualOfScreen(screen), \
(bpp), ZPixmap, 0, xcalloc( (height)*width_bytes ),\
(width), (height), 32, width_bytes ); \
}
#endif /* __WINE_X11DRV_H */
......@@ -85,27 +85,13 @@ HBRUSH16 WINAPI CreatePatternBrush16( HBITMAP16 hbitmap )
HBRUSH32 WINAPI CreatePatternBrush32( HBITMAP32 hbitmap )
{
LOGBRUSH32 logbrush = { BS_PATTERN, 0, 0 };
BITMAPOBJ *bmp, *newbmp;
TRACE(gdi, "%04x\n", hbitmap );
/* Make a copy of the bitmap */
if (!(bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC )))
return 0;
logbrush.lbHatch = (INT32)CreateBitmapIndirect16( &bmp->bitmap );
newbmp = (BITMAPOBJ *) GDI_GetObjPtr( (HGDIOBJ32)logbrush.lbHatch,
BITMAP_MAGIC );
if (!newbmp)
{
GDI_HEAP_UNLOCK( hbitmap );
return 0;
}
TSXCopyArea( display, bmp->pixmap, newbmp->pixmap, BITMAP_GC(bmp),
0, 0, bmp->bitmap.bmWidth, bmp->bitmap.bmHeight, 0, 0 );
GDI_HEAP_UNLOCK( hbitmap );
GDI_HEAP_UNLOCK( logbrush.lbHatch );
return CreateBrushIndirect32( &logbrush );
logbrush.lbHatch = (INT32)BITMAP_CopyBitmap( hbitmap );
if(!logbrush.lbHatch)
return 0;
else
return CreateBrushIndirect32( &logbrush );
}
......
......@@ -67,7 +67,7 @@ BOOL32 DIB_Init(void)
*
* Return the width of an X image in bytes
*/
int DIB_GetXImageWidthBytes( int width, int depth )
int X11DRV_DIB_GetXImageWidthBytes( int width, int depth )
{
int i;
......@@ -144,7 +144,7 @@ int DIB_BitmapInfoSize( BITMAPINFO * info, WORD coloruse )
* Get the info from a bitmap header.
* Return 1 for INFOHEADER, 0 for COREHEADER, -1 for error.
*/
static int DIB_GetBitmapInfo( const BITMAPINFOHEADER *header, DWORD *width,
int DIB_GetBitmapInfo( const BITMAPINFOHEADER *header, DWORD *width,
int *height, WORD *bpp, WORD *compr )
{
if (header->biSize == sizeof(BITMAPINFOHEADER))
......@@ -1282,11 +1282,18 @@ INT32 WINAPI SetDIBits32( HDC32 hdc, HBITMAP32 hbitmap, UINT32 startscan,
}
}
/* HACK for now */
if(!bmp->DDBitmap)
X11DRV_CreateBitmap(hbitmap);
{
X11DRV_PHYSBITMAP *pbitmap = bmp->DDBitmap->physBitmap;
descr.bits = bits;
descr.image = NULL;
descr.lines = tmpheight >= 0 ? lines : -lines;
descr.depth = bmp->bitmap.bmBitsPixel;
descr.drawable = bmp->pixmap;
descr.drawable = pbitmap->pixmap;
descr.gc = BITMAP_GC(bmp);
descr.xSrc = 0;
descr.ySrc = 0;
......@@ -1294,7 +1301,7 @@ INT32 WINAPI SetDIBits32( HDC32 hdc, HBITMAP32 hbitmap, UINT32 startscan,
descr.yDest = height - startscan - lines;
descr.width = bmp->bitmap.bmWidth;
descr.height = lines;
}
EnterCriticalSection( &X11DRV_CritSection );
result = CALL_LARGE_STACK( DIB_SetImageBits, &descr );
LeaveCriticalSection( &X11DRV_CritSection );
......@@ -1598,8 +1605,12 @@ INT32 WINAPI GetDIBits32(
xend = info->bmiHeader.biWidth;
}
/* HACK for now */
if(!bmp->DDBitmap)
X11DRV_CreateBitmap(hbitmap);
EnterCriticalSection( &X11DRV_CritSection );
bmpImage = (XImage *)CALL_LARGE_STACK( BITMAP_GetXImage, bmp );
bmpImage = (XImage *)CALL_LARGE_STACK( X11DRV_BITMAP_GetXImage, bmp );
switch( info->bmiHeader.biBitCount )
{
......@@ -1822,7 +1833,9 @@ static void DIB_DoUpdateDIBSection( BITMAPOBJ *bmp, BOOL32 toDIB )
descr.nColorMap = dib->nColorMap;
descr.bits = dib->dibSection.dsBm.bmBits;
descr.depth = bmp->bitmap.bmBitsPixel;
descr.drawable = bmp->pixmap;
/* Hack for now */
descr.drawable = ((X11DRV_PHYSBITMAP *)bmp->DDBitmap->physBitmap)->pixmap;
descr.gc = BITMAP_GC(bmp);
descr.xSrc = 0;
descr.ySrc = 0;
......@@ -2062,6 +2075,10 @@ HBITMAP32 WINAPI CreateDIBSection32 (HDC32 hdc, BITMAPINFO *bmi, UINT32 usage,
res = CreateDIBitmap32(hdc, bi, 0, NULL, bmi, usage);
bmp = (BITMAPOBJ *) GDI_GetObjPtr(res, BITMAP_MAGIC);
if (bmp) bmp->dib = dib;
/* HACK for now */
if(!bmp->DDBitmap)
X11DRV_CreateBitmap(res);
}
/* Create XImage */
......
......@@ -319,6 +319,7 @@ static HBITMAP16 OBM_MakeBitmap( WORD width, WORD height,
{
HBITMAP16 hbitmap;
BITMAPOBJ * bmpObjPtr;
X11DRV_PHYSBITMAP *pbitmap;
if (!pixmap) return 0;
......@@ -328,16 +329,19 @@ static HBITMAP16 OBM_MakeBitmap( WORD width, WORD height,
bmpObjPtr = (BITMAPOBJ *) GDI_HEAP_LOCK( hbitmap );
bmpObjPtr->size.cx = width;
bmpObjPtr->size.cy = height;
bmpObjPtr->pixmap = pixmap;
bmpObjPtr->bitmap.bmType = 0;
bmpObjPtr->bitmap.bmWidth = width;
bmpObjPtr->bitmap.bmHeight = height;
bmpObjPtr->bitmap.bmWidthBytes = BITMAP_WIDTH_BYTES( width, bpp );
bmpObjPtr->bitmap.bmPlanes = 1;
bmpObjPtr->bitmap.bmBitsPixel = bpp;
bmpObjPtr->bitmap.bmBits = (SEGPTR)NULL;
bmpObjPtr->bitmap.bmBits = NULL;
bmpObjPtr->dib = NULL;
pbitmap = X11DRV_AllocBitmap(bmpObjPtr);
pbitmap->pixmap = pixmap;
GDI_HEAP_UNLOCK( hbitmap );
return hbitmap;
}
......@@ -493,10 +497,11 @@ HGLOBAL16 OBM_LoadCursorIcon( WORD id, BOOL32 fCursor )
if (descr.mask)
{
X11DRV_PHYSBITMAP *pbitmapAnd = bmpAnd->DDBitmap->physBitmap;
/* Invert the mask */
TSXSetFunction( display, BITMAP_monoGC, GXinvert );
TSXFillRectangle( display, bmpAnd->pixmap, BITMAP_monoGC, 0, 0,
TSXFillRectangle( display, pbitmapAnd->pixmap, BITMAP_monoGC, 0, 0,
bmpAnd->bitmap.bmWidth, bmpAnd->bitmap.bmHeight );
TSXSetFunction( display, BITMAP_monoGC, GXcopy );
......@@ -504,11 +509,12 @@ HGLOBAL16 OBM_LoadCursorIcon( WORD id, BOOL32 fCursor )
if (bmpXor->bitmap.bmBitsPixel != 1)
{
X11DRV_PHYSBITMAP *pbitmapXor = bmpXor->DDBitmap->physBitmap;
TSXSetForeground( display, BITMAP_colorGC,
COLOR_ToPhysical( NULL, RGB(0,0,0) ));
TSXSetBackground( display, BITMAP_colorGC, 0 );
TSXSetFunction( display, BITMAP_colorGC, GXor );
TSXCopyPlane(display, bmpAnd->pixmap, bmpXor->pixmap, BITMAP_colorGC,
TSXCopyPlane(display, pbitmapAnd->pixmap, pbitmapXor->pixmap, BITMAP_colorGC,
0, 0, bmpXor->bitmap.bmWidth, bmpXor->bitmap.bmHeight,
0, 0, 1 );
TSXSetFunction( display, BITMAP_colorGC, GXcopy );
......
......@@ -71,6 +71,7 @@ BOOL32 GRAPH_DrawBitmap( HDC32 hdc, HBITMAP32 hbitmap,
BITMAPOBJ *bmp;
DC *dc;
BOOL32 ret = TRUE;
X11DRV_PHYSBITMAP *pbitmap;
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return FALSE;
if (!(bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC )))
......@@ -79,6 +80,8 @@ BOOL32 GRAPH_DrawBitmap( HDC32 hdc, HBITMAP32 hbitmap,
return FALSE;
}
pbitmap = bmp->DDBitmap->physBitmap;
xdest += dc->w.DCOrgX; ydest += dc->w.DCOrgY;
TSXSetFunction( display, dc->u.x.gc, GXcopy );
......@@ -86,7 +89,7 @@ BOOL32 GRAPH_DrawBitmap( HDC32 hdc, HBITMAP32 hbitmap,
{
TSXSetForeground( display, dc->u.x.gc, dc->u.x.backgroundPixel );
TSXSetBackground( display, dc->u.x.gc, dc->u.x.textPixel );
TSXCopyPlane( display, bmp->pixmap, dc->u.x.drawable, dc->u.x.gc,
TSXCopyPlane( display, pbitmap->pixmap, dc->u.x.drawable, dc->u.x.gc,
xsrc, ysrc, width, height, xdest, ydest, 1 );
}
else if (bmp->bitmap.bmBitsPixel == dc->w.bitsPerPixel)
......@@ -105,12 +108,12 @@ BOOL32 GRAPH_DrawBitmap( HDC32 hdc, HBITMAP32 hbitmap,
TSXSetForeground(display, dc->u.x.gc, dc->u.x.textPixel);
TSXSetBackground(display, dc->u.x.gc, dc->u.x.backgroundPixel);
}
TSXCopyPlane( display, bmp->pixmap, dc->u.x.drawable, dc->u.x.gc,
TSXCopyPlane( display, pbitmap->pixmap, dc->u.x.drawable, dc->u.x.gc,
xsrc, ysrc, width, height, xdest, ydest, plane );
}
else
{
TSXCopyArea( display, bmp->pixmap, dc->u.x.drawable,
TSXCopyArea( display, pbitmap->pixmap, dc->u.x.drawable,
dc->u.x.gc, xsrc, ysrc, width, height, xdest, ydest );
}
}
......@@ -235,6 +238,7 @@ BOOL32 GRAPH_SelectClipMask( HDC32 hdc, HBITMAP32 hMonoBitmap, INT32 x, INT32 y)
{
BITMAPOBJ *bmp = NULL;
DC *dc;
X11DRV_PHYSBITMAP *pbitmap = NULL;
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return FALSE;
if ( hMonoBitmap )
......@@ -245,10 +249,11 @@ BOOL32 GRAPH_SelectClipMask( HDC32 hdc, HBITMAP32 hMonoBitmap, INT32 x, INT32 y)
GDI_HEAP_UNLOCK( hdc );
return FALSE;
}
pbitmap = bmp->DDBitmap->physBitmap;
TSXSetClipOrigin( display, dc->u.x.gc, dc->w.DCOrgX + x, dc->w.DCOrgY + y);
}
TSXSetClipMask( display, dc->u.x.gc, (bmp) ? bmp->pixmap : None );
TSXSetClipMask( display, dc->u.x.gc, (bmp) ? pbitmap->pixmap : None );
GDI_HEAP_UNLOCK( hdc );
GDI_HEAP_UNLOCK( hMonoBitmap );
......
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