ReactOS 0.4.16-dev-334-g4d9f67c
rosperf.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tagPERF_INFO
 
struct  tagTEST
 

Typedefs

typedef struct tagPERF_INFO PERF_INFO
 
typedef struct tagPERF_INFOPPERF_INFO
 
typedef unsigned(* INITTESTPROC) (void **Context, PPERF_INFO PerfInfo, unsigned Reps)
 
typedef void(* TESTPROC) (void *Context, PPERF_INFO PerfInfo, unsigned Reps)
 
typedef void(* CLEANUPTESTPROC) (void *Context, PPERF_INFO PerfInfo)
 
typedef struct tagTEST TEST
 
typedef struct tagTESTPTEST
 

Functions

void GetTests (unsigned *TestCount, PTEST *Tests)
 
unsigned NullInit (void **Context, PPERF_INFO PerfInfo, unsigned Reps)
 
void NullCleanup (void *Context, PPERF_INFO PerfInfo)
 
void FillProc (void *Context, PPERF_INFO PerfInfo, unsigned Reps)
 
void FillSmallProc (void *Context, PPERF_INFO PerfInfo, unsigned Reps)
 
void LinesHorizontalProc (void *Context, PPERF_INFO PerfInfo, unsigned Reps)
 
void LinesVerticalProc (void *Context, PPERF_INFO PerfInfo, unsigned Reps)
 
void LinesProc (void *Context, PPERF_INFO PerfInfo, unsigned Reps)
 
void TextProc (void *Context, PPERF_INFO PerfInfo, unsigned Reps)
 
unsigned AlphaBlendInit (void **Context, PPERF_INFO PerfInfo, unsigned Reps)
 
void AlphaBlendCleanup (void *Context, PPERF_INFO PerfInfo)
 
void AlphaBlendProc (void *Context, PPERF_INFO PerfInfo, unsigned Reps)
 
void GradientHorizontalProc (void *Context, PPERF_INFO PerfInfo, unsigned Reps)
 
void GradientVerticalProc (void *Context, PPERF_INFO PerfInfo, unsigned Reps)
 
void GradientProc (void *Context, PPERF_INFO PerfInfo, unsigned Reps)
 
void ScrollProc (void *Context, PPERF_INFO PerfInfo, unsigned Reps)
 

Typedef Documentation

◆ CLEANUPTESTPROC

typedef void(* CLEANUPTESTPROC) (void *Context, PPERF_INFO PerfInfo)

Definition at line 37 of file rosperf.h.

◆ INITTESTPROC

typedef unsigned(* INITTESTPROC) (void **Context, PPERF_INFO PerfInfo, unsigned Reps)

Definition at line 35 of file rosperf.h.

◆ PERF_INFO

◆ PPERF_INFO

◆ PTEST

typedef struct tagTEST * PTEST

◆ TEST

typedef struct tagTEST TEST

◆ TESTPROC

typedef void(* TESTPROC) (void *Context, PPERF_INFO PerfInfo, unsigned Reps)

Definition at line 36 of file rosperf.h.

Function Documentation

◆ AlphaBlendCleanup()

void AlphaBlendCleanup ( void Context,
PPERF_INFO  PerfInfo 
)

Definition at line 52 of file alphablend.c.

53{
55 DeleteDC(ctx->BitmapDc);
56 DeleteObject(ctx->Bitmap);
58}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
pKey DeleteObject()
BOOL WINAPI DeleteDC(_In_ HDC)

◆ AlphaBlendInit()

unsigned AlphaBlendInit ( void **  Context,
PPERF_INFO  PerfInfo,
unsigned  Reps 
)

Definition at line 29 of file alphablend.c.

