ReactOS 0.4.16-dev-2110-ge3521eb
NtGdiBitBlt.c File Reference
#include "../win32nt.h"
#include <gditools.h>
Include dependency graph for NtGdiBitBlt.c:

Go to the source code of this file.

Functions

static void Test_NtGdiBitBlt_generic (void)
 
static COLORREF Do_BitBlt (COLORREF crColor, HDC hdcSrc, COLORREF crSrcBack, COLORREF crSrcText, HDC hdcDst, COLORREF crDstBack, COLORREF crDstText)
 
void Test_NtGdiBitBlt_1BPP (void)
 
 START_TEST (NtGdiBitBlt)
 

Variables

static HDC ghdcDDB1
 
static HDC ghdcDDB32
 
static BOOL gbUseCLR_INVALID
 

Function Documentation

◆ Do_BitBlt()

static COLORREF Do_BitBlt ( COLORREF  crColor,
HDC  hdcSrc,
COLORREF  crSrcBack,
COLORREF  crSrcText,
HDC  hdcDst,
COLORREF  crDstBack,
COLORREF  crDstText 
)
static

Definition at line 177 of file NtGdiBitBlt.c.

185{
186 COLORREF cr;
187 SetBkColor(hdcSrc, gbUseCLR_INVALID ? crSrcBack : 0xFFFFFF);
188 SetTextColor(hdcSrc, crSrcText);
189 SetBkColor(hdcDst, crDstBack);
190 SetTextColor(hdcDst, crDstText);
191 NtGdiSetPixel(hdcSrc, 0, 0, crColor);
192 NtGdiBitBlt(hdcDst, 1, 0, 1, 1, hdcSrc, 0, 0, SRCCOPY, gbUseCLR_INVALID ? CLR_INVALID : crSrcBack, 0);
193 cr = NtGdiGetPixel(hdcDst, 1, 0);
194 return cr;
195}
static BOOL gbUseCLR_INVALID
Definition: NtGdiBitBlt.c:13
__kernel_entry W32KAPI DWORD APIENTRY NtGdiGetPixel(_In_ HDC hdc, _In_ INT x, _In_ INT y)
Definition: bitblt.c:1518
__kernel_entry W32KAPI BOOL APIENTRY NtGdiBitBlt(_In_ HDC hdcDst, _In_ INT x, _In_ INT y, _In_ INT cx, _In_ INT cy, _In_opt_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ DWORD rop4, _In_ DWORD crBackColor, _In_ FLONG fl)
__kernel_entry W32KAPI COLORREF APIENTRY NtGdiSetPixel(_In_ HDC hdcDst, _In_ INT x, _In_ INT y, _In_ COLORREF crColor)
Definition: bitblt.c:1429
DWORD COLORREF
Definition: windef.h:94
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:999
#define CLR_INVALID
Definition: wingdi.h:883
#define SRCCOPY
Definition: wingdi.h:333
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:917
static HDC hdcSrc
Definition: xlate.c:32
static HDC hdcDst
Definition: xlate.c:32

Referenced by Test_NtGdiBitBlt_1BPP().

◆ START_TEST()

START_TEST ( NtGdiBitBlt  )

Definition at line 354 of file NtGdiBitBlt.c.

355{
356 ok(GdiToolsInit(), "GdiToolsInit failed\n");
357
358 ULONG cBitsPixel;
359 ChangeScreenBpp(32, &cBitsPixel);
360
365
367 printf("Testing 1BPP with CLR_INVALID...\n");
370 printf("Testing 1BPP without CLR_INVALID...\n");
373
374 ChangeScreenBpp(cBitsPixel, &cBitsPixel);
375}
static HDC ghdcDDB1
Definition: NtGdiBitBlt.c:12
void Test_NtGdiBitBlt_1BPP(void)
Definition: NtGdiBitBlt.c:197
static void Test_NtGdiBitBlt_generic(void)
Definition: NtGdiBitBlt.c:15
static HDC ghdcDDB32
Definition: NtGdiBitBlt.c:12
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define printf
Definition: freeldr.h:97
BOOL ChangeScreenBpp(_In_ ULONG cBitsPixel, _Out_ PULONG pcOldBitsPixel)
Definition: gditools.c:110
HBITMAP ghbmp1
Definition: gditools.c:22
BOOL GdiToolsInit(void)
Definition: gditools.c:229
HBITMAP ghbmp32
Definition: gditools.c:22
uint32_t ULONG
Definition: typedefs.h:59
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)

◆ Test_NtGdiBitBlt_1BPP()

void Test_NtGdiBitBlt_1BPP ( void  )

Definition at line 197 of file NtGdiBitBlt.c.

