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
b108a2ff
Commit
b108a2ff
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_GetSegmentCount().
parent
dfe1486e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
3 deletions
+56
-3
d2d1_private.h
dlls/d2d1/d2d1_private.h
+1
-1
geometry.c
dlls/d2d1/geometry.c
+30
-2
d2d1.c
dlls/d2d1/tests/d2d1.c
+25
-0
No files found.
dlls/d2d1/d2d1_private.h
View file @
b108a2ff
...
@@ -205,7 +205,7 @@ struct d2d_geometry
...
@@ -205,7 +205,7 @@ struct d2d_geometry
LONG
refcount
;
LONG
refcount
;
enum
d2d_geometry_state
state
;
enum
d2d_geometry_state
state
;
UINT32
figure_count
;
UINT32
figure_count
,
segment_count
;
};
};
void
d2d_path_geometry_init
(
struct
d2d_geometry
*
geometry
)
DECLSPEC_HIDDEN
;
void
d2d_path_geometry_init
(
struct
d2d_geometry
*
geometry
)
DECLSPEC_HIDDEN
;
...
...
dlls/d2d1/geometry.c
View file @
b108a2ff
...
@@ -90,6 +90,7 @@ static void STDMETHODCALLTYPE d2d_geometry_sink_BeginFigure(ID2D1GeometrySink *i
...
@@ -90,6 +90,7 @@ static void STDMETHODCALLTYPE d2d_geometry_sink_BeginFigure(ID2D1GeometrySink *i
}
}
geometry
->
state
=
D2D_GEOMETRY_STATE_FIGURE
;
geometry
->
state
=
D2D_GEOMETRY_STATE_FIGURE
;
++
geometry
->
figure_count
;
++
geometry
->
figure_count
;
++
geometry
->
segment_count
;
}
}
static
void
STDMETHODCALLTYPE
d2d_geometry_sink_AddLines
(
ID2D1GeometrySink
*
iface
,
static
void
STDMETHODCALLTYPE
d2d_geometry_sink_AddLines
(
ID2D1GeometrySink
*
iface
,
...
@@ -100,7 +101,12 @@ static void STDMETHODCALLTYPE d2d_geometry_sink_AddLines(ID2D1GeometrySink *ifac
...
@@ -100,7 +101,12 @@ static void STDMETHODCALLTYPE d2d_geometry_sink_AddLines(ID2D1GeometrySink *ifac
FIXME
(
"iface %p, points %p, count %u stub!
\n
"
,
iface
,
points
,
count
);
FIXME
(
"iface %p, points %p, count %u stub!
\n
"
,
iface
,
points
,
count
);
if
(
geometry
->
state
!=
D2D_GEOMETRY_STATE_FIGURE
)
if
(
geometry
->
state
!=
D2D_GEOMETRY_STATE_FIGURE
)
{
geometry
->
state
=
D2D_GEOMETRY_STATE_ERROR
;
geometry
->
state
=
D2D_GEOMETRY_STATE_ERROR
;
return
;
}
geometry
->
segment_count
+=
count
;
}
}
static
void
STDMETHODCALLTYPE
d2d_geometry_sink_AddBeziers
(
ID2D1GeometrySink
*
iface
,
static
void
STDMETHODCALLTYPE
d2d_geometry_sink_AddBeziers
(
ID2D1GeometrySink
*
iface
,
...
@@ -111,7 +117,12 @@ static void STDMETHODCALLTYPE d2d_geometry_sink_AddBeziers(ID2D1GeometrySink *if
...
@@ -111,7 +117,12 @@ static void STDMETHODCALLTYPE d2d_geometry_sink_AddBeziers(ID2D1GeometrySink *if
FIXME
(
"iface %p, beziers %p, count %u stub!
\n
"
,
iface
,
beziers
,
count
);
FIXME
(
"iface %p, beziers %p, count %u stub!
\n
"
,
iface
,
beziers
,
count
);
if
(
geometry
->
state
!=
D2D_GEOMETRY_STATE_FIGURE
)
if
(
geometry
->
state
!=
D2D_GEOMETRY_STATE_FIGURE
)
{
geometry
->
state
=
D2D_GEOMETRY_STATE_ERROR
;
geometry
->
state
=
D2D_GEOMETRY_STATE_ERROR
;
return
;
}
geometry
->
segment_count
+=
count
;
}
}
static
void
STDMETHODCALLTYPE
d2d_geometry_sink_EndFigure
(
ID2D1GeometrySink
*
iface
,
D2D1_FIGURE_END
figure_end
)
static
void
STDMETHODCALLTYPE
d2d_geometry_sink_EndFigure
(
ID2D1GeometrySink
*
iface
,
D2D1_FIGURE_END
figure_end
)
...
@@ -175,7 +186,12 @@ static void STDMETHODCALLTYPE d2d_geometry_sink_AddQuadraticBeziers(ID2D1Geometr
...
@@ -175,7 +186,12 @@ static void STDMETHODCALLTYPE d2d_geometry_sink_AddQuadraticBeziers(ID2D1Geometr
FIXME
(
"iface %p, beziers %p, bezier_count %u stub!
\n
"
,
iface
,
beziers
,
bezier_count
);
FIXME
(
"iface %p, beziers %p, bezier_count %u stub!
\n
"
,
iface
,
beziers
,
bezier_count
);
if
(
geometry
->
state
!=
D2D_GEOMETRY_STATE_FIGURE
)
if
(
geometry
->
state
!=
D2D_GEOMETRY_STATE_FIGURE
)
{
geometry
->
state
=
D2D_GEOMETRY_STATE_ERROR
;
geometry
->
state
=
D2D_GEOMETRY_STATE_ERROR
;
return
;
}
geometry
->
segment_count
+=
bezier_count
;
}
}
static
void
STDMETHODCALLTYPE
d2d_geometry_sink_AddArc
(
ID2D1GeometrySink
*
iface
,
const
D2D1_ARC_SEGMENT
*
arc
)
static
void
STDMETHODCALLTYPE
d2d_geometry_sink_AddArc
(
ID2D1GeometrySink
*
iface
,
const
D2D1_ARC_SEGMENT
*
arc
)
...
@@ -185,7 +201,12 @@ static void STDMETHODCALLTYPE d2d_geometry_sink_AddArc(ID2D1GeometrySink *iface,
...
@@ -185,7 +201,12 @@ static void STDMETHODCALLTYPE d2d_geometry_sink_AddArc(ID2D1GeometrySink *iface,
FIXME
(
"iface %p, arc %p stub!
\n
"
,
iface
,
arc
);
FIXME
(
"iface %p, arc %p stub!
\n
"
,
iface
,
arc
);
if
(
geometry
->
state
!=
D2D_GEOMETRY_STATE_FIGURE
)
if
(
geometry
->
state
!=
D2D_GEOMETRY_STATE_FIGURE
)
{
geometry
->
state
=
D2D_GEOMETRY_STATE_ERROR
;
geometry
->
state
=
D2D_GEOMETRY_STATE_ERROR
;
return
;
}
++
geometry
->
segment_count
;
}
}
struct
ID2D1GeometrySinkVtbl
d2d_geometry_sink_vtbl
=
struct
ID2D1GeometrySinkVtbl
d2d_geometry_sink_vtbl
=
...
@@ -405,9 +426,16 @@ static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Stream(ID2D1PathGeometry *ifa
...
@@ -405,9 +426,16 @@ static HRESULT STDMETHODCALLTYPE d2d_path_geometry_Stream(ID2D1PathGeometry *ifa
static
HRESULT
STDMETHODCALLTYPE
d2d_path_geometry_GetSegmentCount
(
ID2D1PathGeometry
*
iface
,
UINT32
*
count
)
static
HRESULT
STDMETHODCALLTYPE
d2d_path_geometry_GetSegmentCount
(
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
->
segment_count
;
return
S_OK
;
}
}
static
HRESULT
STDMETHODCALLTYPE
d2d_path_geometry_GetFigureCount
(
ID2D1PathGeometry
*
iface
,
UINT32
*
count
)
static
HRESULT
STDMETHODCALLTYPE
d2d_path_geometry_GetFigureCount
(
ID2D1PathGeometry
*
iface
,
UINT32
*
count
)
...
...
dlls/d2d1/tests/d2d1.c
View file @
b108a2ff
...
@@ -907,21 +907,31 @@ static void test_path_geometry(void)
...
@@ -907,21 +907,31 @@ static void test_path_geometry(void)
ok
(
SUCCEEDED
(
hr
),
"Failed to create path geometry, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create path geometry, hr %#x.
\n
"
,
hr
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
ID2D1PathGeometry_GetSegmentCount
(
geometry
,
&
count
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
ID2D1PathGeometry_Open
(
geometry
,
&
sink
);
hr
=
ID2D1PathGeometry_Open
(
geometry
,
&
sink
);
ok
(
SUCCEEDED
(
hr
),
"Failed to open geometry sink, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to open geometry sink, hr %#x.
\n
"
,
hr
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
ID2D1PathGeometry_GetSegmentCount
(
geometry
,
&
count
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
ID2D1GeometrySink_Close
(
sink
);
hr
=
ID2D1GeometrySink_Close
(
sink
);
ok
(
SUCCEEDED
(
hr
),
"Failed to close geometry sink, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to close geometry sink, hr %#x.
\n
"
,
hr
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get figure count, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get figure count, hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got unexpected figure count %u.
\n
"
,
count
);
ok
(
!
count
,
"Got unexpected figure count %u.
\n
"
,
count
);
hr
=
ID2D1PathGeometry_GetSegmentCount
(
geometry
,
&
count
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get segment count, hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got unexpected segment count %u.
\n
"
,
count
);
hr
=
ID2D1GeometrySink_Close
(
sink
);
hr
=
ID2D1GeometrySink_Close
(
sink
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ID2D1GeometrySink_Release
(
sink
);
ID2D1GeometrySink_Release
(
sink
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get figure count, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get figure count, hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got unexpected figure count %u.
\n
"
,
count
);
ok
(
!
count
,
"Got unexpected figure count %u.
\n
"
,
count
);
hr
=
ID2D1PathGeometry_GetSegmentCount
(
geometry
,
&
count
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get segment count, hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got unexpected segment count %u.
\n
"
,
count
);
ID2D1PathGeometry_Release
(
geometry
);
ID2D1PathGeometry_Release
(
geometry
);
/* Open() when closed. */
/* Open() when closed. */
...
@@ -937,6 +947,9 @@ static void test_path_geometry(void)
...
@@ -937,6 +947,9 @@ static void test_path_geometry(void)
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get figure count, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get figure count, hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got unexpected figure count %u.
\n
"
,
count
);
ok
(
!
count
,
"Got unexpected figure count %u.
\n
"
,
count
);
hr
=
ID2D1PathGeometry_GetSegmentCount
(
geometry
,
&
count
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get segment count, hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got unexpected segment count %u.
\n
"
,
count
);
ID2D1PathGeometry_Release
(
geometry
);
ID2D1PathGeometry_Release
(
geometry
);
/* Open() when open. */
/* Open() when open. */
...
@@ -952,6 +965,9 @@ static void test_path_geometry(void)
...
@@ -952,6 +965,9 @@ static void test_path_geometry(void)
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get figure count, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get figure count, hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got unexpected figure count %u.
\n
"
,
count
);
ok
(
!
count
,
"Got unexpected figure count %u.
\n
"
,
count
);
hr
=
ID2D1PathGeometry_GetSegmentCount
(
geometry
,
&
count
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get segment count, hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got unexpected segment count %u.
\n
"
,
count
);
ID2D1PathGeometry_Release
(
geometry
);
ID2D1PathGeometry_Release
(
geometry
);
/* BeginFigure() without EndFigure(). */
/* BeginFigure() without EndFigure(). */
...
@@ -968,6 +984,8 @@ static void test_path_geometry(void)
...
@@ -968,6 +984,8 @@ static void test_path_geometry(void)
ID2D1GeometrySink_Release
(
sink
);
ID2D1GeometrySink_Release
(
sink
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
ID2D1PathGeometry_GetSegmentCount
(
geometry
,
&
count
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ID2D1PathGeometry_Release
(
geometry
);
ID2D1PathGeometry_Release
(
geometry
);
/* EndFigure() without BeginFigure(). */
/* EndFigure() without BeginFigure(). */
...
@@ -981,6 +999,8 @@ static void test_path_geometry(void)
...
@@ -981,6 +999,8 @@ static void test_path_geometry(void)
ID2D1GeometrySink_Release
(
sink
);
ID2D1GeometrySink_Release
(
sink
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
ID2D1PathGeometry_GetSegmentCount
(
geometry
,
&
count
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ID2D1PathGeometry_Release
(
geometry
);
ID2D1PathGeometry_Release
(
geometry
);
/* BeginFigure()/EndFigure() mismatch. */
/* BeginFigure()/EndFigure() mismatch. */
...
@@ -1012,6 +1032,8 @@ static void test_path_geometry(void)
...
@@ -1012,6 +1032,8 @@ static void test_path_geometry(void)
ID2D1GeometrySink_Release
(
sink
);
ID2D1GeometrySink_Release
(
sink
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
ID2D1PathGeometry_GetSegmentCount
(
geometry
,
&
count
);
ok
(
hr
==
D2DERR_WRONG_STATE
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ID2D1PathGeometry_Release
(
geometry
);
ID2D1PathGeometry_Release
(
geometry
);
/* Empty figure. */
/* Empty figure. */
...
@@ -1027,6 +1049,9 @@ static void test_path_geometry(void)
...
@@ -1027,6 +1049,9 @@ static void test_path_geometry(void)
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
hr
=
ID2D1PathGeometry_GetFigureCount
(
geometry
,
&
count
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get figure count, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get figure count, hr %#x.
\n
"
,
hr
);
ok
(
count
==
1
,
"Got unexpected figure count %u.
\n
"
,
count
);
ok
(
count
==
1
,
"Got unexpected figure count %u.
\n
"
,
count
);
hr
=
ID2D1PathGeometry_GetSegmentCount
(
geometry
,
&
count
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get segment count, hr %#x.
\n
"
,
hr
);
ok
(
count
==
1
,
"Got unexpected segment count %u.
\n
"
,
count
);
ID2D1PathGeometry_Release
(
geometry
);
ID2D1PathGeometry_Release
(
geometry
);
ID2D1RenderTarget_Release
(
rt
);
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