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
e0f32f53
Commit
e0f32f53
authored
Nov 18, 2022
by
Bartosz Kosiorek
Committed by
Alexandre Julliard
Nov 23, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add GdipSetCustomLineCapStrokeCaps implementation and usage.
parent
cd17de88
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
9 deletions
+39
-9
customlinecap.c
dlls/gdiplus/customlinecap.c
+8
-8
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+2
-0
graphicspath.c
dlls/gdiplus/graphicspath.c
+1
-1
customlinecap.c
dlls/gdiplus/tests/customlinecap.c
+28
-0
No files found.
dlls/gdiplus/customlinecap.c
View file @
e0f32f53
...
@@ -97,6 +97,8 @@ static GpStatus init_custom_linecap(GpCustomLineCap *cap, GpPathData *pathdata,
...
@@ -97,6 +97,8 @@ static GpStatus init_custom_linecap(GpCustomLineCap *cap, GpPathData *pathdata,
cap
->
inset
=
base_inset
;
cap
->
inset
=
base_inset
;
cap
->
basecap
=
basecap
;
cap
->
basecap
=
basecap
;
cap
->
strokeStartCap
=
LineCapFlat
;
cap
->
strokeEndCap
=
LineCapFlat
;
cap
->
join
=
LineJoinMiter
;
cap
->
join
=
LineJoinMiter
;
cap
->
scale
=
1
.
0
;
cap
->
scale
=
1
.
0
;
...
@@ -177,19 +179,17 @@ GpStatus WINGDIPAPI GdipGetCustomLineCapWidthScale(GpCustomLineCap* custom,
...
@@ -177,19 +179,17 @@ GpStatus WINGDIPAPI GdipGetCustomLineCapWidthScale(GpCustomLineCap* custom,
}
}
GpStatus
WINGDIPAPI
GdipSetCustomLineCapStrokeCaps
(
GpCustomLineCap
*
custom
,
GpStatus
WINGDIPAPI
GdipSetCustomLineCapStrokeCaps
(
GpCustomLineCap
*
custom
,
GpLineCap
start
,
GpLineCap
end
)
GpLineCap
start
cap
,
GpLineCap
endcap
)
{
{
static
int
calls
;
TRACE
(
"(%p,%u,%u)
\n
"
,
custom
,
startcap
,
endcap
)
;
TRACE
(
"(%p,%u,%u)
\n
"
,
custom
,
start
,
end
);
if
(
!
custom
||
startcap
>
LineCapTriangle
||
endcap
>
LineCapTriangle
)
if
(
!
custom
)
return
InvalidParameter
;
return
InvalidParameter
;
if
(
!
(
calls
++
))
custom
->
strokeStartCap
=
startcap
;
FIXME
(
"not implemented
\n
"
)
;
custom
->
strokeEndCap
=
endcap
;
return
NotImplemented
;
return
Ok
;
}
}
GpStatus
WINGDIPAPI
GdipSetCustomLineCapBaseCap
(
GpCustomLineCap
*
custom
,
GpStatus
WINGDIPAPI
GdipSetCustomLineCapBaseCap
(
GpCustomLineCap
*
custom
,
...
...
dlls/gdiplus/gdiplus_private.h
View file @
e0f32f53
...
@@ -353,6 +353,8 @@ struct GpCustomLineCap{
...
@@ -353,6 +353,8 @@ struct GpCustomLineCap{
BOOL
fill
;
/* TRUE for fill, FALSE for stroke */
BOOL
fill
;
/* TRUE for fill, FALSE for stroke */
GpLineCap
basecap
;
/* cap used together with customLineCap */
GpLineCap
basecap
;
/* cap used together with customLineCap */
REAL
inset
;
/* distance between line end and cap beginning */
REAL
inset
;
/* distance between line end and cap beginning */
GpLineCap
strokeStartCap
;
GpLineCap
strokeEndCap
;
GpLineJoin
join
;
/* joins used for drawing custom cap*/
GpLineJoin
join
;
/* joins used for drawing custom cap*/
REAL
scale
;
REAL
scale
;
};
};
...
...
dlls/gdiplus/graphicspath.c
View file @
e0f32f53
...
@@ -2145,7 +2145,7 @@ static void add_anchor(const GpPointF *endpoint, const GpPointF *nextpoint,
...
@@ -2145,7 +2145,7 @@ static void add_anchor(const GpPointF *endpoint, const GpPointF *nextpoint,
if
((
custom
->
pathdata
.
Types
[
custom
->
pathdata
.
Count
-
1
]
&
PathPointTypeCloseSubpath
)
==
PathPointTypeCloseSubpath
)
if
((
custom
->
pathdata
.
Types
[
custom
->
pathdata
.
Count
-
1
]
&
PathPointTypeCloseSubpath
)
==
PathPointTypeCloseSubpath
)
widen_closed_figure
(
tmp_points
,
0
,
custom
->
pathdata
.
Count
-
1
,
pen
,
pen_width
,
last_point
);
widen_closed_figure
(
tmp_points
,
0
,
custom
->
pathdata
.
Count
-
1
,
pen
,
pen_width
,
last_point
);
else
else
widen_open_figure
(
tmp_points
,
0
,
custom
->
pathdata
.
Count
-
1
,
pen
,
pen_width
,
LineCapFlat
,
LineCapFlat
,
last_point
);
widen_open_figure
(
tmp_points
,
0
,
custom
->
pathdata
.
Count
-
1
,
pen
,
pen_width
,
custom
->
strokeEndCap
,
custom
->
strokeStartCap
,
last_point
);
}
}
else
else
{
{
...
...
dlls/gdiplus/tests/customlinecap.c
View file @
e0f32f53
...
@@ -380,6 +380,33 @@ static void test_captype(void)
...
@@ -380,6 +380,33 @@ static void test_captype(void)
GdipDeleteCustomLineCap
((
GpCustomLineCap
*
)
arrowcap
);
GdipDeleteCustomLineCap
((
GpCustomLineCap
*
)
arrowcap
);
}
}
static
void
test_strokecap
(
void
)
{
GpCustomLineCap
*
cap
;
GpStatus
stat
;
GpPath
*
path
;
/* default cap */
stat
=
GdipCreatePath
(
FillModeAlternate
,
&
path
);
ok
(
stat
==
Ok
,
"Failed to create path, %d
\n
"
,
stat
);
stat
=
GdipAddPathRectangle
(
path
,
5
.
0
,
5
.
0
,
10
.
0
,
10
.
0
);
ok
(
stat
==
Ok
,
"AddPathRectangle failed, %d
\n
"
,
stat
);
stat
=
GdipCreateCustomLineCap
(
NULL
,
path
,
LineCapFlat
,
0
.
0
,
&
cap
);
ok
(
stat
==
Ok
,
"Failed to create cap, %d
\n
"
,
stat
);
stat
=
GdipSetCustomLineCapStrokeCaps
((
GpCustomLineCap
*
)
cap
,
LineCapSquare
,
LineCapFlat
);
ok
(
stat
==
Ok
,
"Unexpected return code, %d
\n
"
,
stat
);
stat
=
GdipSetCustomLineCapStrokeCaps
((
GpCustomLineCap
*
)
cap
,
LineCapSquareAnchor
,
LineCapFlat
);
ok
(
stat
==
InvalidParameter
,
"Unexpected return code, %d
\n
"
,
stat
);
stat
=
GdipSetCustomLineCapStrokeCaps
((
GpCustomLineCap
*
)
cap
,
LineCapFlat
,
LineCapSquareAnchor
);
ok
(
stat
==
InvalidParameter
,
"Unexpected return code, %d
\n
"
,
stat
);
GdipDeleteCustomLineCap
(
cap
);
GdipDeletePath
(
path
);
}
START_TEST
(
customlinecap
)
START_TEST
(
customlinecap
)
{
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
@@ -405,6 +432,7 @@ START_TEST(customlinecap)
...
@@ -405,6 +432,7 @@ START_TEST(customlinecap)
test_scale
();
test_scale
();
test_create_adjustable_cap
();
test_create_adjustable_cap
();
test_captype
();
test_captype
();
test_strokecap
();
GdiplusShutdown
(
gdiplusToken
);
GdiplusShutdown
(
gdiplusToken
);
}
}
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