198{
199 /* 1BPP DDB -> 1BPP DDB: bg and fg colors are ignored */
200 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDDB1, 0xFFFFFF, 0x000000), 0x000000); // normal colors => no inversion
201 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDDB1, 0xFFFFFF, 0x000000), 0xFFFFFF); // normal colors => no inversion
202 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0x000000, 0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000), 0x000000); // inverted src colors => no inversion
203 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0x000000, 0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000), 0xFFFFFF); // inverted src colors => no inversion
204 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDDB1, 0x000000, 0xFFFFFF), 0x000000); // inverted dst colors => no inversion
205 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDDB1, 0x000000, 0xFFFFFF), 0xFFFFFF); // inverted dst colors => no inversion
206 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDDB1, 0x000000, 0x000000), 0x000000); // inverted dst bg color => no inversion
207 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDDB1, 0x000000, 0x000000), 0xFFFFFF); // inverted dst bg color => no inversion
208 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDDB1, 0xFFFFFF, 0xFFFFFF), 0x000000); // inverted dst fg color => no inversion
209 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDDB1, 0xFFFFFF, 0xFFFFFF), 0xFFFFFF); // inverted dst fg color => no inversion
210 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDDB1, 0x0000FF, 0x00FF00), 0x000000); // changed dst colors => no inversion
211 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDDB1, 0x0000FF, 0x00FF00), 0xFFFFFF); // changed dst colors => no inversion
212 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0x000000, 0xFFFFFF, ghdcDDB1, 0x0000FF, 0x00FF00), 0x000000); // inverted src colors, changed dst colors => no inversion
213 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0x000000, 0xFFFFFF, ghdcDDB1, 0x0000FF, 0x00FF00), 0xFFFFFF); // inverted src colors, changed dst colors => no inversion
214
215 /* 1BPP DIB -> 1BPP DIB: bg and fg colors are ignored, src DIB colors are mapped to dst DIB colors */
216 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDIB1, 0xFFFFFF, 0x000000), 0x000000); // normal colors => no inversion
217 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDIB1, 0xFFFFFF, 0x000000), 0xFFFFFF); // normal colors => no inversion
218 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0x000000, 0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000), 0x000000); // inverted src colors => no inversion
219 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0x000000, 0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000), 0xFFFFFF); // inverted src colors => no inversion
220 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDIB1, 0x000000, 0xFFFFFF), 0x000000); // inverted dst colors => no inversion
221 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDIB1, 0x000000, 0xFFFFFF), 0xFFFFFF); // inverted dst colors => no inversion
222 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDIB1, 0x000000, 0x000000), 0x000000); // inverted dst bg color => no inversion
223 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDIB1, 0x000000, 0x000000), 0xFFFFFF); // inverted dst bg color => no inversion
224 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDIB1, 0xFFFFFF, 0xFFFFFF), 0x000000); // inverted dst fg color => no inversion
225 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDIB1, 0xFFFFFF, 0xFFFFFF), 0xFFFFFF); // inverted dst fg color => no inversion
226 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0x000000, 0xFFFFFF, ghdcDIB1, 0x0000FF, 0x00FF00), 0x000000); // inverted src colors, dark dst colors => no inversion
227 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0x000000, 0xFFFFFF, ghdcDIB1, 0x0000FF, 0x00FF00), 0xFFFFFF); // inverted src colors, dark dst colors => no inversion
228 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1_InvCol, 0xFFFFFF, 0x000000, ghdcDIB1, 0xFFFFFF, 0x000000), 0x000000); // inverted src DIB, normal colors => no inversion
229 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1_InvCol, 0xFFFFFF, 0x000000, ghdcDIB1, 0xFFFFFF, 0x000000), 0xFFFFFF); // inverted src DIB, normal colors => no inversion
230 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDIB1_InvCol, 0xFFFFFF, 0x000000), 0x000000); // inverted dst DIB, normal colors => no inversion
231 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDIB1_InvCol, 0xFFFFFF, 0x000000), 0xFFFFFF); // inverted dst DIB, normal colors => no inversion
232 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1_RB, 0xFFFFFF, 0x000000, ghdcDIB1, 0xFFFFFF, 0x000000), 0x000000); // RB src DIB, normal colors => black (0)
233 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1_RB, 0xFFFFFF, 0x000000, ghdcDIB1, 0xFFFFFF, 0x000000), 0x000000); // RB src DIB, normal colors => black (0)
234 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1_RB, 0xFFFFFF, 0x000000, ghdcDIB1_InvCol, 0xFFFFFF, 0x000000), 0x000000); // RB src DIB, inverted dst DIB, normal colors => black (1)
235 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1_RB, 0xFFFFFF, 0x000000, ghdcDIB1_InvCol, 0xFFFFFF, 0x000000), 0x000000); // RB src DIB, inverted dst DIB, normal colors => black (1)
236 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDIB1_RB, 0xFFFFFF, 0x000000), 0xFF0000); // RB dst DIB, normal colors => blue (1)
237 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDIB1_RB, 0xFFFFFF, 0x000000), 0xFF0000); // RB dst DIB, normal colors => blue (1)
238 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1_InvCol, 0xFFFFFF, 0x000000, ghdcDIB1_RB, 0xFFFFFF, 0x000000), 0xFF0000); // inverted src DIB, normal colors => blue (1)
239 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1_InvCol, 0xFFFFFF, 0x000000, ghdcDIB1_RB, 0xFFFFFF, 0x000000), 0xFF0000); // inverted src DIB, normal colors => blue (1)
240
241 /* 1BPP DDB -> 1BPP DIB: black to dest fg, white to dest bg */
242 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDIB1, 0xFFFFFF, 0x000000), 0x000000); // normal colors => no inversion
243 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDIB1, 0xFFFFFF, 0x000000), 0xFFFFFF); // normal colors => no inversion
244 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0x000000, 0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000), 0x000000); // inverted src colors => no inversion
245 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0x000000, 0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000), 0xFFFFFF); // inverted src colors => no inversion
246 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDIB1, 0x000000, 0xFFFFFF), 0xFFFFFF); // inverted dst colors => inversion
247 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDIB1, 0x000000, 0xFFFFFF), 0x000000); // inverted dst colors => inversion
248 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDIB1, 0x000000, 0x000000), 0x000000); // inverted dst bg color => to black
249 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDIB1, 0x000000, 0x000000), 0x000000); // inverted dst bg color => to black
250 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDIB1, 0xFFFFFF, 0xFFFFFF), 0xFFFFFF); // inverted dst fg color => to white
251 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDIB1, 0xFFFFFF, 0xFFFFFF), 0xFFFFFF); // inverted dst fg color => to white
252 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDIB1, 0x0000FF, 0x00FF00), 0x000000); // changed dst colors => no inversion
253 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDIB1, 0x0000FF, 0x00FF00), 0x000000); // changed dst colors => no inversion
254 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0x000000, 0xFFFFFF, ghdcDIB1, 0x0000FF, 0x00FF00), 0x000000); // inverted src colors, dark dst colors => to black
255 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0x000000, 0xFFFFFF, ghdcDIB1, 0x0000FF, 0x00FF00), 0x000000); // inverted src colors, dark dst colors => to black
256 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0x000000, 0xFFFFFF, ghdcDIB1, 0xFF00FF, 0x00FFFF), 0xFFFFFF); // inverted src colors, bright dst colors => to white
257 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0x000000, 0xFFFFFF, ghdcDIB1, 0xFF00FF, 0x00FFFF), 0xFFFFFF); // inverted src colors, bright dst colors => to white
258 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDIB1_InvCol, 0xFFFFFF, 0x000000), 0x000000); // inverted dst DIB, normal colors => no inversion
259 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDIB1_InvCol, 0xFFFFFF, 0x000000), 0xFFFFFF); // inverted dst DIB, normal colors => no inversion
260
261 /* 1BPP DIB -> 1BPP DDB: src bg color (src translated) determines inversion */
262 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDDB1, 0xFFFFFF, 0x000000), 0x000000); // normal colors => no inversion
263 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDDB1, 0xFFFFFF, 0x000000), 0xFFFFFF); // normal colors => no inversion
264 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0x000000, 0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000), 0xFFFFFF); // inverted src colors => inversion
265 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0x000000, 0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000), 0x000000); // inverted src colors => inversion
266 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDDB1, 0x000000, 0xFFFFFF), 0x000000); // inverted dst colors => no inversion
267 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDDB1, 0x000000, 0xFFFFFF), 0xFFFFFF); // inverted dst colors => no inversion
268 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDDB1, 0x000000, 0x000000), 0x000000); // inverted dst bg color => no inversion
269 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDDB1, 0x000000, 0x000000), 0xFFFFFF); // inverted dst bg color => no inversion
270 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDDB1, 0xFFFFFF, 0xFFFFFF), 0x000000); // inverted dst fg color => no inversion
271 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDDB1, 0xFFFFFF, 0xFFFFFF), 0xFFFFFF); // inverted dst fg color => no inversion
272 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDDB1, 0x0000FF, 0x00FF00), 0x000000); // changed dst colors => no inversion
273 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDDB1, 0x0000FF, 0x00FF00), 0xFFFFFF); // changed dst colors => no inversion
274 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0x000000, 0xFFFFFF, ghdcDDB1, 0x0000FF, 0x00FF00), 0xFFFFFF); // inverted src colors, changed dst colors => inversion
275 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0x000000, 0xFFFFFF, ghdcDDB1, 0x0000FF, 0x00FF00), 0x000000); // inverted src colors, changed dst colors => inversion
276 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0x000000, 0x000000, ghdcDDB1, 0xFFFFFF, 0x000000), 0xFFFFFF); // inverted src bg color => inversion
277 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0x000000, 0x000000, ghdcDDB1, 0xFFFFFF, 0x000000), 0x000000); // inverted src bg color => inversion
278 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0xFFFFFF, 0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000), 0x000000); // inverted src fg color => no inversion
279 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000), 0xFFFFFF); // inverted src fg color => no inversion
280 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0x0000FF, 0x000000, ghdcDDB1, 0xFFFFFF, 0x000000), 0xFFFFFF); // dark src bg color => inversion
281 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0x0000FF, 0x000000, ghdcDDB1, 0xFFFFFF, 0x000000), 0x000000); // dark src bg color => inversion
282 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0x00FFFF, 0x000000, ghdcDDB1, 0xFFFFFF, 0x000000), 0x000000); // bright src bg color => no inversion
283 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0x00FFFF, 0x000000, ghdcDDB1, 0xFFFFFF, 0x000000), 0xFFFFFF); // bright src bg color => no inversion
284 ok_eq_hex(Do_BitBlt(0x0000FF, ghdcDIB1_RB, 0x0000F8, 0x000000, ghdcDDB1, 0xFFFFFF, 0x000000), 0xFFFFFF); // RB DIB, close to red src bg color => inversion
285 ok_eq_hex(Do_BitBlt(0xFF0000, ghdcDIB1_RB, 0x0000F8, 0x000000, ghdcDDB1, 0xFFFFFF, 0x000000), 0x000000); // RB DIB, close to red src bg color => inversion
286 ok_eq_hex(Do_BitBlt(0x0000FF, ghdcDIB1_RB, 0xF80000, 0x000000, ghdcDDB1, 0xFFFFFF, 0x000000), 0x000000); // RB DIB, close to blue src bg color => no inversion
287 ok_eq_hex(Do_BitBlt(0xFF0000, ghdcDIB1_RB, 0xF80000, 0x000000, ghdcDDB1, 0xFFFFFF, 0x000000), 0xFFFFFF); // RB DIB, close to blue src bg color => no inversion
288
289 /* 1BPP DDB -> 32BPP DDB: black to dest fg, white to dest bg */
290 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDDB32, 0xFFFFFF, 0x000000), 0x000000); // normal colors => no inversion
291 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDDB32, 0xFFFFFF, 0x000000), 0xFFFFFF); // normal colors => no inversion
292 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0x000000, 0xFFFFFF, ghdcDDB32, 0xFFFFFF, 0x000000), 0x000000); // inverted src colors => no inversion
293 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0x000000, 0xFFFFFF, ghdcDDB32, 0xFFFFFF, 0x000000), 0xFFFFFF); // inverted src colors => no inversion
294 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDDB32, 0x000000, 0xFFFFFF), 0xFFFFFF); // inverted dst colors => inversion
295 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDDB32, 0x000000, 0xFFFFFF), 0x000000); // inverted dst colors => inversion
296 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDDB32, 0x000000, 0x000000), 0x000000); // inverted dst bg color => to black
297 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDDB32, 0x000000, 0x000000), 0x000000); // inverted dst bg color => to black
298 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDDB32, 0xFFFFFF, 0xFFFFFF), 0xFFFFFF); // inverted dst fg color => to white
299 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDDB32, 0xFFFFFF, 0xFFFFFF), 0xFFFFFF); // inverted dst fg color => to white
300 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDDB32, 0x0000FF, 0x00FF00), 0x00FF00); // changed dst colors => to dst fg color
301 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDDB32, 0x0000FF, 0x00FF00), 0x0000FF); // changed dst colors => to dst bg color
302 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0x000000, 0xFFFFFF, ghdcDDB32, 0x0000FF, 0x00FF00), 0x00FF00); // inverted src colors, changed dst colors => to dst fg color
303 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0x000000, 0xFFFFFF, ghdcDDB32, 0x0000FF, 0x00FF00), 0x0000FF); // inverted src colors, changed dst colors => to dst bg color
304
305 /* 1BPP DDB -> 32BPP DIB: black to dest fg, white to dest bg */
306 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDIB32, 0xFFFFFF, 0x000000), 0x000000); // normal colors => no inversion
307 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDIB32, 0xFFFFFF, 0x000000), 0xFFFFFF); // normal colors => no inversion
308 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0x000000, 0xFFFFFF, ghdcDIB32, 0xFFFFFF, 0x000000), 0x000000); // inverted src colors => no inversion
309 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0x000000, 0xFFFFFF, ghdcDIB32, 0xFFFFFF, 0x000000), 0xFFFFFF); // inverted src colors => no inversion
310 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDIB32, 0x000000, 0xFFFFFF), 0xFFFFFF); // inverted dst colors => inversion
311 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDIB32, 0x000000, 0xFFFFFF), 0x000000); // inverted dst colors => inversion
312 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDIB32, 0x000000, 0x000000), 0x000000); // inverted dst bg color => to black
313 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDIB32, 0x000000, 0x000000), 0x000000); // inverted dst bg color => to black
314 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDIB32, 0xFFFFFF, 0xFFFFFF), 0xFFFFFF); // inverted dst fg color => to white
315 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDIB32, 0xFFFFFF, 0xFFFFFF), 0xFFFFFF); // inverted dst fg color => to white
316 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDIB32, 0x0000FF, 0x00FF00), 0x00FF00); // changed dst colors => to dst fg color
317 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0xFFFFFF, 0x000000, ghdcDIB32, 0x0000FF, 0x00FF00), 0x0000FF); // changed dst colors => to dst bg color
318 ok_eq_hex(Do_BitBlt(0x000000, ghdcDDB1, 0x000000, 0xFFFFFF, ghdcDIB32, 0x0000FF, 0x00FF00), 0x00FF00); // inverted src colors, changed dst colors => to dst fg color
319 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDDB1, 0x000000, 0xFFFFFF, ghdcDIB32, 0x0000FF, 0x00FF00), 0x0000FF); // inverted src colors, changed dst colors => to dst bg color
320
321 /* 1BPP DIB -> 32BPP DDB: bg and fg colors are ignored */
322 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDDB32, 0xFFFFFF, 0x000000), 0x000000); // normal colors => no inversion
323 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDDB32, 0xFFFFFF, 0x000000), 0xFFFFFF); // normal colors => no inversion
324 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0x000000, 0xFFFFFF, ghdcDDB32, 0xFFFFFF, 0x000000), 0x000000); // inverted src colors => no inversion
325 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0x000000, 0xFFFFFF, ghdcDDB32, 0xFFFFFF, 0x000000), 0xFFFFFF); // inverted src colors => no inversion
326 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDDB32, 0x000000, 0xFFFFFF), 0x000000); // inverted dst colors => no inversion
327 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDDB32, 0x000000, 0xFFFFFF), 0xFFFFFF); // inverted dst colors => no inversion
328 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDDB32, 0x000000, 0x000000), 0x000000); // inverted dst bg color => no inversion
329 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDDB32, 0x000000, 0x000000), 0xFFFFFF); // inverted dst bg color => no inversion
330 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDDB32, 0xFFFFFF, 0xFFFFFF), 0x000000); // inverted dst fg color => no inversion
331 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDDB32, 0xFFFFFF, 0xFFFFFF), 0xFFFFFF); // inverted dst fg color => to white
332 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDDB32, 0x0000FF, 0x00FF00), 0x000000); // changed dst colors => no inversion
333 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDDB32, 0x0000FF, 0x00FF00), 0xFFFFFF); // changed dst colors => to dst bg color
334 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0x000000, 0xFFFFFF, ghdcDDB32, 0x0000FF, 0x00FF00), 0x000000); // inverted src colors, changed dst colors => to dst fg color
335 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0x000000, 0xFFFFFF, ghdcDDB32, 0x0000FF, 0x00FF00), 0xFFFFFF); // inverted src colors, changed dst colors => to dst bg color
336
337 /* 1BPP DIB -> 32BPP DIB: bg and fg colors are ignored */
338 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDIB32, 0xFFFFFF, 0x000000), 0x000000); // normal colors => no inversion
339 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDIB32, 0xFFFFFF, 0x000000), 0xFFFFFF); // normal colors => no inversion
340 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0x000000, 0xFFFFFF, ghdcDIB32, 0xFFFFFF, 0x000000), 0x000000); // inverted src colors => no inversion
341 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0x000000, 0xFFFFFF, ghdcDIB32, 0xFFFFFF, 0x000000), 0xFFFFFF); // inverted src colors => no inversion
342 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDIB32, 0x000000, 0xFFFFFF), 0x000000); // inverted dst colors => no inversion
343 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDIB32, 0x000000, 0xFFFFFF), 0xFFFFFF); // inverted dst colors => no inversion
344 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDIB32, 0x000000, 0x000000), 0x000000); // inverted dst bg color => no inversion
345 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDIB32, 0x000000, 0x000000), 0xFFFFFF); // inverted dst bg color => no inversion
346 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDIB32, 0xFFFFFF, 0xFFFFFF), 0x000000); // inverted dst fg color => no inversion
347 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDIB32, 0xFFFFFF, 0xFFFFFF), 0xFFFFFF); // inverted dst fg color => to white
348 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDIB32, 0x0000FF, 0x00FF00), 0x000000); // changed dst colors => no inversion
349 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0xFFFFFF, 0x000000, ghdcDIB32, 0x0000FF, 0x00FF00), 0xFFFFFF); // changed dst colors => to dst bg color
350 ok_eq_hex(Do_BitBlt(0x000000, ghdcDIB1, 0x000000, 0xFFFFFF, ghdcDIB32, 0x0000FF, 0x00FF00), 0x000000); // inverted src colors, changed dst colors => to dst fg color
351 ok_eq_hex(Do_BitBlt(0xFFFFFF, ghdcDIB1, 0x000000, 0xFFFFFF, ghdcDIB32, 0x0000FF, 0x00FF00), 0xFFFFFF); // inverted src colors, changed dst colors => to dst bg color
352}
static COLORREF Do_BitBlt(COLORREF crColor, HDC hdcSrc, COLORREF crSrcBack, COLORREF crSrcText, HDC hdcDst, COLORREF crDstBack, COLORREF crDstText)
Definition: NtGdiBitBlt.c:177
#define ok_eq_hex(value, expected)
Definition: apitest.h:134
HDC ghdcDIB32
Definition: gditools.c:24
HDC ghdcDIB1
Definition: gditools.c:24
HDC ghdcDIB1_RB
Definition: gditools.c:24
HDC ghdcDIB1_InvCol
Definition: gditools.c:24

