2 * GDI bit-blit operations
4 * Copyright 1993, 1994 Alexandre Julliard
8 #include "debugtools.h"
10 DEFAULT_DEBUG_CHANNEL(bitblt
);
13 /***********************************************************************
16 BOOL16 WINAPI
PatBlt16( HDC16 hdc
, INT16 left
, INT16 top
,
17 INT16 width
, INT16 height
, DWORD rop
)
19 return PatBlt( hdc
, left
, top
, width
, height
, rop
);
23 /***********************************************************************
26 BOOL WINAPI
PatBlt( HDC hdc
, INT left
, INT top
,
27 INT width
, INT height
, DWORD rop
)
29 DC
* dc
= DC_GetDCUpdate( hdc
);
32 if (!dc
) return FALSE
;
34 if (dc
->funcs
->pPatBlt
)
36 TRACE("%04x %d,%d %dx%d %06lx\n", hdc
, left
, top
, width
, height
, rop
);
37 bRet
= dc
->funcs
->pPatBlt( dc
, left
, top
, width
, height
, rop
);
39 GDI_ReleaseObj( hdc
);
44 /***********************************************************************
47 BOOL16 WINAPI
BitBlt16( HDC16 hdcDst
, INT16 xDst
, INT16 yDst
, INT16 width
,
48 INT16 height
, HDC16 hdcSrc
, INT16 xSrc
, INT16 ySrc
,
51 return BitBlt( hdcDst
, xDst
, yDst
, width
, height
, hdcSrc
, xSrc
, ySrc
, rop
);
55 /***********************************************************************
58 BOOL WINAPI
BitBlt( HDC hdcDst
, INT xDst
, INT yDst
, INT width
,
59 INT height
, HDC hdcSrc
, INT xSrc
, INT ySrc
, DWORD rop
)
64 if ((dcSrc
= DC_GetDCUpdate( hdcSrc
))) GDI_ReleaseObj( hdcSrc
);
65 /* FIXME: there is a race condition here */
66 if ((dcDst
= DC_GetDCUpdate( hdcDst
)))
68 dcSrc
= DC_GetDCPtr( hdcSrc
);
69 TRACE("hdcSrc=%04x %d,%d %d bpp->hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n",
70 hdcSrc
, xSrc
, ySrc
, dcSrc
? dcSrc
->bitsPerPixel
: 0,
71 hdcDst
, xDst
, yDst
, width
, height
, dcDst
->bitsPerPixel
, rop
);
72 if (dcDst
->funcs
->pBitBlt
)
73 ret
= dcDst
->funcs
->pBitBlt( dcDst
, xDst
, yDst
, width
, height
,
74 dcSrc
, xSrc
, ySrc
, rop
);
75 if (dcSrc
) GDI_ReleaseObj( hdcSrc
);
76 GDI_ReleaseObj( hdcDst
);
82 /***********************************************************************
83 * StretchBlt16 (GDI.35)
85 BOOL16 WINAPI
StretchBlt16( HDC16 hdcDst
, INT16 xDst
, INT16 yDst
,
86 INT16 widthDst
, INT16 heightDst
,
87 HDC16 hdcSrc
, INT16 xSrc
, INT16 ySrc
,
88 INT16 widthSrc
, INT16 heightSrc
, DWORD rop
)
90 return StretchBlt( hdcDst
, xDst
, yDst
, widthDst
, heightDst
,
91 hdcSrc
, xSrc
, ySrc
, widthSrc
, heightSrc
, rop
);
95 /***********************************************************************
96 * StretchBlt (GDI32.350)
98 BOOL WINAPI
StretchBlt( HDC hdcDst
, INT xDst
, INT yDst
,
99 INT widthDst
, INT heightDst
,
100 HDC hdcSrc
, INT xSrc
, INT ySrc
,
101 INT widthSrc
, INT heightSrc
,
107 if ((dcSrc
= DC_GetDCUpdate( hdcSrc
))) GDI_ReleaseObj( hdcSrc
);
108 /* FIXME: there is a race condition here */
109 if ((dcDst
= DC_GetDCUpdate( hdcDst
)))
111 dcSrc
= DC_GetDCPtr( hdcSrc
);
113 TRACE("%04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
114 hdcSrc
, xSrc
, ySrc
, widthSrc
, heightSrc
,
115 dcSrc
? dcSrc
->bitsPerPixel
: 0, hdcDst
, xDst
, yDst
,
116 widthDst
, heightDst
, dcDst
->bitsPerPixel
, rop
);
119 if (dcDst
->funcs
->pStretchBlt
)
120 ret
= dcDst
->funcs
->pStretchBlt( dcDst
, xDst
, yDst
, widthDst
, heightDst
,
121 dcSrc
, xSrc
, ySrc
, widthSrc
, heightSrc
, rop
);
122 GDI_ReleaseObj( hdcSrc
);
124 GDI_ReleaseObj( hdcDst
);
130 /***********************************************************************
131 * FastWindowFrame (GDI.400)
133 BOOL16 WINAPI
FastWindowFrame16( HDC16 hdc
, const RECT16
*rect
,
134 INT16 width
, INT16 height
, DWORD rop
)
136 HBRUSH hbrush
= SelectObject( hdc
, GetStockObject( GRAY_BRUSH
) );
137 PatBlt( hdc
, rect
->left
, rect
->top
,
138 rect
->right
- rect
->left
- width
, height
, rop
);
139 PatBlt( hdc
, rect
->left
, rect
->top
+ height
, width
,
140 rect
->bottom
- rect
->top
- height
, rop
);
141 PatBlt( hdc
, rect
->left
+ width
, rect
->bottom
- 1,
142 rect
->right
- rect
->left
- width
, -height
, rop
);
143 PatBlt( hdc
, rect
->right
- 1, rect
->top
, -width
,
144 rect
->bottom
- rect
->top
- height
, rop
);
145 SelectObject( hdc
, hbrush
);
151 /***********************************************************************
152 * MaskBlt [GDI32.252]
154 BOOL WINAPI
MaskBlt(HDC hdcDest
, INT nXDest
, INT nYDest
,
155 INT nWidth
, INT nHeight
, HDC hdcSource
,
156 INT nXSrc
, INT nYSrc
, HBITMAP hbmMask
,
157 INT xMask
, INT yMask
, DWORD dwRop
)
159 FIXME("(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%ld): stub\n",
160 hdcDest
,nXDest
,nYDest
,nWidth
,nHeight
,hdcSource
,nXSrc
,nYSrc
,
161 hbmMask
,xMask
,yMask
,dwRop
);
165 /*********************************************************************
169 BOOL WINAPI
PlgBlt( HDC hdcDest
, const POINT
*lpPoint
,
170 HDC hdcSrc
, INT nXDest
, INT nYDest
, INT nWidth
,
171 INT nHeight
, HBITMAP hbmMask
, INT xMask
, INT yMask
)
173 FIXME("PlgBlt, stub\n");