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
a8f45dff
Commit
a8f45dff
authored
Jul 14, 2015
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 14, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1: Implement d2d_geometry_sink_AddLines().
parent
b92a05c8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
141 additions
and
1 deletion
+141
-1
d2d1_private.h
dlls/d2d1/d2d1_private.h
+6
-1
geometry.c
dlls/d2d1/geometry.c
+0
-0
d2d1.c
dlls/d2d1/tests/d2d1.c
+135
-0
No files found.
dlls/d2d1/d2d1_private.h
View file @
a8f45dff
...
...
@@ -215,6 +215,7 @@ struct d2d_geometry
size_t
vertex_count
;
struct
d2d_face
*
faces
;
size_t
faces_size
;
size_t
face_count
;
union
...
...
@@ -223,8 +224,12 @@ struct d2d_geometry
{
ID2D1GeometrySink
ID2D1GeometrySink_iface
;
struct
d2d_figure
*
figures
;
size_t
figures_size
;
size_t
figure_count
;
enum
d2d_geometry_state
state
;
UINT32
figure_count
,
segment_count
;
UINT32
segment_count
;
}
path
;
struct
{
...
...
dlls/d2d1/geometry.c
View file @
a8f45dff
This diff is collapsed.
Click to expand it.
dlls/d2d1/tests/d2d1.c
View file @
a8f45dff
...
...
@@ -877,12 +877,14 @@ static void test_path_geometry(void)
{
ID2D1GeometrySink
*
sink
,
*
tmp_sink
;
D2D1_POINT_2F
point
=
{
0
.
0
f
,
0
.
0
f
};
ID2D1SolidColorBrush
*
brush
;
ID2D1PathGeometry
*
geometry
;
IDXGISwapChain
*
swapchain
;
ID2D1RenderTarget
*
rt
;
ID3D10Device1
*
device
;
IDXGISurface
*
surface
;
ID2D1Factory
*
factory
;
D2D1_COLOR_F
color
;
ULONG
refcount
;
UINT32
count
;
HWND
window
;
...
...
@@ -1054,6 +1056,139 @@ static void test_path_geometry(void)
ok
(
count
==
1
,
"Got unexpected segment count %u.
\n
"
,
count
);
ID2D1PathGeometry_Release
(
geometry
);
hr
=
ID2D1Factory_CreatePathGeometry
(
factory
,
&
geometry
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create path geometry, hr %#x.
\n
"
,
hr
);
hr
=
ID2D1PathGeometry_Open
(
geometry
,
&
sink
);
ok
(
SUCCEEDED
(
hr
),
"Failed to open geometry sink, hr %#x.
\n
"
,
hr
);
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
);
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
);
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
);
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
);
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
);
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
);
ID2D1GeometrySink_EndFigure
(
sink
,
D2D1_FIGURE_END_CLOSED
);
hr
=
ID2D1GeometrySink_Close
(
sink
);
ok
(
SUCCEEDED
(
hr
),
"Failed to close geometry sink, hr %#x.
\n
"
,
hr
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get figure count, hr %#x.
\n
"
,
hr
);
ok
(
count
==
6
,
"Got unexpected figure count %u.
\n
"
,
count
);
hr
=
ID2D1PathGeometry_GetSegmentCount
(
geometry
,
&
count
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get segment count, hr %#x.
\n
"
,
hr
);
/* Intersections don't create extra segments. */
ok
(
count
==
44
,
"Got unexpected segment count %u.
\n
"
,
count
);
ID2D1GeometrySink_Release
(
sink
);
ID2D1RenderTarget_SetDpi
(
rt
,
192
.
0
f
,
48
.
0
f
);
ID2D1RenderTarget_SetAntialiasMode
(
rt
,
D2D1_ANTIALIAS_MODE_ALIASED
);
set_color
(
&
color
,
0
.
890
f
,
0
.
851
f
,
0
.
600
f
,
1
.
0
f
);
hr
=
ID2D1RenderTarget_CreateSolidColorBrush
(
rt
,
&
color
,
NULL
,
&
brush
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create brush, hr %#x.
\n
"
,
hr
);
ID2D1RenderTarget_BeginDraw
(
rt
);
set_color
(
&
color
,
0
.
396
f
,
0
.
180
f
,
0
.
537
f
,
1
.
0
f
);
ID2D1RenderTarget_Clear
(
rt
,
&
color
);
ID2D1RenderTarget_FillGeometry
(
rt
,
(
ID2D1Geometry
*
)
geometry
,
(
ID2D1Brush
*
)
brush
,
NULL
);
hr
=
ID2D1RenderTarget_EndDraw
(
rt
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to end draw, hr %#x.
\n
"
,
hr
);
ok
(
compare_surface
(
surface
,
"736d9bf019bcf0be264571c1bd954f07752330ab"
),
"Surface does not match.
\n
"
);
ID2D1PathGeometry_Release
(
geometry
);
ID2D1SolidColorBrush_Release
(
brush
);
ID2D1RenderTarget_Release
(
rt
);
refcount
=
ID2D1Factory_Release
(
factory
);
ok
(
!
refcount
,
"Factory has %u references left.
\n
"
,
refcount
);
...
...
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