Release 961222
[wine/multimedia.git] / graphics / bitblt.c
blobeda13f47a276c9368f909c9c706798a381a84f64
1 /*
2 * GDI bit-blit operations
4 * Copyright 1993, 1994 Alexandre Julliard
5 */
7 #include "dc.h"
8 #include "stddebug.h"
9 #include "debug.h"
12 /***********************************************************************
13 * PatBlt16 (GDI.29)
15 BOOL16 PatBlt16( HDC16 hdc, INT16 left, INT16 top,
16 INT16 width, INT16 height, DWORD rop)
18 DC * dc = DC_GetDCPtr( hdc );
19 if (!dc || !dc->funcs->pPatBlt) return FALSE;
21 dprintf_bitblt( stddeb, "PatBlt16: %04x %d,%d %dx%d %06lx\n",
22 hdc, left, top, width, height, rop );
23 return dc->funcs->pPatBlt( dc, left, top, width, height, rop );
27 /***********************************************************************
28 * PatBlt32 (GDI32.260)
30 BOOL32 PatBlt32( HDC32 hdc, INT32 left, INT32 top,
31 INT32 width, INT32 height, DWORD rop)
33 DC * dc = DC_GetDCPtr( hdc );
34 if (!dc || !dc->funcs->pPatBlt) return FALSE;
36 dprintf_bitblt( stddeb, "PatBlt32: %04x %d,%d %dx%d %06lx\n",
37 hdc, left, top, width, height, rop );
38 return dc->funcs->pPatBlt( dc, left, top, width, height, rop );
42 /***********************************************************************
43 * BitBlt16 (GDI.34)
45 BOOL16 BitBlt16( HDC16 hdcDst, INT16 xDst, INT16 yDst, INT16 width,
46 INT16 height, HDC16 hdcSrc, INT16 xSrc, INT16 ySrc, DWORD rop)
48 DC *dcDst, *dcSrc;
50 if (!(dcDst = DC_GetDCPtr( hdcDst ))) return FALSE;
51 if (!dcDst->funcs->pBitBlt) return FALSE;
52 dcSrc = DC_GetDCPtr( hdcSrc );
54 dprintf_bitblt(stddeb,
55 "BitBlt16: hdcSrc=%04x %d,%d %d bpp -> hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n",
56 hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->w.bitsPerPixel : 0,
57 hdcDst, xDst, yDst, width, height, dcDst->w.bitsPerPixel, rop);
58 return dcDst->funcs->pBitBlt( dcDst, xDst, yDst, width, height,
59 dcSrc, xSrc, ySrc, rop );
63 /***********************************************************************
64 * BitBlt32 (GDI32.10)
66 BOOL32 BitBlt32( HDC32 hdcDst, INT32 xDst, INT32 yDst, INT32 width,
67 INT32 height, HDC32 hdcSrc, INT32 xSrc, INT32 ySrc, DWORD rop)
69 DC *dcDst, *dcSrc;
71 if (!(dcDst = DC_GetDCPtr( hdcDst ))) return FALSE;
72 if (!dcDst->funcs->pBitBlt) return FALSE;
73 dcSrc = DC_GetDCPtr( hdcSrc );
75 dprintf_bitblt(stddeb,
76 "BitBlt32: hdcSrc=%04x %d,%d %d bpp -> hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n",
77 hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->w.bitsPerPixel : 0,
78 hdcDst, xDst, yDst, width, height, dcDst->w.bitsPerPixel, rop);
79 return dcDst->funcs->pBitBlt( dcDst, xDst, yDst, width, height,
80 dcSrc, xSrc, ySrc, rop );
84 /***********************************************************************
85 * StretchBlt16 (GDI.35)
87 BOOL16 StretchBlt16( HDC16 hdcDst, INT16 xDst, INT16 yDst,
88 INT16 widthDst, INT16 heightDst,
89 HDC16 hdcSrc, INT16 xSrc, INT16 ySrc,
90 INT16 widthSrc, INT16 heightSrc, DWORD rop )
92 DC *dcDst, *dcSrc;
94 if (!(dcDst = DC_GetDCPtr( hdcDst ))) return FALSE;
95 if (!dcDst->funcs->pStretchBlt) return FALSE;
96 dcSrc = DC_GetDCPtr( hdcSrc );
98 dprintf_bitblt(stddeb,
99 "StretchBlt16: %04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
100 hdcSrc, xSrc, ySrc, widthSrc, heightSrc,
101 dcSrc ? dcSrc->w.bitsPerPixel : 0, hdcDst, xDst, yDst,
102 widthDst, heightDst, dcDst->w.bitsPerPixel, rop );
103 return dcDst->funcs->pStretchBlt( dcDst, xDst, yDst, widthDst, heightDst,
104 dcSrc, xSrc, ySrc, widthSrc, heightSrc,
105 rop );
109 /***********************************************************************
110 * StretchBlt32 (GDI32.350)
112 BOOL32 StretchBlt32( HDC32 hdcDst, INT32 xDst, INT32 yDst,
113 INT32 widthDst, INT32 heightDst,
114 HDC32 hdcSrc, INT32 xSrc, INT32 ySrc,
115 INT32 widthSrc, INT32 heightSrc, DWORD rop )
117 DC *dcDst, *dcSrc;
119 if (!(dcDst = DC_GetDCPtr( hdcDst ))) return FALSE;
120 if (!dcDst->funcs->pStretchBlt) return FALSE;
121 dcSrc = DC_GetDCPtr( hdcSrc );
123 dprintf_bitblt(stddeb,
124 "StretchBlt32: %04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
125 hdcSrc, xSrc, ySrc, widthSrc, heightSrc,
126 dcSrc ? dcSrc->w.bitsPerPixel : 0, hdcDst, xDst, yDst,
127 widthDst, heightDst, dcDst->w.bitsPerPixel, rop );
128 return dcDst->funcs->pStretchBlt( dcDst, xDst, yDst, widthDst, heightDst,
129 dcSrc, xSrc, ySrc, widthSrc, heightSrc,
130 rop );
134 /***********************************************************************
135 * FastWindowFrame (GDI.400)
137 BOOL16 FastWindowFrame( HDC16 hdc, const RECT16 *rect,
138 INT16 width, INT16 height, DWORD rop )
140 HBRUSH32 hbrush = SelectObject32( hdc, GetStockObject32( GRAY_BRUSH ) );
141 PatBlt32( hdc, rect->left, rect->top,
142 rect->right - rect->left - width, height, rop );
143 PatBlt32( hdc, rect->left, rect->top + height, width,
144 rect->bottom - rect->top - height, rop );
145 PatBlt32( hdc, rect->left + width, rect->bottom,
146 rect->right - rect->left - width, -height, rop );
147 PatBlt32( hdc, rect->right, rect->top, -width,
148 rect->bottom - rect->top - height, rop );
149 SelectObject32( hdc, hbrush );
150 return TRUE;