4 * Copyright 1993 Alexandre Julliard
18 /***********************************************************************
21 BOOL32
X11DRV_BITMAP_Init(void)
25 /* Create the necessary GCs */
27 if ((tmpPixmap
= TSXCreatePixmap( display
, rootWindow
, 1, 1, 1 )))
29 BITMAP_monoGC
= TSXCreateGC( display
, tmpPixmap
, 0, NULL
);
30 TSXSetGraphicsExposures( display
, BITMAP_monoGC
, False
);
31 TSXFreePixmap( display
, tmpPixmap
);
36 if ((tmpPixmap
= TSXCreatePixmap(display
, rootWindow
, 1,1,screenDepth
)))
38 BITMAP_colorGC
= TSXCreateGC( display
, tmpPixmap
, 0, NULL
);
39 TSXSetGraphicsExposures( display
, BITMAP_colorGC
, False
);
40 TSXFreePixmap( display
, tmpPixmap
);
46 /***********************************************************************
47 * X11DRV_BITMAP_SelectObject
49 HBITMAP32
X11DRV_BITMAP_SelectObject( DC
* dc
, HBITMAP32 hbitmap
,
53 HBITMAP32 prevHandle
= dc
->w
.hBitmap
;
55 if (!(dc
->w
.flags
& DC_MEMORY
)) return 0;
58 SetRectRgn32( dc
->w
.hVisRgn
, 0, 0,
59 bmp
->bitmap
.bmWidth
, bmp
->bitmap
.bmHeight
);
62 hrgn
= CreateRectRgn32(0, 0, bmp
->bitmap
.bmWidth
, bmp
->bitmap
.bmHeight
);
67 dc
->u
.x
.drawable
= bmp
->pixmap
;
68 dc
->w
.hBitmap
= hbitmap
;
70 /* Change GC depth if needed */
72 if (dc
->w
.bitsPerPixel
!= bmp
->bitmap
.bmBitsPixel
)
74 TSXFreeGC( display
, dc
->u
.x
.gc
);
75 dc
->u
.x
.gc
= TSXCreateGC( display
, dc
->u
.x
.drawable
, 0, NULL
);
76 dc
->w
.bitsPerPixel
= bmp
->bitmap
.bmBitsPixel
;
79 else CLIPPING_UpdateGCRegion( dc
); /* Just update GC clip region */