ReactOS 0.4.15-dev-5666-gc548b97
PaintRgn.c File Reference
#include "precomp.h"
#include "init.h"
Include dependency graph for PaintRgn.c:

Go to the source code of this file.

Functions

void Test_PaintRgn ()
 
 START_TEST (PaintRgn)
 

Function Documentation

◆ START_TEST()

START_TEST ( PaintRgn  )

Definition at line 56 of file PaintRgn.c.

57{
58 InitStuff();
60}
void Test_PaintRgn()
Definition: PaintRgn.c:12
BOOL InitStuff(void)
Definition: init.c:95

◆ Test_PaintRgn()

void Test_PaintRgn ( )

Definition at line 12 of file PaintRgn.c.

13{
14 RECT rc = { 0, 0, 100, 100 };
15 HRGN hrgn1, hrgn2;
16 BOOL bRet;
17 XFORM xform;
18 PULONG pulDIB = gpvDIB1;
19
21
22 hrgn1 = CreateRectRgn(0, 0, 8, 3);
23 ok(hrgn1 != NULL, "failed to create region\n");
24
25 hrgn2 = CreateRectRgn(2, 3, 5, 8);
26 ok(hrgn1 != NULL, "failed to create region\n");
27
28 CombineRgn(hrgn1, hrgn1, hrgn2, RGN_OR);
29
30 xform.eM11 = 1.0;
31 xform.eM12 = 0.5f;
32 xform.eM21 = 0.0;
33 xform.eM22 = 1.0;
34 xform.eDx = 0.0;
35 xform.eDy = 0.0;
36
38 ok(SetWorldTransform(ghdcDIB1, &xform) == TRUE, "SetWorldTransform failed\n");
39
41
42 bRet = PaintRgn(ghdcDIB1, hrgn1);
43 ok(bRet == TRUE, "PaintRgn failed\n");
44
45 ok_long(pulDIB[0], 0x00000000); // 000000000
46 ok_long(pulDIB[1], 0x000000C0); // 110000000
47 ok_long(pulDIB[2], 0x000000F0); // 111110000
48 ok_long(pulDIB[3], 0x000000FC); // 111111000
49 ok_long(pulDIB[4], 0x0000003F); // 001111110
50 ok_long(pulDIB[5], 0x0000003F); // 001111110
51 ok_long(pulDIB[6], 0x0000003B); // 001110110
52 ok_long(pulDIB[7], 0x00000038); // 001110000
53 ok_long(pulDIB[8], 0x00000038); // 001110000
54}
static HRGN hrgn2
#define ok_long(expression, result)
Definition: atltest.h:133
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned int * PULONG
Definition: retypes.h:1
PVOID gpvDIB1
Definition: init.c:9
HDC ghdcDIB1
Definition: init.c:8
FLOAT eDy
Definition: wingdi.h:1726
FLOAT eM11
Definition: wingdi.h:1721
FLOAT eM21
Definition: wingdi.h:1723
FLOAT eM22
Definition: wingdi.h:1724
FLOAT eM12
Definition: wingdi.h:1722
FLOAT eDx
Definition: wingdi.h:1725
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPI SetGraphicsMode(_In_ HDC, _In_ int)
Definition: dc.c:1226
#define GM_ADVANCED
Definition: wingdi.h:865
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
int WINAPI CombineRgn(_In_opt_ HRGN hrgnDest, _In_opt_ HRGN hrgnSrc1, _In_opt_ HRGN hrgnSrc2, _In_ int fnCombineMode)
#define WHITE_BRUSH
Definition: wingdi.h:902
#define RGN_OR
Definition: wingdi.h:359
#define BLACK_BRUSH
Definition: wingdi.h:896
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
BOOL WINAPI SetWorldTransform(_In_ HDC, _In_ const XFORM *)
BOOL WINAPI PaintRgn(_In_ HDC, _In_ HRGN)
Definition: painting.c:250

Referenced by START_TEST().