30{
32 INT x, y;
33
34 ctx->BitmapDc = CreateCompatibleDC(PerfInfo->BackgroundDc);
35 ctx->Bitmap = CreateCompatibleBitmap(PerfInfo->BackgroundDc, PerfInfo->WndWidth, PerfInfo->WndHeight);
36 SelectObject(ctx->BitmapDc, ctx->Bitmap);
37
38 for (y = 0; y < PerfInfo->WndHeight; y++)
39 {
40 for (x = 0; x < PerfInfo->WndWidth; x++)
41 {
42 SetPixel(ctx->BitmapDc, x, y, RGB(0xff, 0x00, 0x00));
43 }
44 }
45
46 *Context = ctx;
47
48 return Reps;
49}
FORCEINLINE VOID SetPixel(_In_ ULONG Left, _In_ ULONG Top, _In_ UCHAR Color)
Definition: arm.h:55
#define HeapAlloc
Definition: compat.h:733
#define RGB(r, g, b)
Definition: precomp.h:71
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
INT WndHeight
Definition: rosperf.h:32
HDC BackgroundDc
Definition: rosperf.h:30
INT WndWidth
Definition: rosperf.h:31
int32_t INT
Definition: typedefs.h:58
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)

◆ AlphaBlendProc()

void AlphaBlendProc ( void Context,
PPERF_INFO  PerfInfo,
unsigned  Reps 
)

Definition at line 67 of file alphablend.c.

68{
70 unsigned Rep;
71 BLENDFUNCTION BlendFunc = { AC_SRC_OVER, 0, 0, 0 };
72
73 for (Rep = 0; Rep < Reps; Rep++)
74 {
75 BlendFunc.SourceConstantAlpha = 255 * Rep / Reps;
76#if 0
77 PatBlt(PerfInfo->BackgroundDc, 0, 0, PerfInfo->WndWidth, PerfInfo->WndHeight, PATCOPY);
78#endif
79 if (!AlphaBlend(PerfInfo->BackgroundDc, 0, 0, PerfInfo->WndWidth, PerfInfo->WndHeight,
80 ctx->BitmapDc, 0, 0, PerfInfo->WndWidth, PerfInfo->WndHeight,
81 BlendFunc))
82 {
83 DbgPrint("AlphaBlend failed (0x%lx)\n", GetLastError());
84 }
85 }
86}
static const BLENDFUNCTION BlendFunc
Definition: general.c:34
#define DbgPrint
Definition: hal.h:12
BYTE SourceConstantAlpha
Definition: wingdi.h:2761
#define AlphaBlend
Definition: misc.c:293
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define AC_SRC_OVER
Definition: wingdi.h:1369
#define PATCOPY
Definition: wingdi.h:335
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)

◆ FillProc()

void FillProc ( void Context,
PPERF_INFO  PerfInfo,
unsigned  Reps 
)

Definition at line 23 of file fill.c.

24{
25 unsigned Rep;
26
27 for (Rep = 0; Rep < Reps; Rep++)
28 {
29 PatBlt((Rep & 0x100) ? PerfInfo->BackgroundDc : PerfInfo->ForegroundDc, 0, 0,
30 PerfInfo->WndWidth, PerfInfo->WndHeight, PATCOPY);
31 }
32}
HDC ForegroundDc
Definition: rosperf.h:29

◆ FillSmallProc()

void FillSmallProc ( void Context,
PPERF_INFO  PerfInfo,
unsigned  Reps 
)

Definition at line 35 of file fill.c.

