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
dfe1486e
Commit
dfe1486e
authored
Jul 10, 2015
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 10, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1: Implement d2d_path_geometry_GetFigureCount().
parent
ddec784a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
2 deletions
+49
-2
d2d1_private.h
dlls/d2d1/d2d1_private.h
+1
-0
geometry.c
dlls/d2d1/geometry.c
+10
-2
d2d1.c
dlls/d2d1/tests/d2d1.c
+38
-0
No files found.
dlls/d2d1/d2d1_private.h
View file @
dfe1486e
...
...
@@ -205,6 +205,7 @@ struct d2d_geometry
LONG
refcount
;
enum
d2d_geometry_state
state
;
UINT32
figure_count
;
};
void
d2d_path_geometry_init
(
struct
d2d_geometry
*
geometry
)
DECLSPEC_HIDDEN
;
...
...
dlls/d2d1/geometry.c
View file @
dfe1486e
...
...
@@ -89,6 +89,7 @@ static void STDMETHODCALLTYPE d2d_geometry_sink_BeginFigure(ID2D1GeometrySink *i
return
;
}
geometry
->
state
=
D2D_GEOMETRY_STATE_FIGURE
;
++
geometry
->
figure_count
;
}
static
void
STDMETHODCALLTYPE
d2d_geometry_sink_AddLines
(
ID2D1GeometrySink
*
iface
,
...
...
@@ -411,9 +412,16 @@ static HRESULT STDMETHODCALLTYPE d2d_path_geometry_GetSegmentCount(ID2D1PathGeom
static
HRESULT
STDMETHODCALLTYPE
d2d_path_geometry_GetFigureCount
(
ID2D1PathGeometry
*
iface
,
UINT32
*
count
)
{
FIXME
(
"iface %p, count %p stub!
\n
"
,
iface
,
count
);
struct
d2d_geometry
*
geometry
=
impl_from_ID2D1PathGeometry
(
iface
);
return
E_NOTIMPL
;
TRACE
(
"iface %p, count %p.
\n
"
,
iface
,
count
);
if
(
geometry
->
state
!=
D2D_GEOMETRY_STATE_CLOSED
)
return
D2DERR_WRONG_STATE
;
*
count
=
geometry
->
figure_count
;
return
S_OK
;
}
static
const
struct
ID2D1PathGeometryVtbl
d2d_path_geometry_vtbl
=
...
...
dlls/d2d1/tests/d2d1.c
View file @
dfe1486e
...
...
@@ -884,6 +884,7 @@ static void test_path_geometry(void)
IDXGISurface
*
surface
;
ID2D1Factory
*
factory
;
ULONG
refcount
;
UINT32
count
;
HWND
window
;
HRESULT
hr
;
...
...
@@ -904,13 +905,23 @@ static void test_path_geometry(void)
/* Close() when closed. */
hr
=
ID2D1Factory_CreatePathGeometry
(
factory
,
&
geometry
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create path geometry, hr %#x.
\n
"
,
hr
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
ID2D1PathGeometry_Open
(
geometry
,
&
sink
);
ok
(
SUCCEEDED
(
hr
),
"Failed to open geometry sink, hr %#x.
\n
"
,
hr
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
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
,
"Got unexpected figure count %u.
\n
"
,
count
);
hr
=
ID2D1GeometrySink_Close
(
sink
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ID2D1GeometrySink_Release
(
sink
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get figure count, hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got unexpected figure count %u.
\n
"
,
count
);
ID2D1PathGeometry_Release
(
geometry
);
/* Open() when closed. */
...
...
@@ -923,6 +934,9 @@ static void test_path_geometry(void)
ID2D1GeometrySink_Release
(
sink
);
hr
=
ID2D1PathGeometry_Open
(
geometry
,
&
sink
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get figure count, hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got unexpected figure count %u.
\n
"
,
count
);
ID2D1PathGeometry_Release
(
geometry
);
/* Open() when open. */
...
...
@@ -935,6 +949,9 @@ static void test_path_geometry(void)
hr
=
ID2D1GeometrySink_Close
(
sink
);
ok
(
SUCCEEDED
(
hr
),
"Failed to close geometry sink, hr %#x.
\n
"
,
hr
);
ID2D1GeometrySink_Release
(
sink
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get figure count, hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got unexpected figure count %u.
\n
"
,
count
);
ID2D1PathGeometry_Release
(
geometry
);
/* BeginFigure() without EndFigure(). */
...
...
@@ -949,6 +966,8 @@ static void test_path_geometry(void)
hr
=
ID2D1GeometrySink_Close
(
sink
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ID2D1GeometrySink_Release
(
sink
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ID2D1PathGeometry_Release
(
geometry
);
/* EndFigure() without BeginFigure(). */
...
...
@@ -960,6 +979,8 @@ static void test_path_geometry(void)
hr
=
ID2D1GeometrySink_Close
(
sink
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ID2D1GeometrySink_Release
(
sink
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ID2D1PathGeometry_Release
(
geometry
);
/* BeginFigure()/EndFigure() mismatch. */
...
...
@@ -989,6 +1010,23 @@ static void test_path_geometry(void)
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ID2D1GeometrySink_AddLine
(
sink
,
point
);
ID2D1GeometrySink_Release
(
sink
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ID2D1PathGeometry_Release
(
geometry
);
/* Empty figure. */
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
);
ID2D1GeometrySink_BeginFigure
(
sink
,
point
,
D2D1_FIGURE_BEGIN_FILLED
);
ID2D1GeometrySink_EndFigure
(
sink
,
D2D1_FIGURE_END_CLOSED
);
hr
=
ID2D1GeometrySink_Close
(
sink
);
ok
(
SUCCEEDED
(
hr
),
"Failed to close geometry sink, hr %#x.
\n
"
,
hr
);
ID2D1GeometrySink_Release
(
sink
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get figure count, hr %#x.
\n
"
,
hr
);
ok
(
count
==
1
,
"Got unexpected figure count %u.
\n
"
,
count
);
ID2D1PathGeometry_Release
(
geometry
);
ID2D1RenderTarget_Release
(
rt
);
...
...
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