Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
f4e2af65
Commit
f4e2af65
authored
Jul 26, 2010
by
Wade Gobel
Committed by
Alexandre Julliard
Jul 28, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Fixed GdipFillClosedCurve2 and GdipFillClosedCurve2I in the cases that count <= 1.
parent
c9ce21ed
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
142 additions
and
1 deletion
+142
-1
graphics.c
dlls/gdiplus/graphics.c
+7
-1
graphics.c
dlls/gdiplus/tests/graphics.c
+135
-0
No files found.
dlls/gdiplus/graphics.c
View file @
f4e2af65
...
...
@@ -2673,6 +2673,9 @@ GpStatus WINGDIPAPI GdipFillClosedCurve2(GpGraphics *graphics, GpBrush *brush,
if
(
graphics
->
busy
)
return
ObjectBusy
;
if
(
count
==
1
)
/* Do nothing */
return
Ok
;
stat
=
GdipCreatePath
(
fill
,
&
path
);
if
(
stat
!=
Ok
)
return
stat
;
...
...
@@ -2704,9 +2707,12 @@ GpStatus WINGDIPAPI GdipFillClosedCurve2I(GpGraphics *graphics, GpBrush *brush,
TRACE
(
"(%p, %p, %p, %d, %.2f, %d)
\n
"
,
graphics
,
brush
,
points
,
count
,
tension
,
fill
);
if
(
!
points
||
count
<
=
0
)
if
(
!
points
||
count
=
=
0
)
return
InvalidParameter
;
if
(
count
==
1
)
/* Do nothing */
return
Ok
;
ptf
=
GdipAlloc
(
sizeof
(
GpPointF
)
*
count
);
if
(
!
ptf
)
return
OutOfMemory
;
...
...
dlls/gdiplus/tests/graphics.c
View file @
f4e2af65
...
...
@@ -230,6 +230,139 @@ static void test_save_restore(void)
ReleaseDC
(
hwnd
,
hdc
);
}
static
void
test_GdipFillClosedCurve2
(
void
)
{
GpStatus
status
;
GpGraphics
*
graphics
=
NULL
;
GpSolidFill
*
brush
=
NULL
;
HDC
hdc
=
GetDC
(
hwnd
);
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 brush 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
"
);
GdipCreateSolidFill
((
ARGB
)
0xdeadbeef
,
&
brush
);
/* InvalidParameter cases: null graphics, null brush, null points */
status
=
GdipFillClosedCurve2
(
NULL
,
NULL
,
NULL
,
3
,
0
.
5
,
FillModeAlternate
);
expect
(
InvalidParameter
,
status
);
status
=
GdipFillClosedCurve2
(
graphics
,
NULL
,
NULL
,
3
,
0
.
5
,
FillModeAlternate
);
expect
(
InvalidParameter
,
status
);
status
=
GdipFillClosedCurve2
(
NULL
,
(
GpBrush
*
)
brush
,
NULL
,
3
,
0
.
5
,
FillModeAlternate
);
expect
(
InvalidParameter
,
status
);
status
=
GdipFillClosedCurve2
(
NULL
,
NULL
,
points
,
3
,
0
.
5
,
FillModeAlternate
);
expect
(
InvalidParameter
,
status
);
status
=
GdipFillClosedCurve2
(
graphics
,
(
GpBrush
*
)
brush
,
NULL
,
3
,
0
.
5
,
FillModeAlternate
);
expect
(
InvalidParameter
,
status
);
status
=
GdipFillClosedCurve2
(
graphics
,
NULL
,
points
,
3
,
0
.
5
,
FillModeAlternate
);
expect
(
InvalidParameter
,
status
);
status
=
GdipFillClosedCurve2
(
NULL
,
(
GpBrush
*
)
brush
,
points
,
3
,
0
.
5
,
FillModeAlternate
);
expect
(
InvalidParameter
,
status
);
/* InvalidParameter cases: invalid count */
status
=
GdipFillClosedCurve2
(
graphics
,
(
GpBrush
*
)
brush
,
points
,
-
1
,
0
.
5
,
FillModeAlternate
);
expect
(
InvalidParameter
,
status
);
status
=
GdipFillClosedCurve2
(
graphics
,
(
GpBrush
*
)
brush
,
points
,
0
,
0
.
5
,
FillModeAlternate
);
expect
(
InvalidParameter
,
status
);
/* Valid test cases */
status
=
GdipFillClosedCurve2
(
graphics
,
(
GpBrush
*
)
brush
,
points
,
1
,
0
.
5
,
FillModeAlternate
);
expect
(
Ok
,
status
);
status
=
GdipFillClosedCurve2
(
graphics
,
(
GpBrush
*
)
brush
,
points
,
2
,
0
.
5
,
FillModeAlternate
);
expect
(
Ok
,
status
);
status
=
GdipFillClosedCurve2
(
graphics
,
(
GpBrush
*
)
brush
,
points
,
3
,
0
.
5
,
FillModeAlternate
);
expect
(
Ok
,
status
);
GdipDeleteGraphics
(
graphics
);
GdipDeleteBrush
((
GpBrush
*
)
brush
);
ReleaseDC
(
hwnd
,
hdc
);
}
static
void
test_GdipFillClosedCurve2I
(
void
)
{
GpStatus
status
;
GpGraphics
*
graphics
=
NULL
;
GpSolidFill
*
brush
=
NULL
;
HDC
hdc
=
GetDC
(
hwnd
);
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 brush 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
"
);
GdipCreateSolidFill
((
ARGB
)
0xdeadbeef
,
&
brush
);
/* InvalidParameter cases: null graphics, null brush */
/* Note: GdipFillClosedCurveI and GdipFillClosedCurve2I hang in Windows
when points == NULL, so don't test this condition */
status
=
GdipFillClosedCurve2I
(
NULL
,
NULL
,
points
,
3
,
0
.
5
,
FillModeAlternate
);
expect
(
InvalidParameter
,
status
);
status
=
GdipFillClosedCurve2I
(
graphics
,
NULL
,
points
,
3
,
0
.
5
,
FillModeAlternate
);
expect
(
InvalidParameter
,
status
);
status
=
GdipFillClosedCurve2I
(
NULL
,
(
GpBrush
*
)
brush
,
points
,
3
,
0
.
5
,
FillModeAlternate
);
expect
(
InvalidParameter
,
status
);
/* InvalidParameter cases: invalid count */
status
=
GdipFillClosedCurve2I
(
graphics
,
(
GpBrush
*
)
brush
,
points
,
0
,
0
.
5
,
FillModeAlternate
);
expect
(
InvalidParameter
,
status
);
/* OutOfMemory cases: large (unsigned) int */
status
=
GdipFillClosedCurve2I
(
graphics
,
(
GpBrush
*
)
brush
,
points
,
-
1
,
0
.
5
,
FillModeAlternate
);
expect
(
OutOfMemory
,
status
);
/* Valid test cases */
status
=
GdipFillClosedCurve2I
(
graphics
,
(
GpBrush
*
)
brush
,
points
,
1
,
0
.
5
,
FillModeAlternate
);
expect
(
Ok
,
status
);
status
=
GdipFillClosedCurve2I
(
graphics
,
(
GpBrush
*
)
brush
,
points
,
2
,
0
.
5
,
FillModeAlternate
);
expect
(
Ok
,
status
);
status
=
GdipFillClosedCurve2I
(
graphics
,
(
GpBrush
*
)
brush
,
points
,
3
,
0
.
5
,
FillModeAlternate
);
expect
(
Ok
,
status
);
GdipDeleteGraphics
(
graphics
);
GdipDeleteBrush
((
GpBrush
*
)
brush
);
ReleaseDC
(
hwnd
,
hdc
);
}
static
void
test_GdipDrawArc
(
void
)
{
GpStatus
status
;
...
...
@@ -2665,6 +2798,8 @@ START_TEST(graphics)
test_constructor_destructor
();
test_save_restore
();
test_GdipFillClosedCurve2
();
test_GdipFillClosedCurve2I
();
test_GdipDrawBezierI
();
test_GdipDrawArc
();
test_GdipDrawArcI
();
...
...
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