Referenced by START_TEST().

◆ Test_NtGdiBitBlt_generic()

static void Test_NtGdiBitBlt_generic ( void  )
static

Definition at line 15 of file NtGdiBitBlt.c.

16{
17 BOOL bRet;
18 HDC hdc1, hdc2;
19 HBITMAP hbmp1, hOldBmp1, hbmp2, hOldBmp2;
20 DWORD bytes1[4] = {0x00ff0000, 0x0000ff00, 0x000000ff, 0x00ffffff};
21 DWORD bytes2[4] = {0x00000000, 0x0000000, 0x0000000, 0x00000000};
22
23 /* Test NULL dc */
24 SetLastError(0xDEADBEEF);
25 bRet = NtGdiBitBlt((HDC)0, 0, 0, 10, 10, (HDC)0, 10, 10, SRCCOPY, 0, 0);
26 ok_int(bRet, FALSE);
27 ok_long(GetLastError(), 0xDEADBEEF);
28
29 /* Test invalid dc */
30 SetLastError(0xDEADBEEF);
31 bRet = NtGdiBitBlt((HDC)0x123456, 0, 0, 10, 10, (HDC)0x123456, 10, 10, SRCCOPY, 0, 0);
32 ok_int(bRet, FALSE);
33 ok_long(GetLastError(), 0xDEADBEEF);
34
36 ok(hdc1 != NULL, "hdc1 was NULL.\n");
37
39 ok(hdc2 != NULL, "hdc2 was NULL.\n");
40
41 BITMAPINFO bi = {0};
43 bi.bmiHeader.biWidth = 2;
44 bi.bmiHeader.biHeight = -2; // top-down
45 bi.bmiHeader.biPlanes = 1;
46 bi.bmiHeader.biBitCount = 32;
48 PVOID pvDibBits;
49
50 hbmp1 = CreateDIBSection(hdc1, &bi, DIB_RGB_COLORS, &pvDibBits, NULL, 0);
51 ok(hbmp1 != NULL, "hbmp1 was NULL.\n");
52 memcpy(pvDibBits, bytes1, sizeof(bytes1));
53 hOldBmp1 = SelectObject(hdc1, hbmp1);
54
55 ok_eq_hex(NtGdiGetPixel(hdc1, 0, 0), 0x000000ff);
56 ok_eq_hex(NtGdiGetPixel(hdc1, 0, 1), 0x00ff0000);
57 ok_eq_hex(NtGdiGetPixel(hdc1, 1, 0), 0x0000ff00);
58 ok_eq_hex(NtGdiGetPixel(hdc1, 1, 1), 0x00ffffff);
59
60 hbmp2 = CreateDIBSection(hdc2, &bi, DIB_RGB_COLORS, &pvDibBits, NULL, 0);
61 ok(hbmp2 != NULL, "hbmp2 was NULL.\n");
62 memcpy(pvDibBits, bytes2, sizeof(bytes1));
63 hOldBmp2 = SelectObject(hdc2, hbmp2);
64
65 bRet = NtGdiBitBlt(hdc2, 1, 1, -2, -2, hdc1, 0, 0, SRCCOPY, 0, 0);
66 ok_int(bRet, TRUE);
67 ok_eq_hex(NtGdiGetPixel(hdc2, 0, 0), 0x00000000);
68 ok_eq_hex(NtGdiGetPixel(hdc2, 0, 1), 0x00000000);
69 ok_eq_hex(NtGdiGetPixel(hdc2, 1, 0), 0x00000000);
70 ok_eq_hex(NtGdiGetPixel(hdc2, 1, 1), 0x00000000);
71
72 bRet = NtGdiBitBlt(hdc2, 1, 1, -2, -2, hdc1, 1, 1, SRCCOPY, 0, 0);
73 ok_int(bRet, TRUE);
74 ok_eq_hex(NtGdiGetPixel(hdc2, 0, 0), 0x000000ff);
75 ok_eq_hex(NtGdiGetPixel(hdc2, 0, 1), 0x00000000);
76 ok_eq_hex(NtGdiGetPixel(hdc2, 1, 0), 0x00000000);
77 ok_eq_hex(NtGdiGetPixel(hdc2, 1, 1), 0x00000000);
78
79 NtGdiSetPixel(hdc2, 0, 0, 0x00000000);
80
81 bRet = NtGdiBitBlt(hdc2, 1, 1, -2, -2, hdc1, 0, 0, SRCCOPY, 0, 0);
82 ok_int(bRet, TRUE);
83 ok_eq_hex(NtGdiGetPixel(hdc2, 0, 0), 0x00000000);
84 ok_eq_hex(NtGdiGetPixel(hdc2, 0, 1), 0x00000000);
85 ok_eq_hex(NtGdiGetPixel(hdc2, 1, 0), 0x00000000);
86 ok_eq_hex(NtGdiGetPixel(hdc2, 1, 1), 0x00000000);
87
88 bRet = NtGdiBitBlt(hdc2, 1, 1, -2, -2, hdc1, 2, 2, SRCCOPY, 0, 0);
89 ok_int(bRet, TRUE);
90 ok_eq_hex(NtGdiGetPixel(hdc2, 0, 0), 0x00ffffff);
91 ok_eq_hex(NtGdiGetPixel(hdc2, 0, 1), 0x00000000);
92 ok_eq_hex(NtGdiGetPixel(hdc2, 1, 0), 0x00000000);
93 ok_eq_hex(NtGdiGetPixel(hdc2, 1, 1), 0x00000000);
94
95 NtGdiSetPixel(hdc2, 0, 0, 0x00000000);
96
97 bRet = NtGdiBitBlt(hdc2, 2, 2, -2, -2, hdc1, 2, 2, SRCCOPY, 0, 0);
98 ok_int(bRet, TRUE);
99 ok_eq_hex(NtGdiGetPixel(hdc2, 0, 0), 0x000000ff);
100 ok_eq_hex(NtGdiGetPixel(hdc2, 0, 1), 0x00ff0000);
101 ok_eq_hex(NtGdiGetPixel(hdc2, 1, 0), 0x0000ff00);
102 ok_eq_hex(NtGdiGetPixel(hdc2, 1, 1), 0x00ffffff);
103
104 NtGdiSetPixel(hdc2, 0, 0, 0x00000000);
105 NtGdiSetPixel(hdc2, 1, 0, 0x00000000);
106 NtGdiSetPixel(hdc2, 0, 1, 0x00000000);
107 NtGdiSetPixel(hdc2, 1, 1, 0x00000000);
108
109 bRet = NtGdiBitBlt(hdc2, 0, 0, 2, 2, hdc1, 0, 0, SRCCOPY, 0, 0);
110 ok_int(bRet, TRUE);
111 ok_eq_hex(NtGdiGetPixel(hdc2, 0, 0), 0x000000ff);
112 ok_eq_hex(NtGdiGetPixel(hdc2, 0, 1), 0x00ff0000);
113 ok_eq_hex(NtGdiGetPixel(hdc2, 1, 0), 0x0000ff00);
114 ok_eq_hex(NtGdiGetPixel(hdc2, 1, 1), 0x00ffffff);
115
116 // 1BPP DDB -> 32 BPP DDB -> translates to dest DC fore/back colors
117 SetBkColor(ghdcDDB1, 0xFEFEFE);
118 SetTextColor(ghdcDDB1, 0x040404);
119 SetBkColor(ghdcDDB32, 0xFF00FF);
120 SetTextColor(ghdcDDB32, 0x00FF00);
121 NtGdiSetPixel(ghdcDDB1, 0, 0, 0x000000);
122 ok_eq_bool(NtGdiBitBlt(ghdcDDB32, 0, 0, 1, 1, ghdcDDB1, 0, 0, SRCCOPY, 0xF0F0F0, 0), TRUE);
123 ok_eq_hex(NtGdiGetPixel(ghdcDDB32, 0, 0), 0x00FF00);
124 NtGdiSetPixel(ghdcDDB1, 0, 0, 0xFFFFFF);
125 ok_eq_bool(NtGdiBitBlt(ghdcDDB32, 0, 0, 1, 1, ghdcDDB1, 0, 0, SRCCOPY, 0xF0F0F0, 0), TRUE);
126 ok_eq_hex(NtGdiGetPixel(ghdcDDB32, 0, 0), 0xFF00FF);
127
128 // 1BPP DIB -> 1BPP DDB -> use crBackColor parameter, or src DC back color if CLR_INVALID
129 SetBkColor(ghdcDIB1, 0xFFFFFF);
130 SetTextColor(ghdcDIB1, 0x000000);
131 SetBkColor(ghdcDDB1, 0xFFFFFF);
132 SetTextColor(ghdcDDB1, 0x000000);
133 NtGdiSetPixel(ghdcDIB1, 0, 0, 0xFFFFFF);
134 ok_eq_bool(NtGdiBitBlt(ghdcDDB1, 0, 0, 1, 1, ghdcDIB1, 0, 0, SRCCOPY, 0x000000, 0), TRUE);
135 ok_eq_hex(NtGdiGetPixel(ghdcDDB1, 0, 0), 0x000000);
136 ok_eq_bool(NtGdiBitBlt(ghdcDDB1, 0, 0, 1, 1, ghdcDIB1, 0, 0, SRCCOPY, 0xFFFFFF, 0), TRUE);
137 ok_eq_hex(NtGdiGetPixel(ghdcDDB1, 0, 0), 0xFFFFFF);
139 ok_eq_hex(NtGdiGetPixel(ghdcDDB1, 0, 0), 0xFFFFFF);
140 NtGdiSetPixel(ghdcDIB1, 0, 0, 0x000000);
141 ok_eq_bool(NtGdiBitBlt(ghdcDDB1, 0, 0, 1, 1, ghdcDIB1, 0, 0, SRCCOPY, 0x000000, 0), TRUE);
142 ok_eq_hex(NtGdiGetPixel(ghdcDDB1, 0, 0), 0xFFFFFF);
143 ok_eq_bool(NtGdiBitBlt(ghdcDDB1, 0, 0, 1, 1, ghdcDIB1, 0, 0, SRCCOPY, 0xFFFFFF, 0), TRUE);
144 ok_eq_hex(NtGdiGetPixel(ghdcDDB1, 0, 0), 0x000000);
146 ok_eq_hex(NtGdiGetPixel(ghdcDDB1, 0, 0), 0x000000);
147
148 SetBkColor(ghdcDIB1, 0x000000);
149 SetTextColor(ghdcDIB1, 0xFFFFFF);
150 NtGdiSetPixel(ghdcDIB1, 0, 0, 0xFFFFFF);
151 ok_eq_bool(NtGdiBitBlt(ghdcDDB1, 0, 0, 1, 1, ghdcDIB1, 0, 0, SRCCOPY, 0x000000, 0), TRUE);
152 ok_eq_hex(NtGdiGetPixel(ghdcDDB1, 0, 0), 0x000000);
153 ok_eq_bool(NtGdiBitBlt(ghdcDDB1, 0, 0, 1, 1, ghdcDIB1, 0, 0, SRCCOPY, 0xFFFFFF, 0), TRUE);
154 ok_eq_hex(NtGdiGetPixel(ghdcDDB1, 0, 0), 0xFFFFFF);
156 ok_eq_hex(NtGdiGetPixel(ghdcDDB1, 0, 0), 0x000000);
157 NtGdiSetPixel(ghdcDIB1, 0, 0, 0x000000);
158 ok_eq_bool(NtGdiBitBlt(ghdcDDB1, 0, 0, 1, 1, ghdcDIB1, 0, 0, SRCCOPY, 0x000000, 0), TRUE);
159 ok_eq_hex(NtGdiGetPixel(ghdcDDB1, 0, 0), 0xFFFFFF);
160 ok_eq_bool(NtGdiBitBlt(ghdcDDB1, 0, 0, 1, 1, ghdcDIB1, 0, 0, SRCCOPY, 0xFFFFFF, 0), TRUE);
161 ok_eq_hex(NtGdiGetPixel(ghdcDDB1, 0, 0), 0x000000);
163 ok_eq_hex(NtGdiGetPixel(ghdcDDB1, 0, 0), 0xFFFFFF);
164
165 SelectObject(hdc2, hOldBmp2);
166 SelectObject(hdc1, hOldBmp1);
167
168 DeleteObject(hbmp2);
169 DeleteObject(hbmp1);
170
171 DeleteDC(hdc1);
172 DeleteDC(hdc2);
173}
HDC hdc1
Definition: SelectObject.c:10
HDC hdc2
Definition: SelectObject.c:10
#define ok_eq_bool(value, expected)
Definition: apitest.h:137
#define ok_long(expression, result)
Definition: atltest.h:133
#define ok_int(expression, result)
Definition: atltest.h:134
#define SetLastError(x)
Definition: compat.h:752
#define BI_RGB
Definition: precomp.h:55
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
pKey DeleteObject()
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
__kernel_entry W32KAPI HDC APIENTRY NtGdiCreateCompatibleDC(_In_opt_ HDC hdc)
USHORT biBitCount
Definition: precomp.h:45
ULONG biCompression
Definition: precomp.h:46
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1922
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
Definition: bitmap.c:245
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define DIB_RGB_COLORS
Definition: wingdi.h:367
BOOL WINAPI DeleteDC(_In_ HDC)

Referenced by START_TEST().

Variable Documentation

◆ gbUseCLR_INVALID

BOOL gbUseCLR_INVALID
static

Definition at line 13 of file NtGdiBitBlt.c.

Referenced by Do_BitBlt(), and START_TEST().

◆ ghdcDDB1

HDC ghdcDDB1
static

Definition at line 12 of file NtGdiBitBlt.c.

Referenced by START_TEST(), Test_NtGdiBitBlt_1BPP(), and Test_NtGdiBitBlt_generic().

◆ ghdcDDB32

HDC ghdcDDB32
static

Definition at line 12 of file NtGdiBitBlt.c.

Referenced by START_TEST(), Test_NtGdiBitBlt_1BPP(), and Test_NtGdiBitBlt_generic().