2 * GDI bit-blit operations
4 * Copyright 1993, 1994 Alexandre Julliard
11 /***********************************************************************
14 BOOL16 WINAPI
PatBlt16( HDC16 hdc
, INT16 left
, INT16 top
,
15 INT16 width
, INT16 height
, DWORD rop
)
17 DC
* dc
= DC_GetDCPtr( hdc
);
18 if (!dc
|| !dc
->funcs
->pPatBlt
) return FALSE
;
20 dprintf_info(bitblt
, "PatBlt16: %04x %d,%d %dx%d %06lx\n",
21 hdc
, left
, top
, width
, height
, rop
);
22 return dc
->funcs
->pPatBlt( dc
, left
, top
, width
, height
, rop
);
26 /***********************************************************************
27 * PatBlt32 (GDI32.260)
29 BOOL32 WINAPI
PatBlt32( HDC32 hdc
, INT32 left
, INT32 top
,
30 INT32 width
, INT32 height
, DWORD rop
)
32 DC
* dc
= DC_GetDCPtr( hdc
);
33 if (!dc
|| !dc
->funcs
->pPatBlt
) return FALSE
;
35 dprintf_info(bitblt
, "PatBlt32: %04x %d,%d %dx%d %06lx\n",
36 hdc
, left
, top
, width
, height
, rop
);
37 return dc
->funcs
->pPatBlt( dc
, left
, top
, width
, height
, rop
);
41 /***********************************************************************
44 BOOL16 WINAPI
BitBlt16( HDC16 hdcDst
, INT16 xDst
, INT16 yDst
, INT16 width
,
45 INT16 height
, HDC16 hdcSrc
, INT16 xSrc
, INT16 ySrc
,
50 if (!(dcDst
= DC_GetDCPtr( hdcDst
))) return FALSE
;
51 if (!dcDst
->funcs
->pBitBlt
) return FALSE
;
52 dcSrc
= DC_GetDCPtr( hdcSrc
);
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 /***********************************************************************
66 BOOL32 WINAPI
BitBlt32( HDC32 hdcDst
, INT32 xDst
, INT32 yDst
, INT32 width
,
67 INT32 height
, HDC32 hdcSrc
, INT32 xSrc
, INT32 ySrc
,
72 if (!(dcDst
= DC_GetDCPtr( hdcDst
))) return FALSE
;
73 if (!dcDst
->funcs
->pBitBlt
) return FALSE
;
74 dcSrc
= DC_GetDCPtr( hdcSrc
);
77 "BitBlt32: hdcSrc=%04x %d,%d %d bpp -> hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n",
78 hdcSrc
, xSrc
, ySrc
, dcSrc
? dcSrc
->w
.bitsPerPixel
: 0,
79 hdcDst
, xDst
, yDst
, width
, height
, dcDst
->w
.bitsPerPixel
, rop
);
80 return dcDst
->funcs
->pBitBlt( dcDst
, xDst
, yDst
, width
, height
,
81 dcSrc
, xSrc
, ySrc
, rop
);
85 /***********************************************************************
86 * StretchBlt16 (GDI.35)
88 BOOL16 WINAPI
StretchBlt16( HDC16 hdcDst
, INT16 xDst
, INT16 yDst
,
89 INT16 widthDst
, INT16 heightDst
,
90 HDC16 hdcSrc
, INT16 xSrc
, INT16 ySrc
,
91 INT16 widthSrc
, INT16 heightSrc
, DWORD rop
)
95 if (!(dcDst
= DC_GetDCPtr( hdcDst
))) return FALSE
;
96 if (!dcDst
->funcs
->pStretchBlt
) return FALSE
;
97 dcSrc
= DC_GetDCPtr( hdcSrc
);
100 "StretchBlt16: %04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
101 hdcSrc
, xSrc
, ySrc
, widthSrc
, heightSrc
,
102 dcSrc
? dcSrc
->w
.bitsPerPixel
: 0, hdcDst
, xDst
, yDst
,
103 widthDst
, heightDst
, dcDst
->w
.bitsPerPixel
, rop
);
104 return dcDst
->funcs
->pStretchBlt( dcDst
, xDst
, yDst
, widthDst
, heightDst
,
105 dcSrc
, xSrc
, ySrc
, widthSrc
, heightSrc
,
110 /***********************************************************************
111 * StretchBlt32 (GDI32.350)
113 BOOL32 WINAPI
StretchBlt32( HDC32 hdcDst
, INT32 xDst
, INT32 yDst
,
114 INT32 widthDst
, INT32 heightDst
,
115 HDC32 hdcSrc
, INT32 xSrc
, INT32 ySrc
,
116 INT32 widthSrc
, INT32 heightSrc
, DWORD rop
)
120 if (!(dcDst
= DC_GetDCPtr( hdcDst
))) return FALSE
;
121 if (!dcDst
->funcs
->pStretchBlt
) return FALSE
;
122 dcSrc
= DC_GetDCPtr( hdcSrc
);
125 "StretchBlt32: %04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
126 hdcSrc
, xSrc
, ySrc
, widthSrc
, heightSrc
,
127 dcSrc
? dcSrc
->w
.bitsPerPixel
: 0, hdcDst
, xDst
, yDst
,
128 widthDst
, heightDst
, dcDst
->w
.bitsPerPixel
, rop
);
129 return dcDst
->funcs
->pStretchBlt( dcDst
, xDst
, yDst
, widthDst
, heightDst
,
130 dcSrc
, xSrc
, ySrc
, widthSrc
, heightSrc
,
135 /***********************************************************************
136 * FastWindowFrame (GDI.400)
138 BOOL16 WINAPI
FastWindowFrame( HDC16 hdc
, const RECT16
*rect
,
139 INT16 width
, INT16 height
, DWORD rop
)
141 HBRUSH32 hbrush
= SelectObject32( hdc
, GetStockObject32( GRAY_BRUSH
) );
142 PatBlt32( hdc
, rect
->left
, rect
->top
,
143 rect
->right
- rect
->left
- width
, height
, rop
);
144 PatBlt32( hdc
, rect
->left
, rect
->top
+ height
, width
,
145 rect
->bottom
- rect
->top
- height
, rop
);
146 PatBlt32( hdc
, rect
->left
+ width
, rect
->bottom
,
147 rect
->right
- rect
->left
- width
, -height
, rop
);
148 PatBlt32( hdc
, rect
->right
, rect
->top
, -width
,
149 rect
->bottom
- rect
->top
- height
, rop
);
150 SelectObject32( hdc
, hbrush
);