36{
37#define SMALL_SIZE 16
38 unsigned Rep;
39 int x, y;
40
41 x = 0;
42 y = 0;
43
44 for (Rep = 0; Rep < Reps; Rep++)
45 {
46 PatBlt((Rep & 0x10000) ? PerfInfo->BackgroundDc : PerfInfo->ForegroundDc, x, y,
48 x += SMALL_SIZE + 1;
49 if (PerfInfo->WndWidth < x + SMALL_SIZE)
50 {
51 x = 0;
52 y += SMALL_SIZE + 1;
53 if (PerfInfo->WndHeight < y + SMALL_SIZE)
54 {
55 y = 0;
56 }
57 }
58 }
59}
#define SMALL_SIZE

◆ GetTests()

void GetTests ( unsigned TestCount,
PTEST Tests 
)

Definition at line 39 of file testlist.c.

40 {
41 *TestCount = sizeof(TestList) / sizeof(TEST);
42 *Tests = TestList;
43 }
struct test_data Tests[]
static TEST TestList[]
Definition: testlist.c:22
Definition: comm.c:65

Referenced by ProcessCommandLine().

◆ GradientHorizontalProc()

void GradientHorizontalProc ( void Context,
PPERF_INFO  PerfInfo,
unsigned  Reps 
)

Definition at line 97 of file gradient.c.

98{
99 unsigned Rep;
100 HDC Dc;
101 TRIVERTEX vert[2];
102 static GRADIENT_RECT gcap = {0, 1};
103
104 Dc = PerfInfo->ForegroundDc;
105 for (Rep = 0; Rep < Reps; Rep++)
106 {
107 vert[0].x = 0;
108 vert[0].y = 0;
109 vert[0].Red = 0xff00;
110 vert[0].Green = 0xff00 - 0xff00 * Rep / Reps;
111 vert[0].Blue = 0xff00 * Rep / Reps;
112 vert[0].Alpha = 0;
113
114 vert[1].x = PerfInfo->WndWidth;
115 vert[1].y = PerfInfo->WndHeight;
116 vert[1].Red = 0xff00 - 0xff00 * Rep / Reps;
117 vert[1].Green = 0xff00 * Rep / Reps;
118 vert[1].Blue = 0xff00;
119 vert[1].Alpha = 0;
120
121 GradientFill(Dc, vert, 2, &gcap, 1, GRADIENT_FILL_RECT_H);
122 }
123}
static HDC
Definition: imagelist.c:88
COLOR16 Red
Definition: wingdi.h:2786
LONG y
Definition: wingdi.h:2785
COLOR16 Green
Definition: wingdi.h:2787
COLOR16 Alpha
Definition: wingdi.h:2789
COLOR16 Blue
Definition: wingdi.h:2788
LONG x
Definition: wingdi.h:2784

◆ GradientProc()

void GradientProc ( void Context,
PPERF_INFO  PerfInfo,
unsigned  Reps 
)

Definition at line 25 of file gradient.c.

26{
27 unsigned Rep;
28 HDC Dc;
29 TRIVERTEX vert[6];
30 static GRADIENT_TRIANGLE gcap[4];
31
32 Dc = PerfInfo->ForegroundDc;
33 vert[0].x = 0;
34 vert[0].y = 0;
35 vert[0].Red = 0xff00;
36 vert[0].Green = 0;
37 vert[0].Blue = 0;
38 vert[0].Alpha = 0;
39 vert[1].x = PerfInfo->WndWidth;
40 vert[1].y = 0;
41 vert[1].Red = 0;
42 vert[1].Green = 0xff00;
43 vert[1].Blue = 0;
44 vert[1].Alpha = 0;
45 vert[2].x = PerfInfo->WndWidth;
46 vert[2].y = PerfInfo->WndHeight;
47 vert[2].Red = 0;
48 vert[2].Green = 0;
49 vert[2].Blue = 0xff00;
50 vert[2].Alpha = 0;
51 vert[3].x = 0;
52 vert[3].y = PerfInfo->WndHeight;
53 vert[3].Red = 0;
54 vert[3].Green = 0xff00;
55 vert[3].Blue = 0;
56 vert[3].Alpha = 0;
57 vert[4].Red = 0;
58 vert[4].Green = 0;
59 vert[4].Blue = 0;
60 vert[4].Alpha = 0;
61 vert[5].Red = 0;
62 vert[5].Green = 0;
63 vert[5].Blue = 0;
64 vert[5].Alpha = 0;
65
66 for (Rep = 0; Rep < Reps; Rep++)
67 {
68 switch (2 * Rep / Reps)
69 {
70 case 0:
71 vert[4].x = PerfInfo->WndWidth * 2 * Rep / Reps;
72 vert[4].y = 0;
73 vert[5].x = PerfInfo->WndWidth - vert[4].x;
74 vert[5].y = PerfInfo->WndHeight;
75 gcap[0].Vertex1 = 5; gcap[0].Vertex2 = 0; gcap[0].Vertex3 = 4;
76 gcap[1].Vertex1 = 5; gcap[1].Vertex2 = 4; gcap[1].Vertex3 = 1;
77 gcap[2].Vertex1 = 5; gcap[2].Vertex2 = 1; gcap[2].Vertex3 = 2;
78 gcap[3].Vertex1 = 5; gcap[3].Vertex2 = 3; gcap[3].Vertex3 = 0;
79 break;
80 case 1:
81 vert[4].x = PerfInfo->WndWidth;
82 vert[4].y = PerfInfo->WndHeight * 2 * Rep / Reps - PerfInfo->WndHeight;
83 vert[5].x = 0;
84 vert[5].y = PerfInfo->WndHeight - vert[4].y;
85 gcap[0].Vertex1 = 5; gcap[0].Vertex2 = 1; gcap[0].Vertex3 = 4;
86 gcap[1].Vertex1 = 5; gcap[1].Vertex2 = 4; gcap[1].Vertex3 = 2;
87 gcap[2].Vertex1 = 5; gcap[2].Vertex2 = 2; gcap[2].Vertex3 = 3;
88 gcap[3].Vertex1 = 5; gcap[3].Vertex2 = 0; gcap[3].Vertex3 = 1;
89 break;
90 }
91
92 GradientFill(Dc, vert, 6, &gcap, 4, GRADIENT_FILL_TRIANGLE);
93 }
94}

◆ GradientVerticalProc()

void GradientVerticalProc ( void Context,
PPERF_INFO  PerfInfo,
unsigned  Reps 
)

Definition at line 126 of file gradient.c.

127{
128 unsigned Rep;
129 HDC Dc;
130 TRIVERTEX vert[2];
131 static GRADIENT_RECT gcap = {0, 1};
132
133 Dc = PerfInfo->ForegroundDc;
134 for (Rep = 0; Rep < Reps; Rep++)
135 {
136 vert[0].x = 0;
137 vert[0].y = 0;
138 vert[0].Red = 0xff00 * Rep / Reps;
139 vert[0].Green = 0xff00 - 0xff00 * Rep / Reps;
140 vert[0].Blue = 0xff00;
141 vert[0].Alpha = 0;
142
143 vert[1].x = PerfInfo->WndWidth;
144 vert[1].y = PerfInfo->WndHeight;
145 vert[1].Red = 0xff00 - 0xff00 * Rep / Reps;
146 vert[1].Green = 0xff00;
147 vert[1].Blue = 0xff00 * Rep / Reps;
148 vert[1].Alpha = 0;
149
150 GradientFill(Dc, vert, 2, &gcap, 1, GRADIENT_FILL_RECT_V);
151 }
152}

◆ LinesHorizontalProc()

void LinesHorizontalProc ( void Context,
PPERF_INFO  PerfInfo,
unsigned  Reps 
)

Definition at line 60 of file lines.c.

61{
62 unsigned Rep;
63 int y;
64 HDC Dc;
65
66 for (Rep = 0; Rep < Reps; )
67 {
68 Dc = (Rep & 0x10000) ? PerfInfo->BackgroundDc : PerfInfo->ForegroundDc;
69
70 for (y = 0; y < PerfInfo->WndHeight && Rep < Reps; Rep++, y += 3)
71 {
72 MoveToEx(Dc, 0, y, NULL);
73 LineTo(Dc, PerfInfo->WndWidth, y);
74 }
75 }
76}
#define NULL
Definition: types.h:112
#define for
Definition: utility.h:88
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)

◆ LinesProc()

void LinesProc ( void Context,
PPERF_INFO  PerfInfo,
unsigned  Reps 
)

Definition at line 23 of file lines.c.

24{
25 unsigned Rep;
26 int Dest;
27 HDC Dc;
28
29 for (Rep = 0; Rep < Reps; )
30 {
31 Dc = (Rep & 0x1000) ? PerfInfo->BackgroundDc : PerfInfo->ForegroundDc;
32
33 for (Dest = 2; Dest < PerfInfo->WndHeight && Rep < Reps; Rep++, Dest += 2)
34 {
35 MoveToEx(Dc, 0, 0, NULL);
36 LineTo(Dc, PerfInfo->WndWidth, Dest);
37 }
38
39 for (Dest = PerfInfo->WndWidth - 2; 0 <= Dest && Rep < Reps; Rep++, Dest -= 2)
40 {
41 MoveToEx(Dc, PerfInfo->WndWidth, 0, NULL);
42 LineTo(Dc, Dest, PerfInfo->WndHeight);
43 }
44
45 for (Dest = PerfInfo->WndHeight - 2; 0 <= Dest && Rep < Reps; Rep++, Dest -= 2)
46 {
47 MoveToEx(Dc, PerfInfo->WndWidth, PerfInfo->WndHeight, NULL);
48 LineTo(Dc, 0, Dest);
49 }
50
51 for (Dest = 2; Dest < PerfInfo->WndWidth && Rep < Reps; Rep++, Dest += 2)
52 {
53 MoveToEx(Dc, 0, PerfInfo->WndHeight, NULL);
54 LineTo(Dc, Dest, 0);
55 }
56 }
57}

