ReactOS 0.4.15-dev-8219-ge8b88cf
gradient.c File Reference
#include <windows.h>
#include "rosperf.h"
Include dependency graph for gradient.c:

Go to the source code of this file.

Functions

void GradientProc (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)
 

Function Documentation

◆ 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:92
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
INT WndHeight
Definition: rosperf.h:32
HDC ForegroundDc
Definition: rosperf.h:29
INT WndWidth
Definition: rosperf.h:31

◆ 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}