convert line ends
[canaan.git] / prj / tech / libsrc / dev2d / ddevblt.c
blobca3de7b925e73d1c5ed1d04786967367d698eba9
1 /*
2 * $Source: x:/prj/tech/libsrc/dev2d/RCS/ddevblt.c $
3 * $Revision: 1.2 $
4 * $Author: TOML $
5 * $Date: 1996/12/13 16:55:38 $
7 * Display device bitmap functions
9 * This file is part of the dev2d library.
13 #include <lg.h>
14 #include <comtools.h>
15 #include <appagg.h>
16 #include <dispapi.h>
18 #include <grs.h>
19 #include <grd.h>
20 #include <gdbm.h>
21 #include <comdfcn.h>
22 #include <canvas.h>
23 #include <bmftype.h>
24 #include <indexmac.h>
26 void dispdev_ubitmap(grs_bitmap *bm, int x, int y)
28 #ifdef _WIN32
29 // @Note (toml 12-13-96): this is costly, but for now is isolated
30 // to DD in a window so it's probably okay. Performance sensitive
31 // clients can/should circumvent this function, or we need a
32 // better protocol
33 IDeviceBitmap * dst;
34 IDeviceBitmap * src;
36 IDisplayDevice_FindBitmap(g_pDev2dDisplayDevice, &grd_canvas->bm, &dst);
37 IDisplayDevice_FindBitmap(g_pDev2dDisplayDevice, bm, &src);
39 AssertMsg1(dst && src, "dispdev_ubitmap() requires 2 device bitmaps, had %d", (!!(dst) + !!(src)));
41 if (dst && src)
42 IDeviceBitmap_SimpleBlt(dst, x, y, src);
44 SafeRelease(dst);
45 SafeRelease(src);
46 #else
47 ushort old_canvas_flags, old_bitmap_flags;
48 old_canvas_flags = grd_canvas->bm.flags;
49 old_bitmap_flags = bm->flags;
51 bm->flags &= ~BMF_DEV_MUST_BLIT;
52 grd_canvas->bm.flags &= ~BMF_DEV_MUST_BLIT;
54 gr_push_canvas(grd_canvas);
55 gd_ubitmap(bm, x, y);
56 gr_pop_canvas();
58 bm->flags = old_bitmap_flags;
59 grd_canvas->bm.flags = old_canvas_flags;
60 #endif
63 #pragma off (unreferenced)
64 gdubm_func *dispdev_ubitmap_expose(grs_bitmap *bm, int x, int y)
66 return dispdev_ubitmap;
68 #pragma on (unreferenced)