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
9d5d4dba
Commit
9d5d4dba
authored
Oct 29, 2022
by
Bartosz Kosiorek
Committed by
Alexandre Julliard
Oct 31, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add GdipSetPenCompoundArray implementation.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=52196
parent
4e734f48
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
5 deletions
+38
-5
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+2
-0
graphicspath.c
dlls/gdiplus/graphicspath.c
+3
-0
pen.c
dlls/gdiplus/pen.c
+22
-4
pen.c
dlls/gdiplus/tests/pen.c
+11
-1
No files found.
dlls/gdiplus/gdiplus_private.h
View file @
9d5d4dba
...
...
@@ -235,6 +235,8 @@ struct GpPen{
GpBrush
*
brush
;
GpPenAlignment
align
;
GpMatrix
transform
;
REAL
*
compound_array
;
INT
compound_array_size
;
};
struct
GpGraphics
{
...
...
dlls/gdiplus/graphicspath.c
View file @
9d5d4dba
...
...
@@ -2356,6 +2356,9 @@ GpStatus WINGDIPAPI GdipWidenPath(GpPath *path, GpPen *pen, GpMatrix *matrix,
if
(
pen
->
align
!=
PenAlignmentCenter
)
FIXME
(
"unimplemented pen alignment %d
\n
"
,
pen
->
align
);
if
(
pen
->
compound_array_size
!=
0
)
FIXME
(
"unimplemented pen compoundline. Solid line will be drawn instead: %d
\n
"
,
pen
->
compound_array_size
);
for
(
i
=
0
;
i
<
flat_path
->
pathdata
.
Count
;
i
++
)
{
if
((
types
[
i
]
&
PathPointTypePathTypeMask
)
==
PathPointTypeStart
)
...
...
dlls/gdiplus/pen.c
View file @
9d5d4dba
...
...
@@ -171,6 +171,8 @@ GpStatus WINGDIPAPI GdipCreatePen2(GpBrush *brush, REAL width, GpUnit unit,
gp_pen
->
offset
=
0
.
0
;
gp_pen
->
customstart
=
NULL
;
gp_pen
->
customend
=
NULL
;
gp_pen
->
compound_array
=
NULL
;
gp_pen
->
compound_array_size
=
0
;
GdipSetMatrixElements
(
&
gp_pen
->
transform
,
1
.
0
,
0
.
0
,
0
.
0
,
1
.
0
,
0
.
0
,
0
.
0
);
if
(
!
((
gp_pen
->
unit
==
UnitWorld
)
||
(
gp_pen
->
unit
==
UnitPixel
)))
{
...
...
@@ -198,6 +200,7 @@ GpStatus WINGDIPAPI GdipDeletePen(GpPen *pen)
GdipDeleteBrush
(
pen
->
brush
);
GdipDeleteCustomLineCap
(
pen
->
customstart
);
GdipDeleteCustomLineCap
(
pen
->
customend
);
heap_free
(
pen
->
compound_array
);
heap_free
(
pen
->
dashes
);
heap_free
(
pen
);
...
...
@@ -533,15 +536,30 @@ GpStatus WINGDIPAPI GdipGetPenCompoundCount(GpPen *pen, INT *count)
return
NotImplemented
;
}
GpStatus
WINGDIPAPI
GdipSetPenCompoundArray
(
GpPen
*
pen
,
GDIPCONST
REAL
*
dash
,
GpStatus
WINGDIPAPI
GdipSetPenCompoundArray
(
GpPen
*
pen
,
GDIPCONST
REAL
*
compoundarray
,
INT
count
)
{
FIXME
(
"(%p, %p, %i): stub
\n
"
,
pen
,
dash
,
count
);
INT
i
;
REAL
*
tmp
;
TRACE
(
"(%p, %p, %i)
\n
"
,
pen
,
compoundarray
,
count
);
if
(
!
pen
||
!
dash
||
count
<
2
||
count
%
2
==
1
)
if
(
!
pen
||
!
compoundarray
||
count
<
2
||
count
%
2
==
1
||
*
compoundarray
<
0
.
0
||
*
compoundarray
>
1
.
0
)
return
InvalidParameter
;
return
NotImplemented
;
for
(
i
=
1
;
i
<
count
;
i
++
)
{
if
((
compoundarray
[
i
]
<
compoundarray
[
i
-
1
])
||
(
compoundarray
[
i
]
>
1
.
0
))
return
InvalidParameter
;
}
tmp
=
heap_alloc_zero
(
count
*
sizeof
(
REAL
));
if
(
!
tmp
)
return
OutOfMemory
;
heap_free
(
pen
->
compound_array
);
pen
->
compound_array
=
tmp
;
memcpy
(
pen
->
compound_array
,
compoundarray
,
count
*
sizeof
(
REAL
));
pen
->
compound_array_size
=
count
;
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipSetPenCustomEndCap
(
GpPen
*
pen
,
GpCustomLineCap
*
customCap
)
...
...
dlls/gdiplus/tests/pen.c
View file @
9d5d4dba
...
...
@@ -351,6 +351,9 @@ static void test_compoundarray(void)
GpStatus
status
;
GpPen
*
pen
;
static
const
REAL
testvalues
[]
=
{
0
.
2
,
0
.
4
,
0
.
6
,
0
.
8
};
static
const
REAL
notSortedValues
[]
=
{
0
.
2
,
0
.
6
,
0
.
4
,
0
.
8
};
static
const
REAL
negativeValues
[]
=
{
-
1
.
2
,
0
.
4
,
0
.
6
,
0
.
8
};
static
const
REAL
tooLargeValues
[]
=
{
0
.
2
,
0
.
4
,
0
.
6
,
2
.
8
};
INT
count
;
status
=
GdipSetPenCompoundArray
(
NULL
,
testvalues
,
4
);
...
...
@@ -382,8 +385,15 @@ todo_wine {
status
=
GdipSetPenCompoundArray
(
pen
,
testvalues
,
-
2
);
expect
(
InvalidParameter
,
status
);
status
=
GdipSetPenCompoundArray
(
pen
,
notSortedValues
,
4
);
expect
(
InvalidParameter
,
status
);
status
=
GdipSetPenCompoundArray
(
pen
,
negativeValues
,
4
);
expect
(
InvalidParameter
,
status
);
status
=
GdipSetPenCompoundArray
(
pen
,
tooLargeValues
,
4
);
expect
(
InvalidParameter
,
status
);
status
=
GdipSetPenCompoundArray
(
pen
,
testvalues
,
4
);
todo_wine
expect
(
Ok
,
status
);
expect
(
Ok
,
status
);
status
=
GdipSetPenCompoundArray
(
pen
,
NULL
,
0
);
expect
(
InvalidParameter
,
status
);
...
...
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