Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
307ee761
Commit
307ee761
authored
Mar 31, 2004
by
Mike McCormack
Committed by
Alexandre Julliard
Mar 31, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize GdiGradientFill by drawing lines instead of pixels.
parent
01fefd63
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
6 deletions
+24
-6
painting.c
dlls/gdi/painting.c
+24
-6
No files found.
dlls/gdi/painting.c
View file @
307ee761
...
@@ -1093,7 +1093,7 @@ BOOL WINAPI GdiGradientFill( HDC hdc, TRIVERTEX *vert_array, ULONG nvert,
...
@@ -1093,7 +1093,7 @@ BOOL WINAPI GdiGradientFill( HDC hdc, TRIVERTEX *vert_array, ULONG nvert,
TRIVERTEX
*
v2
=
vert_array
+
rect
->
LowerRight
;
TRIVERTEX
*
v2
=
vert_array
+
rect
->
LowerRight
;
int
y1
=
v1
->
y
<
v2
->
y
?
v1
->
y
:
v2
->
y
;
int
y1
=
v1
->
y
<
v2
->
y
?
v1
->
y
:
v2
->
y
;
int
y2
=
v2
->
y
>
v1
->
y
?
v2
->
y
:
v1
->
y
;
int
y2
=
v2
->
y
>
v1
->
y
?
v2
->
y
:
v1
->
y
;
int
x
,
y
,
dx
;
int
x
,
dx
;
if
(
v1
->
x
>
v2
->
x
)
if
(
v1
->
x
>
v2
->
x
)
{
{
TRIVERTEX
*
t
=
v2
;
TRIVERTEX
*
t
=
v2
;
...
@@ -1103,11 +1103,20 @@ BOOL WINAPI GdiGradientFill( HDC hdc, TRIVERTEX *vert_array, ULONG nvert,
...
@@ -1103,11 +1103,20 @@ BOOL WINAPI GdiGradientFill( HDC hdc, TRIVERTEX *vert_array, ULONG nvert,
dx
=
v2
->
x
-
v1
->
x
;
dx
=
v2
->
x
-
v1
->
x
;
for
(
x
=
0
;
x
<
dx
;
x
++
)
for
(
x
=
0
;
x
<
dx
;
x
++
)
{
{
for
(
y
=
y1
;
y
<
y2
;
y
++
)
POINT
pts
[
2
];
SetPixel
(
hdc
,
x
+
v1
->
x
,
y
,
RGB
(
HPEN
hPen
,
hOldPen
;
hPen
=
CreatePen
(
PS_SOLID
,
1
,
RGB
(
(
v1
->
Red
*
(
dx
-
x
)
+
v2
->
Red
*
x
)
/
dx
>>
8
,
(
v1
->
Red
*
(
dx
-
x
)
+
v2
->
Red
*
x
)
/
dx
>>
8
,
(
v1
->
Green
*
(
dx
-
x
)
+
v2
->
Green
*
x
)
/
dx
>>
8
,
(
v1
->
Green
*
(
dx
-
x
)
+
v2
->
Green
*
x
)
/
dx
>>
8
,
(
v1
->
Blue
*
(
dx
-
x
)
+
v2
->
Blue
*
x
)
/
dx
>>
8
));
(
v1
->
Blue
*
(
dx
-
x
)
+
v2
->
Blue
*
x
)
/
dx
>>
8
));
hOldPen
=
SelectObject
(
hdc
,
hPen
);
pts
[
0
].
x
=
x
;
pts
[
0
].
y
=
y1
;
pts
[
1
].
x
=
x
;
pts
[
1
].
y
=
y2
;
Polyline
(
hdc
,
&
pts
[
0
],
2
);
DeleteObject
(
SelectObject
(
hdc
,
hOldPen
)
);
}
}
}
}
break
;
break
;
...
@@ -1119,7 +1128,7 @@ BOOL WINAPI GdiGradientFill( HDC hdc, TRIVERTEX *vert_array, ULONG nvert,
...
@@ -1119,7 +1128,7 @@ BOOL WINAPI GdiGradientFill( HDC hdc, TRIVERTEX *vert_array, ULONG nvert,
TRIVERTEX
*
v2
=
vert_array
+
rect
->
LowerRight
;
TRIVERTEX
*
v2
=
vert_array
+
rect
->
LowerRight
;
int
x1
=
v1
->
x
<
v2
->
x
?
v1
->
x
:
v2
->
x
;
int
x1
=
v1
->
x
<
v2
->
x
?
v1
->
x
:
v2
->
x
;
int
x2
=
v2
->
x
>
v1
->
x
?
v2
->
x
:
v1
->
x
;
int
x2
=
v2
->
x
>
v1
->
x
?
v2
->
x
:
v1
->
x
;
int
x
,
y
,
dy
;
int
y
,
dy
;
if
(
v1
->
y
>
v2
->
y
)
if
(
v1
->
y
>
v2
->
y
)
{
{
TRIVERTEX
*
t
=
v2
;
TRIVERTEX
*
t
=
v2
;
...
@@ -1129,11 +1138,20 @@ BOOL WINAPI GdiGradientFill( HDC hdc, TRIVERTEX *vert_array, ULONG nvert,
...
@@ -1129,11 +1138,20 @@ BOOL WINAPI GdiGradientFill( HDC hdc, TRIVERTEX *vert_array, ULONG nvert,
dy
=
v2
->
y
-
v1
->
y
;
dy
=
v2
->
y
-
v1
->
y
;
for
(
y
=
0
;
y
<
dy
;
y
++
)
for
(
y
=
0
;
y
<
dy
;
y
++
)
{
{
for
(
x
=
x1
;
x
<
x2
;
x
++
)
POINT
pts
[
2
];
SetPixel
(
hdc
,
x
,
y
+
v1
->
y
,
RGB
(
HPEN
hPen
,
hOldPen
;
hPen
=
CreatePen
(
PS_SOLID
,
1
,
RGB
(
(
v1
->
Red
*
(
dy
-
y
)
+
v2
->
Red
*
y
)
/
dy
>>
8
,
(
v1
->
Red
*
(
dy
-
y
)
+
v2
->
Red
*
y
)
/
dy
>>
8
,
(
v1
->
Green
*
(
dy
-
y
)
+
v2
->
Green
*
y
)
/
dy
>>
8
,
(
v1
->
Green
*
(
dy
-
y
)
+
v2
->
Green
*
y
)
/
dy
>>
8
,
(
v1
->
Blue
*
(
dy
-
y
)
+
v2
->
Blue
*
y
)
/
dy
>>
8
));
(
v1
->
Blue
*
(
dy
-
y
)
+
v2
->
Blue
*
y
)
/
dy
>>
8
));
hOldPen
=
SelectObject
(
hdc
,
hPen
);
pts
[
0
].
x
=
x1
;
pts
[
0
].
y
=
y
;
pts
[
1
].
x
=
x2
;
pts
[
1
].
y
=
y
;
Polyline
(
hdc
,
&
pts
[
0
],
2
);
DeleteObject
(
SelectObject
(
hdc
,
hOldPen
)
);
}
}
}
}
break
;
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment