Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
65d5c20a
Commit
65d5c20a
authored
Apr 15, 2008
by
Huw Davies
Committed by
Alexandre Julliard
Apr 16, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: LineDDA shouldn't include the end point. Add some tests.
parent
c8897169
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
2 deletions
+84
-2
painting.c
dlls/gdi32/painting.c
+2
-2
path.c
dlls/gdi32/tests/path.c
+82
-0
No files found.
dlls/gdi32/painting.c
View file @
65d5c20a
...
...
@@ -1005,7 +1005,7 @@ BOOL WINAPI LineDDA(INT nXStart, INT nYStart, INT nXEnd, INT nYEnd,
if
(
dx
>
dy
)
/* line is "more horizontal" */
{
err
=
2
*
dy
-
dx
;
erradd
=
2
*
dy
-
2
*
dx
;
for
(
cnt
=
0
;
cnt
<
=
dx
;
cnt
++
)
for
(
cnt
=
0
;
cnt
<
dx
;
cnt
++
)
{
callback
(
nXStart
,
nYStart
,
lParam
);
if
(
err
>
0
)
...
...
@@ -1020,7 +1020,7 @@ BOOL WINAPI LineDDA(INT nXStart, INT nYStart, INT nXEnd, INT nYEnd,
else
/* line is "more vertical" */
{
err
=
2
*
dx
-
dy
;
erradd
=
2
*
dx
-
2
*
dy
;
for
(
cnt
=
0
;
cnt
<
=
dy
;
cnt
++
)
for
(
cnt
=
0
;
cnt
<
dy
;
cnt
++
)
{
callback
(
nXStart
,
nYStart
,
lParam
);
if
(
err
>
0
)
...
...
dlls/gdi32/tests/path.c
View file @
65d5c20a
...
...
@@ -422,6 +422,87 @@ static void test_closefigure(void) {
ReleaseDC
(
0
,
hdc
);
}
static
void
WINAPI
linedda_callback
(
INT
x
,
INT
y
,
LPARAM
lparam
)
{
POINT
**
pt
=
(
POINT
**
)
lparam
;
ok
((
*
pt
)
->
x
==
x
&&
(
*
pt
)
->
y
==
y
,
"point mismatch expect(%d,%d) got(%d,%d)
\n
"
,
(
*
pt
)
->
x
,
(
*
pt
)
->
y
,
x
,
y
);
(
*
pt
)
++
;
return
;
}
static
void
test_linedda
(
void
)
{
const
POINT
*
pt
;
static
const
POINT
array_10_20_20_40
[]
=
{{
10
,
20
},{
10
,
21
},{
11
,
22
},{
11
,
23
},
{
12
,
24
},{
12
,
25
},{
13
,
26
},{
13
,
27
},
{
14
,
28
},{
14
,
29
},{
15
,
30
},{
15
,
31
},
{
16
,
32
},{
16
,
33
},{
17
,
34
},{
17
,
35
},
{
18
,
36
},{
18
,
37
},{
19
,
38
},{
19
,
39
},
{
-
1
,
-
1
}};
static
const
POINT
array_10_20_20_43
[]
=
{{
10
,
20
},{
10
,
21
},{
11
,
22
},{
11
,
23
},
{
12
,
24
},{
12
,
25
},{
13
,
26
},{
13
,
27
},
{
13
,
28
},{
14
,
29
},{
14
,
30
},{
15
,
31
},
{
15
,
32
},{
16
,
33
},{
16
,
34
},{
17
,
35
},
{
17
,
36
},{
17
,
37
},{
18
,
38
},{
18
,
39
},
{
19
,
40
},{
19
,
41
},{
20
,
42
},{
-
1
,
-
1
}};
static
const
POINT
array_10_20_10_20
[]
=
{{
-
1
,
-
1
}};
static
const
POINT
array_10_20_11_27
[]
=
{{
10
,
20
},{
10
,
21
},{
10
,
22
},{
10
,
23
},
{
11
,
24
},{
11
,
25
},{
11
,
26
},{
-
1
,
-
1
}};
static
const
POINT
array_20_43_10_20
[]
=
{{
20
,
43
},{
20
,
42
},{
19
,
41
},{
19
,
40
},
{
18
,
39
},{
18
,
38
},{
17
,
37
},{
17
,
36
},
{
17
,
35
},{
16
,
34
},{
16
,
33
},{
15
,
32
},
{
15
,
31
},{
14
,
30
},{
14
,
29
},{
13
,
28
},
{
13
,
27
},{
13
,
26
},{
12
,
25
},{
12
,
24
},
{
11
,
23
},{
11
,
22
},{
10
,
21
},{
-
1
,
-
1
}};
static
const
POINT
array_20_20_10_43
[]
=
{{
20
,
20
},{
20
,
21
},{
19
,
22
},{
19
,
23
},
{
18
,
24
},{
18
,
25
},{
17
,
26
},{
17
,
27
},
{
17
,
28
},{
16
,
29
},{
16
,
30
},{
15
,
31
},
{
15
,
32
},{
14
,
33
},{
14
,
34
},{
13
,
35
},
{
13
,
36
},{
13
,
37
},{
12
,
38
},{
12
,
39
},
{
11
,
40
},{
11
,
41
},{
10
,
42
},{
-
1
,
-
1
}};
static
const
POINT
array_20_20_43_10
[]
=
{{
20
,
20
},{
21
,
20
},{
22
,
19
},{
23
,
19
},
{
24
,
18
},{
25
,
18
},{
26
,
17
},{
27
,
17
},
{
28
,
17
},{
29
,
16
},{
30
,
16
},{
31
,
15
},
{
32
,
15
},{
33
,
14
},{
34
,
14
},{
35
,
13
},
{
36
,
13
},{
37
,
13
},{
38
,
12
},{
39
,
12
},
{
40
,
11
},{
41
,
11
},{
42
,
10
},{
-
1
,
-
1
}};
pt
=
array_10_20_20_40
;
LineDDA
(
10
,
20
,
20
,
40
,
linedda_callback
,
(
LPARAM
)
&
pt
);
ok
(
pt
->
x
==
-
1
&&
pt
->
y
==
-
1
,
"didn't find terminator
\n
"
);
pt
=
array_10_20_20_43
;
LineDDA
(
10
,
20
,
20
,
43
,
linedda_callback
,
(
LPARAM
)
&
pt
);
ok
(
pt
->
x
==
-
1
&&
pt
->
y
==
-
1
,
"didn't find terminator
\n
"
);
pt
=
array_10_20_10_20
;
LineDDA
(
10
,
20
,
10
,
20
,
linedda_callback
,
(
LPARAM
)
&
pt
);
ok
(
pt
->
x
==
-
1
&&
pt
->
y
==
-
1
,
"didn't find terminator
\n
"
);
pt
=
array_10_20_11_27
;
LineDDA
(
10
,
20
,
11
,
27
,
linedda_callback
,
(
LPARAM
)
&
pt
);
ok
(
pt
->
x
==
-
1
&&
pt
->
y
==
-
1
,
"didn't find terminator
\n
"
);
pt
=
array_20_43_10_20
;
LineDDA
(
20
,
43
,
10
,
20
,
linedda_callback
,
(
LPARAM
)
&
pt
);
ok
(
pt
->
x
==
-
1
&&
pt
->
y
==
-
1
,
"didn't find terminator
\n
"
);
pt
=
array_20_20_10_43
;
LineDDA
(
20
,
20
,
10
,
43
,
linedda_callback
,
(
LPARAM
)
&
pt
);
ok
(
pt
->
x
==
-
1
&&
pt
->
y
==
-
1
,
"didn't find terminator
\n
"
);
pt
=
array_20_20_43_10
;
LineDDA
(
20
,
20
,
43
,
10
,
linedda_callback
,
(
LPARAM
)
&
pt
);
ok
(
pt
->
x
==
-
1
&&
pt
->
y
==
-
1
,
"didn't find terminator
\n
"
);
}
START_TEST
(
path
)
{
test_widenpath
();
...
...
@@ -429,4 +510,5 @@ START_TEST(path)
test_anglearc
();
test_polydraw
();
test_closefigure
();
test_linedda
();
}
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