◆ LinesVerticalProc()

void LinesVerticalProc ( void Context,
PPERF_INFO  PerfInfo,
unsigned  Reps 
)

Definition at line 79 of file lines.c.

80{
81 unsigned Rep;
82 int x;
83 HDC Dc;
84
85 for (Rep = 0; Rep < Reps; )
86 {
87 Dc = (Rep & 0x1000) ? PerfInfo->BackgroundDc : PerfInfo->ForegroundDc;
88
89 for (x = 0; x < PerfInfo->WndWidth && Rep < Reps; Rep++, x += 3)
90 {
91 MoveToEx(Dc, x, 0, NULL);
92 LineTo(Dc, x, PerfInfo->WndHeight);
93 }
94 }
95}

◆ NullCleanup()

void NullCleanup ( void Context,
PPERF_INFO  PerfInfo 
)

Definition at line 64 of file rosperf.c.

65{
66}

◆ NullInit()

unsigned NullInit ( void **  Context,
PPERF_INFO  PerfInfo,
unsigned  Reps 
)

Definition at line 56 of file rosperf.c.

57{
58 *Context = NULL;
59
60 return Reps;
61}

◆ ScrollProc()

void ScrollProc ( void Context,
PPERF_INFO  PerfInfo,
unsigned  Reps 
)

Definition at line 23 of file scroll.c.

24{
25 unsigned Rep;
26 RECT rect;
27 int x = 0, y = 0, dx = 1, dy = 1;
28
29 rect.left = rect.top = 0;
30 rect.right = PerfInfo->WndWidth;
31 rect.bottom = PerfInfo->WndHeight;
32
33 DrawTextW(PerfInfo->ForegroundDc, L"rosperf", -1, &rect, DT_LEFT | DT_TOP);
34
35 for (Rep = 0; Rep < Reps; Rep++)
36 {
37 ScrollDC((Rep & 0x100) ? PerfInfo->BackgroundDc : PerfInfo->ForegroundDc,
38 dx, dy, NULL, NULL, NULL, NULL);
39 x += dx;
40 y += dy;
41 if ((x >= PerfInfo->WndWidth -50) || x == 0) dx = -dx;
42 if ((y >= PerfInfo->WndHeight -10) || y == 0) dy = -dy;
43 }
44
45}
GLint dy
Definition: linetemp.h:97
GLint dx
Definition: linetemp.h:97
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
#define L(x)
Definition: ntvdm.h:50
& rect
Definition: startmenu.cpp:1413
#define DT_LEFT
Definition: winuser.h:534
#define DT_TOP
Definition: winuser.h:542
BOOL WINAPI ScrollDC(_In_ HDC, _In_ int, _In_ int, _In_opt_ LPCRECT, _In_opt_ LPCRECT, _In_opt_ HRGN, _Out_opt_ LPRECT)

◆ TextProc()

void TextProc ( void Context,
PPERF_INFO  PerfInfo,
unsigned  Reps 
)

Definition at line 23 of file text.c.

24{
25 unsigned Rep;
26 int y;
27 HDC Dc = NULL;
29
30 for (Rep = 0; Rep < Reps; )
31 {
32 Dc = (Rep & 0x10000) ? PerfInfo->BackgroundDc : PerfInfo->ForegroundDc;
33 SelectObject(Dc, hfFont);
34
35 for (y = 0; y < PerfInfo->WndHeight && Rep < Reps; Rep++, y += 15)
36 {
37 TextOut(Dc, 0, y, L"AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz:?<>0123456789", 66);
38 }
39 InvalidateRect(PerfInfo->Wnd, NULL, TRUE);
40 UpdateWindow(PerfInfo->Wnd);
41 }
42}
#define TRUE
Definition: types.h:120
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
HWND Wnd
Definition: rosperf.h:24
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define DEFAULT_GUI_FONT
Definition: wingdi.h:909
#define TextOut
Definition: wingdi.h:4483
BOOL WINAPI UpdateWindow(_In_ HWND)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)