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
169140cc
Commit
169140cc
authored
Aug 03, 2008
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 04, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implemented GdipAddPathCurve2 with tests.
parent
2fb0c7e6
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
122 additions
and
1 deletion
+122
-1
gdiplus.spec
dlls/gdiplus/gdiplus.spec
+1
-1
graphicspath.c
dlls/gdiplus/graphicspath.c
+51
-0
graphicspath.c
dlls/gdiplus/tests/graphicspath.c
+69
-0
gdiplusflat.h
include/gdiplusflat.h
+1
-0
No files found.
dlls/gdiplus/gdiplus.spec
View file @
169140cc
...
...
@@ -8,7 +8,7 @@
@ stub GdipAddPathClosedCurve2I
@ stub GdipAddPathClosedCurve
@ stub GdipAddPathClosedCurveI
@ st
ub GdipAddPathCurve2
@ st
dcall GdipAddPathCurve2(ptr ptr long long)
@ stub GdipAddPathCurve2I
@ stub GdipAddPathCurve3
@ stub GdipAddPathCurve3I
...
...
dlls/gdiplus/graphicspath.c
View file @
169140cc
...
...
@@ -196,6 +196,57 @@ GpStatus WINGDIPAPI GdipAddPathBeziersI(GpPath *path, GDIPCONST GpPoint *points,
return
ret
;
}
GpStatus
WINGDIPAPI
GdipAddPathCurve2
(
GpPath
*
path
,
GDIPCONST
GpPointF
*
points
,
INT
count
,
REAL
tension
)
{
INT
i
,
len_pt
=
count
*
3
-
2
;
GpPointF
*
pt
;
REAL
x1
,
x2
,
y1
,
y2
;
GpStatus
stat
;
if
(
!
path
||
!
points
||
count
<=
1
)
return
InvalidParameter
;
pt
=
GdipAlloc
(
len_pt
*
sizeof
(
GpPointF
));
if
(
!
pt
)
return
OutOfMemory
;
tension
=
tension
*
TENSION_CONST
;
calc_curve_bezier_endp
(
points
[
0
].
X
,
points
[
0
].
Y
,
points
[
1
].
X
,
points
[
1
].
Y
,
tension
,
&
x1
,
&
y1
);
pt
[
0
].
X
=
points
[
0
].
X
;
pt
[
0
].
Y
=
points
[
0
].
Y
;
pt
[
1
].
X
=
x1
;
pt
[
1
].
Y
=
y1
;
for
(
i
=
0
;
i
<
count
-
2
;
i
++
){
calc_curve_bezier
(
&
(
points
[
i
]),
tension
,
&
x1
,
&
y1
,
&
x2
,
&
y2
);
pt
[
3
*
i
+
2
].
X
=
x1
;
pt
[
3
*
i
+
2
].
Y
=
y1
;
pt
[
3
*
i
+
3
].
X
=
points
[
i
+
1
].
X
;
pt
[
3
*
i
+
3
].
Y
=
points
[
i
+
1
].
Y
;
pt
[
3
*
i
+
4
].
X
=
x2
;
pt
[
3
*
i
+
4
].
Y
=
y2
;
}
calc_curve_bezier_endp
(
points
[
count
-
1
].
X
,
points
[
count
-
1
].
Y
,
points
[
count
-
2
].
X
,
points
[
count
-
2
].
Y
,
tension
,
&
x1
,
&
y1
);
pt
[
len_pt
-
2
].
X
=
x1
;
pt
[
len_pt
-
2
].
Y
=
y1
;
pt
[
len_pt
-
1
].
X
=
points
[
count
-
1
].
X
;
pt
[
len_pt
-
1
].
Y
=
points
[
count
-
1
].
Y
;
stat
=
GdipAddPathBeziers
(
path
,
pt
,
len_pt
);
GdipFree
(
pt
);
return
stat
;
}
GpStatus
WINGDIPAPI
GdipAddPathEllipse
(
GpPath
*
path
,
REAL
x
,
REAL
y
,
REAL
width
,
REAL
height
)
{
...
...
dlls/gdiplus/tests/graphicspath.c
View file @
169140cc
...
...
@@ -696,6 +696,74 @@ static void test_lastpoint(void)
GdipDeletePath
(
path
);
}
static
path_test_t
addcurve_path
[]
=
{
{
0
.
0
,
0
.
0
,
PathPointTypeStart
,
0
,
0
},
/*0*/
{
3
.
3
,
3
.
3
,
PathPointTypeBezier
,
0
,
0
},
/*1*/
{
6
.
7
,
3
.
3
,
PathPointTypeBezier
,
0
,
0
},
/*2*/
{
10
.
0
,
10
.
0
,
PathPointTypeBezier
,
0
,
0
},
/*3*/
{
13
.
3
,
16
.
7
,
PathPointTypeBezier
,
0
,
0
},
/*4*/
{
3
.
3
,
20
.
0
,
PathPointTypeBezier
,
0
,
0
},
/*5*/
{
10
.
0
,
20
.
0
,
PathPointTypeBezier
,
0
,
0
},
/*6*/
{
16
.
7
,
20
.
0
,
PathPointTypeBezier
,
0
,
0
},
/*7*/
{
23
.
3
,
13
.
3
,
PathPointTypeBezier
,
0
,
0
},
/*8*/
{
30
.
0
,
10
.
0
,
PathPointTypeBezier
,
0
,
0
}
/*9*/
};
static
path_test_t
addcurve_path2
[]
=
{
{
100
.
0
,
120
.
0
,
PathPointTypeStart
,
0
,
0
},
/*0*/
{
123
.
0
,
10
.
0
,
PathPointTypeLine
,
0
,
0
},
/*1*/
{
0
.
0
,
0
.
0
,
PathPointTypeLine
,
0
,
0
},
/*2*/
{
3
.
3
,
3
.
3
,
PathPointTypeBezier
,
0
,
0
},
/*3*/
{
6
.
7
,
3
.
3
,
PathPointTypeBezier
,
0
,
0
},
/*4*/
{
10
.
0
,
10
.
0
,
PathPointTypeBezier
,
0
,
0
},
/*5*/
{
13
.
3
,
16
.
7
,
PathPointTypeBezier
,
0
,
0
},
/*6*/
{
3
.
3
,
20
.
0
,
PathPointTypeBezier
,
0
,
0
},
/*7*/
{
10
.
0
,
20
.
0
,
PathPointTypeBezier
,
0
,
0
},
/*8*/
{
16
.
7
,
20
.
0
,
PathPointTypeBezier
,
0
,
0
},
/*9*/
{
23
.
3
,
13
.
3
,
PathPointTypeBezier
,
0
,
0
},
/*10*/
{
30
.
0
,
10
.
0
,
PathPointTypeBezier
,
0
,
0
}
/*11*/
};
static
void
test_addcurve
(
void
)
{
GpStatus
status
;
GpPath
*
path
;
GpPointF
points
[
4
];
points
[
0
].
X
=
0
.
0
;
points
[
0
].
Y
=
0
.
0
;
points
[
1
].
X
=
10
.
0
;
points
[
1
].
Y
=
10
.
0
;
points
[
2
].
X
=
10
.
0
;
points
[
2
].
Y
=
20
.
0
;
points
[
3
].
X
=
30
.
0
;
points
[
3
].
Y
=
10
.
0
;
GdipCreatePath
(
FillModeAlternate
,
&
path
);
/* NULL args */
status
=
GdipAddPathCurve2
(
NULL
,
NULL
,
0
,
0
.
0
);
expect
(
InvalidParameter
,
status
);
status
=
GdipAddPathCurve2
(
path
,
NULL
,
0
,
0
.
0
);
expect
(
InvalidParameter
,
status
);
status
=
GdipAddPathCurve2
(
path
,
points
,
-
1
,
0
.
0
);
expect
(
InvalidParameter
,
status
);
status
=
GdipAddPathCurve2
(
path
,
points
,
1
,
1
.
0
);
expect
(
InvalidParameter
,
status
);
/* add to empty path */
status
=
GdipAddPathCurve2
(
path
,
points
,
4
,
1
.
0
);
expect
(
Ok
,
status
);
ok_path
(
path
,
addcurve_path
,
sizeof
(
addcurve_path
)
/
sizeof
(
path_test_t
),
FALSE
);
GdipDeletePath
(
path
);
/* add to notempty path and opened figure */
GdipCreatePath
(
FillModeAlternate
,
&
path
);
GdipAddPathLine
(
path
,
100
.
0
,
120
.
0
,
123
.
0
,
10
.
0
);
status
=
GdipAddPathCurve2
(
path
,
points
,
4
,
1
.
0
);
expect
(
Ok
,
status
);
ok_path
(
path
,
addcurve_path2
,
sizeof
(
addcurve_path2
)
/
sizeof
(
path_test_t
),
FALSE
);
GdipDeletePath
(
path
);
}
START_TEST
(
graphicspath
)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
...
@@ -719,6 +787,7 @@ START_TEST(graphicspath)
test_rect
();
test_polygon
();
test_lastpoint
();
test_addcurve
();
GdiplusShutdown
(
gdiplusToken
);
}
include/gdiplusflat.h
View file @
169140cc
...
...
@@ -246,6 +246,7 @@ GpStatus WINGDIPAPI GdipAddPathBezier(GpPath*,REAL,REAL,REAL,REAL,REAL,REAL,REAL
GpStatus
WINGDIPAPI
GdipAddPathBezierI
(
GpPath
*
,
INT
,
INT
,
INT
,
INT
,
INT
,
INT
,
INT
,
INT
);
GpStatus
WINGDIPAPI
GdipAddPathBeziers
(
GpPath
*
,
GDIPCONST
GpPointF
*
,
INT
);
GpStatus
WINGDIPAPI
GdipAddPathBeziersI
(
GpPath
*
,
GDIPCONST
GpPoint
*
,
INT
);
GpStatus
WINGDIPAPI
GdipAddPathCurve2
(
GpPath
*
,
GDIPCONST
GpPointF
*
,
INT
,
REAL
);
GpStatus
WINGDIPAPI
GdipAddPathEllipse
(
GpPath
*
,
REAL
,
REAL
,
REAL
,
REAL
);
GpStatus
WINGDIPAPI
GdipAddPathEllipseI
(
GpPath
*
,
INT
,
INT
,
INT
,
INT
);
GpStatus
WINGDIPAPI
GdipAddPathLine
(
GpPath
*
,
REAL
,
REAL
,
REAL
,
REAL
);
...
...
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