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
208eb09e
Commit
208eb09e
authored
Jun 07, 2017
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1: Implement d2d_transformed_geometry_Simplify().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9b44e8b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
2 deletions
+60
-2
geometry.c
dlls/d2d1/geometry.c
+9
-2
d2d1.c
dlls/d2d1/tests/d2d1.c
+51
-0
No files found.
dlls/d2d1/geometry.c
View file @
208eb09e
...
...
@@ -3159,10 +3159,17 @@ static HRESULT STDMETHODCALLTYPE d2d_transformed_geometry_Simplify(ID2D1Transfor
D2D1_GEOMETRY_SIMPLIFICATION_OPTION
option
,
const
D2D1_MATRIX_3X2_F
*
transform
,
float
tolerance
,
ID2D1SimplifiedGeometrySink
*
sink
)
{
FIXME
(
"iface %p, option %#x, transform %p, tolerance %.8e, sink %p stub!
\n
"
,
struct
d2d_geometry
*
geometry
=
impl_from_ID2D1TransformedGeometry
(
iface
);
D2D1_MATRIX_3X2_F
g
;
TRACE
(
"iface %p, option %#x, transform %p, tolerance %.8e, sink %p.
\n
"
,
iface
,
option
,
transform
,
tolerance
,
sink
);
return
E_NOTIMPL
;
g
=
geometry
->
transform
;
if
(
transform
)
d2d_matrix_multiply
(
&
g
,
transform
);
return
ID2D1Geometry_Simplify
(
geometry
->
u
.
transformed
.
src_geometry
,
option
,
&
g
,
tolerance
,
sink
);
}
static
HRESULT
STDMETHODCALLTYPE
d2d_transformed_geometry_Tessellate
(
ID2D1TransformedGeometry
*
iface
,
...
...
dlls/d2d1/tests/d2d1.c
View file @
208eb09e
...
...
@@ -2154,6 +2154,22 @@ static void test_rectangle_geometry(void)
{
SEGMENT_LINE
,
{{{
35
.
0
f
,
45
.
0
f
}}}},
{
SEGMENT_LINE
,
{{{
35
.
0
f
,
45
.
0
f
}}}},
{
SEGMENT_LINE
,
{{{
30
.
0
f
,
45
.
0
f
}}}},
/* Figure 4. */
{
SEGMENT_LINE
,
{{{
1.07179585e+01
f
,
2.23205078e+02
f
}}}},
{
SEGMENT_LINE
,
{{{
-
5.85640755e+01
f
,
2.73205078e+02
f
}}}},
{
SEGMENT_LINE
,
{{{
-
7.85640717e+01
f
,
2.29903809e+02
f
}}}},
/* Figure 5. */
{
SEGMENT_LINE
,
{{{
40
.
0
f
,
20
.
0
f
}}}},
{
SEGMENT_LINE
,
{{{
40
.
0
f
,
40
.
0
f
}}}},
{
SEGMENT_LINE
,
{{{
30
.
0
f
,
40
.
0
f
}}}},
/* Figure 6. */
{
SEGMENT_LINE
,
{{{
2.14359169e+01
f
,
0
.
0
f
}}}},
{
SEGMENT_LINE
,
{{{
-
1.17128151e+02
f
,
0
.
0
f
}}}},
{
SEGMENT_LINE
,
{{{
-
1.57128143e+02
f
,
0
.
0
f
}}}},
/* Figure 7. */
{
SEGMENT_LINE
,
{{{
0
.
0
f
,
1.11602539e+02
f
}}}},
{
SEGMENT_LINE
,
{{{
0
.
0
f
,
1.36602539e+02
f
}}}},
{
SEGMENT_LINE
,
{{{
0
.
0
f
,
1.14951904e+02
f
}}}},
};
static
const
struct
expected_geometry_figure
expected_figures
[]
=
{
...
...
@@ -2161,6 +2177,11 @@ static void test_rectangle_geometry(void)
{
D2D1_FIGURE_BEGIN_FILLED
,
D2D1_FIGURE_END_CLOSED
,
{
20
.
0
f
,
30
.
0
f
},
3
,
&
expected_segments
[
3
]},
{
D2D1_FIGURE_BEGIN_FILLED
,
D2D1_FIGURE_END_CLOSED
,
{
25
.
0
f
,
15
.
0
f
},
3
,
&
expected_segments
[
6
]},
{
D2D1_FIGURE_BEGIN_FILLED
,
D2D1_FIGURE_END_CLOSED
,
{
30
.
0
f
,
45
.
0
f
},
3
,
&
expected_segments
[
9
]},
{
D2D1_FIGURE_BEGIN_FILLED
,
D2D1_FIGURE_END_CLOSED
,
{
-
9.28203964e+00
f
,
1.79903809e+02
f
},
3
,
&
expected_segments
[
12
]},
{
D2D1_FIGURE_BEGIN_FILLED
,
D2D1_FIGURE_END_CLOSED
,
{
30
.
0
f
,
20
.
0
f
},
3
,
&
expected_segments
[
15
]},
{
D2D1_FIGURE_BEGIN_FILLED
,
D2D1_FIGURE_END_CLOSED
,
{
-
1.85640793e+01
f
,
0
.
0
f
},
3
,
&
expected_segments
[
18
]},
{
D2D1_FIGURE_BEGIN_FILLED
,
D2D1_FIGURE_END_CLOSED
,
{
0
.
0
f
,
8.99519043e+01
f
},
3
,
&
expected_segments
[
21
]},
};
hr
=
D2D1CreateFactory
(
D2D1_FACTORY_TYPE_SINGLE_THREADED
,
&
IID_ID2D1Factory
,
NULL
,
(
void
**
)
&
factory
);
...
...
@@ -2322,6 +2343,18 @@ static void test_rectangle_geometry(void)
match
=
compare_rect
(
&
rect
,
-
7.85640717e+01
f
,
1.79903809e+02
f
,
1.07179594e+01
f
,
2.73205078e+02
f
,
1
);
ok
(
match
,
"Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}.
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
geometry_sink_init
(
&
sink
);
hr
=
ID2D1TransformedGeometry_Simplify
(
transformed_geometry
,
D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES
,
NULL
,
0
.
0
f
,
&
sink
.
ID2D1SimplifiedGeometrySink_iface
);
ok
(
SUCCEEDED
(
hr
),
"Failed to simplify geometry, hr %#x.
\n
"
,
hr
);
geometry_sink_check
(
&
sink
,
D2D1_FILL_MODE_ALTERNATE
,
1
,
&
expected_figures
[
4
],
1
);
geometry_sink_cleanup
(
&
sink
);
geometry_sink_init
(
&
sink
);
hr
=
ID2D1TransformedGeometry_Simplify
(
transformed_geometry
,
D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES
,
NULL
,
0
.
0
f
,
&
sink
.
ID2D1SimplifiedGeometrySink_iface
);
ok
(
SUCCEEDED
(
hr
),
"Failed to simplify geometry, hr %#x.
\n
"
,
hr
);
geometry_sink_check
(
&
sink
,
D2D1_FILL_MODE_ALTERNATE
,
1
,
&
expected_figures
[
4
],
1
);
geometry_sink_cleanup
(
&
sink
);
set_matrix_identity
(
&
matrix
);
rotate_matrix
(
&
matrix
,
M_PI
/
-
3
.
0
f
);
...
...
@@ -2331,6 +2364,12 @@ static void test_rectangle_geometry(void)
match
=
compare_rect
(
&
rect
,
30
.
0
f
,
20
.
0
f
,
40
.
0
f
,
40
.
0
f
,
2
);
ok
(
match
,
"Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}.
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
geometry_sink_init
(
&
sink
);
hr
=
ID2D1TransformedGeometry_Simplify
(
transformed_geometry
,
D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES
,
&
matrix
,
0
.
0
f
,
&
sink
.
ID2D1SimplifiedGeometrySink_iface
);
ok
(
SUCCEEDED
(
hr
),
"Failed to simplify geometry, hr %#x.
\n
"
,
hr
);
geometry_sink_check
(
&
sink
,
D2D1_FILL_MODE_ALTERNATE
,
1
,
&
expected_figures
[
5
],
4
);
geometry_sink_cleanup
(
&
sink
);
set_matrix_identity
(
&
matrix
);
scale_matrix
(
&
matrix
,
2
.
0
f
,
0
.
0
f
);
...
...
@@ -2339,6 +2378,12 @@ static void test_rectangle_geometry(void)
match
=
compare_rect
(
&
rect
,
-
1.57128143e+02
f
,
0.00000000e+00
f
,
2.14359188e+01
f
,
0.00000000e+00
f
,
1
);
ok
(
match
,
"Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}.
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
geometry_sink_init
(
&
sink
);
hr
=
ID2D1TransformedGeometry_Simplify
(
transformed_geometry
,
D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES
,
&
matrix
,
0
.
0
f
,
&
sink
.
ID2D1SimplifiedGeometrySink_iface
);
ok
(
SUCCEEDED
(
hr
),
"Failed to simplify geometry, hr %#x.
\n
"
,
hr
);
geometry_sink_check
(
&
sink
,
D2D1_FILL_MODE_ALTERNATE
,
1
,
&
expected_figures
[
6
],
1
);
geometry_sink_cleanup
(
&
sink
);
set_matrix_identity
(
&
matrix
);
scale_matrix
(
&
matrix
,
0
.
0
f
,
0
.
5
f
);
...
...
@@ -2347,6 +2392,12 @@ static void test_rectangle_geometry(void)
match
=
compare_rect
(
&
rect
,
0.00000000e+00
f
,
8.99519043e+01
f
,
0.00000000e+00
,
1.36602539e+02
f
,
1
);
ok
(
match
,
"Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}.
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
geometry_sink_init
(
&
sink
);
hr
=
ID2D1TransformedGeometry_Simplify
(
transformed_geometry
,
D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES
,
&
matrix
,
0
.
0
f
,
&
sink
.
ID2D1SimplifiedGeometrySink_iface
);
ok
(
SUCCEEDED
(
hr
),
"Failed to simplify geometry, hr %#x.
\n
"
,
hr
);
geometry_sink_check
(
&
sink
,
D2D1_FILL_MODE_ALTERNATE
,
1
,
&
expected_figures
[
7
],
1
);
geometry_sink_cleanup
(
&
sink
);
ID2D1TransformedGeometry_Release
(
transformed_geometry
);
ID2D1RectangleGeometry_Release
(
geometry
);
...
...
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