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
a8dc7cc1
Commit
a8dc7cc1
authored
Dec 05, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 05, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1/tests: Introduce a helper function to add lines to a geometry sink.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
70e68e12
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
84 deletions
+50
-84
d2d1.c
dlls/d2d1/tests/d2d1.c
+50
-84
No files found.
dlls/d2d1/tests/d2d1.c
View file @
a8dc7cc1
...
...
@@ -130,6 +130,14 @@ static void translate_matrix(D2D1_MATRIX_3X2_F *matrix, float x, float y)
matrix
->
_32
+=
x
*
matrix
->
_12
+
y
*
matrix
->
_22
;
}
static
void
line_to
(
ID2D1GeometrySink
*
sink
,
float
x
,
float
y
)
{
D2D1_POINT_2F
point
;
set_point
(
&
point
,
x
,
y
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
}
static
BOOL
compare_float
(
float
f
,
float
g
,
unsigned
int
ulps
)
{
int
x
=
*
(
int
*
)
&
f
;
...
...
@@ -1187,99 +1195,61 @@ static void fill_geometry_sink(ID2D1GeometrySink *sink)
set_point
(
&
point
,
15
.
0
f
,
20
.
0
f
);
ID2D1GeometrySink_BeginFigure
(
sink
,
point
,
D2D1_FIGURE_BEGIN_FILLED
);
set_point
(
&
point
,
55
.
0
f
,
20
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
55
.
0
f
,
220
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
25
.
0
f
,
220
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
25
.
0
f
,
100
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
75
.
0
f
,
100
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
75
.
0
f
,
300
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
5
.
0
f
,
300
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
5
.
0
f
,
60
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
45
.
0
f
,
60
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
45
.
0
f
,
180
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
35
.
0
f
,
180
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
35
.
0
f
,
140
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
65
.
0
f
,
140
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
65
.
0
f
,
260
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
15
.
0
f
,
260
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
line_to
(
sink
,
55
.
0
f
,
20
.
0
f
);
line_to
(
sink
,
55
.
0
f
,
220
.
0
f
);
line_to
(
sink
,
25
.
0
f
,
220
.
0
f
);
line_to
(
sink
,
25
.
0
f
,
100
.
0
f
);
line_to
(
sink
,
75
.
0
f
,
100
.
0
f
);
line_to
(
sink
,
75
.
0
f
,
300
.
0
f
);
line_to
(
sink
,
5
.
0
f
,
300
.
0
f
);
line_to
(
sink
,
5
.
0
f
,
60
.
0
f
);
line_to
(
sink
,
45
.
0
f
,
60
.
0
f
);
line_to
(
sink
,
45
.
0
f
,
180
.
0
f
);
line_to
(
sink
,
35
.
0
f
,
180
.
0
f
);
line_to
(
sink
,
35
.
0
f
,
140
.
0
f
);
line_to
(
sink
,
65
.
0
f
,
140
.
0
f
);
line_to
(
sink
,
65
.
0
f
,
260
.
0
f
);
line_to
(
sink
,
15
.
0
f
,
260
.
0
f
);
ID2D1GeometrySink_EndFigure
(
sink
,
D2D1_FIGURE_END_CLOSED
);
set_point
(
&
point
,
155
.
0
f
,
300
.
0
f
);
ID2D1GeometrySink_BeginFigure
(
sink
,
point
,
D2D1_FIGURE_BEGIN_FILLED
);
set_point
(
&
point
,
155
.
0
f
,
160
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
85
.
0
f
,
160
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
85
.
0
f
,
300
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
120
.
0
f
,
300
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
120
.
0
f
,
20
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
155
.
0
f
,
20
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
155
.
0
f
,
160
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
85
.
0
f
,
160
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
85
.
0
f
,
20
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
120
.
0
f
,
20
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
120
.
0
f
,
300
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
line_to
(
sink
,
155
.
0
f
,
160
.
0
f
);
line_to
(
sink
,
85
.
0
f
,
160
.
0
f
);
line_to
(
sink
,
85
.
0
f
,
300
.
0
f
);
line_to
(
sink
,
120
.
0
f
,
300
.
0
f
);
line_to
(
sink
,
120
.
0
f
,
20
.
0
f
);
line_to
(
sink
,
155
.
0
f
,
20
.
0
f
);
line_to
(
sink
,
155
.
0
f
,
160
.
0
f
);
line_to
(
sink
,
85
.
0
f
,
160
.
0
f
);
line_to
(
sink
,
85
.
0
f
,
20
.
0
f
);
line_to
(
sink
,
120
.
0
f
,
20
.
0
f
);
line_to
(
sink
,
120
.
0
f
,
300
.
0
f
);
ID2D1GeometrySink_EndFigure
(
sink
,
D2D1_FIGURE_END_CLOSED
);
set_point
(
&
point
,
165
.
0
f
,
20
.
0
f
);
ID2D1GeometrySink_BeginFigure
(
sink
,
point
,
D2D1_FIGURE_BEGIN_FILLED
);
set_point
(
&
point
,
165
.
0
f
,
300
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
235
.
0
f
,
300
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
235
.
0
f
,
20
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
line_to
(
sink
,
165
.
0
f
,
300
.
0
f
);
line_to
(
sink
,
235
.
0
f
,
300
.
0
f
);
line_to
(
sink
,
235
.
0
f
,
20
.
0
f
);
ID2D1GeometrySink_EndFigure
(
sink
,
D2D1_FIGURE_END_CLOSED
);
set_point
(
&
point
,
225
.
0
f
,
60
.
0
f
);
ID2D1GeometrySink_BeginFigure
(
sink
,
point
,
D2D1_FIGURE_BEGIN_FILLED
);
set_point
(
&
point
,
225
.
0
f
,
260
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
175
.
0
f
,
260
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
175
.
0
f
,
60
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
line_to
(
sink
,
225
.
0
f
,
260
.
0
f
);
line_to
(
sink
,
175
.
0
f
,
260
.
0
f
);
line_to
(
sink
,
175
.
0
f
,
60
.
0
f
);
ID2D1GeometrySink_EndFigure
(
sink
,
D2D1_FIGURE_END_CLOSED
);
set_point
(
&
point
,
215
.
0
f
,
220
.
0
f
);
ID2D1GeometrySink_BeginFigure
(
sink
,
point
,
D2D1_FIGURE_BEGIN_FILLED
);
set_point
(
&
point
,
185
.
0
f
,
220
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
185
.
0
f
,
100
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
215
.
0
f
,
100
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
line_to
(
sink
,
185
.
0
f
,
220
.
0
f
);
line_to
(
sink
,
185
.
0
f
,
100
.
0
f
);
line_to
(
sink
,
215
.
0
f
,
100
.
0
f
);
ID2D1GeometrySink_EndFigure
(
sink
,
D2D1_FIGURE_END_CLOSED
);
set_point
(
&
point
,
195
.
0
f
,
180
.
0
f
);
ID2D1GeometrySink_BeginFigure
(
sink
,
point
,
D2D1_FIGURE_BEGIN_FILLED
);
set_point
(
&
point
,
205
.
0
f
,
180
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
205
.
0
f
,
140
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
195
.
0
f
,
140
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
line_to
(
sink
,
205
.
0
f
,
180
.
0
f
);
line_to
(
sink
,
205
.
0
f
,
140
.
0
f
);
line_to
(
sink
,
195
.
0
f
,
140
.
0
f
);
ID2D1GeometrySink_EndFigure
(
sink
,
D2D1_FIGURE_END_CLOSED
);
}
...
...
@@ -1719,18 +1689,14 @@ static void test_path_geometry(void)
set_point
(
&
point
,
40
.
0
f
,
20
.
0
f
);
ID2D1GeometrySink_BeginFigure
(
sink
,
point
,
D2D1_FIGURE_BEGIN_FILLED
);
set_point
(
&
point
,
75
.
0
f
,
300
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
5
.
0
f
,
300
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
line_to
(
sink
,
75
.
0
f
,
300
.
0
f
);
line_to
(
sink
,
5
.
0
f
,
300
.
0
f
);
ID2D1GeometrySink_EndFigure
(
sink
,
D2D1_FIGURE_END_CLOSED
);
set_point
(
&
point
,
40
.
0
f
,
290
.
0
f
);
ID2D1GeometrySink_BeginFigure
(
sink
,
point
,
D2D1_FIGURE_BEGIN_FILLED
);
set_point
(
&
point
,
55
.
0
f
,
160
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
set_point
(
&
point
,
25
.
0
f
,
160
.
0
f
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
line_to
(
sink
,
55
.
0
f
,
160
.
0
f
);
line_to
(
sink
,
25
.
0
f
,
160
.
0
f
);
ID2D1GeometrySink_EndFigure
(
sink
,
D2D1_FIGURE_END_CLOSED
);
hr
=
ID2D1GeometrySink_Close
(
sink
);
...
...
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