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
4c0edba6
Commit
4c0edba6
authored
Jun 29, 2009
by
Andrew Eikum
Committed by
Alexandre Julliard
Jun 30, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implement GdipDrawCurve3 and GdipDrawCurve3I.
parent
d6bb2b75
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
196 additions
and
2 deletions
+196
-2
gdiplus.spec
dlls/gdiplus/gdiplus.spec
+2
-2
graphics.c
dlls/gdiplus/graphics.c
+30
-0
graphics.c
dlls/gdiplus/tests/graphics.c
+162
-0
gdiplusflat.h
include/gdiplusflat.h
+2
-0
No files found.
dlls/gdiplus/gdiplus.spec
View file @
4c0edba6
...
...
@@ -165,8 +165,8 @@
@ stdcall GdipDrawClosedCurveI(ptr ptr ptr long)
@ stdcall GdipDrawCurve2(ptr ptr ptr long long)
@ stdcall GdipDrawCurve2I(ptr ptr ptr long long)
@ st
ub GdipDrawCurve3
@ st
ub GdipDrawCurve3I
@ st
dcall GdipDrawCurve3(ptr ptr ptr long long long long)
@ st
dcall GdipDrawCurve3I(ptr ptr ptr long long long long)
@ stdcall GdipDrawCurve(ptr ptr ptr long)
@ stdcall GdipDrawCurveI(ptr ptr ptr long)
@ stdcall GdipDrawDriverString(ptr ptr long ptr ptr ptr long ptr)
...
...
dlls/gdiplus/graphics.c
View file @
4c0edba6
...
...
@@ -1532,6 +1532,36 @@ GpStatus WINGDIPAPI GdipDrawCurve2I(GpGraphics *graphics, GpPen *pen,
return
ret
;
}
GpStatus
WINGDIPAPI
GdipDrawCurve3
(
GpGraphics
*
graphics
,
GpPen
*
pen
,
GDIPCONST
GpPointF
*
points
,
INT
count
,
INT
offset
,
INT
numberOfSegments
,
REAL
tension
)
{
TRACE
(
"(%p, %p, %p, %d, %d, %d, %.2f)
\n
"
,
graphics
,
pen
,
points
,
count
,
offset
,
numberOfSegments
,
tension
);
if
(
offset
>=
count
||
numberOfSegments
>
count
-
offset
-
1
||
numberOfSegments
<=
0
){
return
InvalidParameter
;
}
return
GdipDrawCurve2
(
graphics
,
pen
,
points
+
offset
,
numberOfSegments
+
1
,
tension
);
}
GpStatus
WINGDIPAPI
GdipDrawCurve3I
(
GpGraphics
*
graphics
,
GpPen
*
pen
,
GDIPCONST
GpPoint
*
points
,
INT
count
,
INT
offset
,
INT
numberOfSegments
,
REAL
tension
)
{
TRACE
(
"(%p, %p, %p, %d, %d, %d, %.2f)
\n
"
,
graphics
,
pen
,
points
,
count
,
offset
,
numberOfSegments
,
tension
);
if
(
count
<
0
){
return
OutOfMemory
;
}
if
(
offset
>=
count
||
numberOfSegments
>
count
-
offset
-
1
||
numberOfSegments
<=
0
){
return
InvalidParameter
;
}
return
GdipDrawCurve2I
(
graphics
,
pen
,
points
+
offset
,
numberOfSegments
+
1
,
tension
);
}
GpStatus
WINGDIPAPI
GdipDrawEllipse
(
GpGraphics
*
graphics
,
GpPen
*
pen
,
REAL
x
,
REAL
y
,
REAL
width
,
REAL
height
)
{
...
...
dlls/gdiplus/tests/graphics.c
View file @
4c0edba6
...
...
@@ -361,6 +361,166 @@ static void test_GdipDrawBezierI(void)
ReleaseDC
(
0
,
hdc
);
}
static
void
test_GdipDrawCurve3
(
void
)
{
GpStatus
status
;
GpGraphics
*
graphics
=
NULL
;
GpPen
*
pen
=
NULL
;
HDC
hdc
=
GetDC
(
0
);
GpPointF
points
[
3
];
points
[
0
].
X
=
0
;
points
[
0
].
Y
=
0
;
points
[
1
].
X
=
40
;
points
[
1
].
Y
=
20
;
points
[
2
].
X
=
10
;
points
[
2
].
Y
=
40
;
/* make a graphics object and pen object */
ok
(
hdc
!=
NULL
,
"Expected HDC to be initialized
\n
"
);
status
=
GdipCreateFromHDC
(
hdc
,
&
graphics
);
expect
(
Ok
,
status
);
ok
(
graphics
!=
NULL
,
"Expected graphics to be initialized
\n
"
);
status
=
GdipCreatePen1
((
ARGB
)
0xffff00ff
,
10
.
0
f
,
UnitPixel
,
&
pen
);
expect
(
Ok
,
status
);
ok
(
pen
!=
NULL
,
"Expected pen to be initialized
\n
"
);
/* InvalidParameter cases: null graphics, null pen */
status
=
GdipDrawCurve3
(
NULL
,
NULL
,
points
,
3
,
0
,
2
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipDrawCurve3
(
graphics
,
NULL
,
points
,
3
,
0
,
2
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipDrawCurve3
(
NULL
,
pen
,
points
,
3
,
0
,
2
,
1
);
expect
(
InvalidParameter
,
status
);
/* InvalidParameter cases: invalid count */
status
=
GdipDrawCurve3
(
graphics
,
pen
,
points
,
-
1
,
0
,
2
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipDrawCurve3
(
graphics
,
pen
,
points
,
0
,
0
,
2
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipDrawCurve3
(
graphics
,
pen
,
points
,
1
,
0
,
0
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipDrawCurve3
(
graphics
,
pen
,
points
,
3
,
4
,
2
,
1
);
expect
(
InvalidParameter
,
status
);
/* InvalidParameter cases: invalid number of segments */
status
=
GdipDrawCurve3
(
graphics
,
pen
,
points
,
3
,
0
,
-
1
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipDrawCurve3
(
graphics
,
pen
,
points
,
3
,
1
,
2
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipDrawCurve3
(
graphics
,
pen
,
points
,
2
,
0
,
2
,
1
);
expect
(
InvalidParameter
,
status
);
/* Valid test cases */
status
=
GdipDrawCurve3
(
graphics
,
pen
,
points
,
2
,
0
,
1
,
1
);
expect
(
Ok
,
status
);
status
=
GdipDrawCurve3
(
graphics
,
pen
,
points
,
3
,
0
,
2
,
2
);
expect
(
Ok
,
status
);
status
=
GdipDrawCurve3
(
graphics
,
pen
,
points
,
2
,
0
,
1
,
-
2
);
expect
(
Ok
,
status
);
status
=
GdipDrawCurve3
(
graphics
,
pen
,
points
,
3
,
1
,
1
,
0
);
expect
(
Ok
,
status
);
GdipDeletePen
(
pen
);
GdipDeleteGraphics
(
graphics
);
ReleaseDC
(
0
,
hdc
);
}
static
void
test_GdipDrawCurve3I
(
void
)
{
GpStatus
status
;
GpGraphics
*
graphics
=
NULL
;
GpPen
*
pen
=
NULL
;
HDC
hdc
=
GetDC
(
0
);
GpPoint
points
[
3
];
points
[
0
].
X
=
0
;
points
[
0
].
Y
=
0
;
points
[
1
].
X
=
40
;
points
[
1
].
Y
=
20
;
points
[
2
].
X
=
10
;
points
[
2
].
Y
=
40
;
/* make a graphics object and pen object */
ok
(
hdc
!=
NULL
,
"Expected HDC to be initialized
\n
"
);
status
=
GdipCreateFromHDC
(
hdc
,
&
graphics
);
expect
(
Ok
,
status
);
ok
(
graphics
!=
NULL
,
"Expected graphics to be initialized
\n
"
);
status
=
GdipCreatePen1
((
ARGB
)
0xffff00ff
,
10
.
0
f
,
UnitPixel
,
&
pen
);
expect
(
Ok
,
status
);
ok
(
pen
!=
NULL
,
"Expected pen to be initialized
\n
"
);
/* InvalidParameter cases: null graphics, null pen */
status
=
GdipDrawCurve3I
(
NULL
,
NULL
,
points
,
3
,
0
,
2
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipDrawCurve3I
(
graphics
,
NULL
,
points
,
3
,
0
,
2
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipDrawCurve3I
(
NULL
,
pen
,
points
,
3
,
0
,
2
,
1
);
expect
(
InvalidParameter
,
status
);
/* InvalidParameter cases: invalid count */
status
=
GdipDrawCurve3I
(
graphics
,
pen
,
points
,
-
1
,
-
1
,
-
1
,
1
);
expect
(
OutOfMemory
,
status
);
status
=
GdipDrawCurve3I
(
graphics
,
pen
,
points
,
0
,
0
,
2
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipDrawCurve3I
(
graphics
,
pen
,
points
,
1
,
0
,
0
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipDrawCurve3I
(
graphics
,
pen
,
points
,
3
,
4
,
2
,
1
);
expect
(
InvalidParameter
,
status
);
/* InvalidParameter cases: invalid number of segments */
status
=
GdipDrawCurve3I
(
graphics
,
pen
,
points
,
3
,
0
,
-
1
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipDrawCurve3I
(
graphics
,
pen
,
points
,
3
,
1
,
2
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipDrawCurve3I
(
graphics
,
pen
,
points
,
2
,
0
,
2
,
1
);
expect
(
InvalidParameter
,
status
);
/* Valid test cases */
status
=
GdipDrawCurve3I
(
graphics
,
pen
,
points
,
2
,
0
,
1
,
1
);
expect
(
Ok
,
status
);
status
=
GdipDrawCurve3I
(
graphics
,
pen
,
points
,
3
,
0
,
2
,
2
);
expect
(
Ok
,
status
);
status
=
GdipDrawCurve3I
(
graphics
,
pen
,
points
,
2
,
0
,
1
,
-
2
);
expect
(
Ok
,
status
);
status
=
GdipDrawCurve3I
(
graphics
,
pen
,
points
,
3
,
1
,
1
,
0
);
expect
(
Ok
,
status
);
GdipDeletePen
(
pen
);
GdipDeleteGraphics
(
graphics
);
ReleaseDC
(
0
,
hdc
);
}
static
void
test_GdipDrawCurve2
(
void
)
{
GpStatus
status
;
...
...
@@ -1345,6 +1505,8 @@ START_TEST(graphics)
test_GdipDrawCurveI
();
test_GdipDrawCurve2
();
test_GdipDrawCurve2I
();
test_GdipDrawCurve3
();
test_GdipDrawCurve3I
();
test_GdipDrawLineI
();
test_GdipDrawLinesI
();
test_GdipDrawString
();
...
...
include/gdiplusflat.h
View file @
4c0edba6
...
...
@@ -147,6 +147,8 @@ GpStatus WINGDIPAPI GdipDrawCurve(GpGraphics*,GpPen*,GDIPCONST GpPointF*,INT);
GpStatus
WINGDIPAPI
GdipDrawCurveI
(
GpGraphics
*
,
GpPen
*
,
GDIPCONST
GpPoint
*
,
INT
);
GpStatus
WINGDIPAPI
GdipDrawCurve2
(
GpGraphics
*
,
GpPen
*
,
GDIPCONST
GpPointF
*
,
INT
,
REAL
);
GpStatus
WINGDIPAPI
GdipDrawCurve2I
(
GpGraphics
*
,
GpPen
*
,
GDIPCONST
GpPoint
*
,
INT
,
REAL
);
GpStatus
WINGDIPAPI
GdipDrawCurve3
(
GpGraphics
*
,
GpPen
*
,
GDIPCONST
GpPointF
*
,
INT
,
INT
,
INT
,
REAL
);
GpStatus
WINGDIPAPI
GdipDrawCurve3I
(
GpGraphics
*
,
GpPen
*
,
GDIPCONST
GpPoint
*
,
INT
,
INT
,
INT
,
REAL
);
GpStatus
WINGDIPAPI
GdipDrawEllipse
(
GpGraphics
*
,
GpPen
*
,
REAL
,
REAL
,
REAL
,
REAL
);
GpStatus
WINGDIPAPI
GdipDrawEllipseI
(
GpGraphics
*
,
GpPen
*
,
INT
,
INT
,
INT
,
INT
);
GpStatus
WINGDIPAPI
GdipDrawImage
(
GpGraphics
*
,
GpImage
*
,
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