Incorporate rosapps. 0.3.15 was branched somewhat incorrectly so rosapps is not synce...
[reactos.git] / modules / rosapps / applications / sysutils / utils / rosperf / lines.c
1 /*
2 * ReactOS RosPerf - ReactOS GUI performance test program
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19 #include <windows.h>
20 #include "rosperf.h"
21
22 void
23 LinesProc(void *Context, PPERF_INFO PerfInfo, unsigned Reps)
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 }
58
59 void
60 LinesHorizontalProc(void *Context, PPERF_INFO PerfInfo, unsigned Reps)
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 }
77
78 void
79 LinesVerticalProc(void *Context, PPERF_INFO PerfInfo, unsigned Reps)
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 }
96
97 /* EOF */