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
fea3a744
Commit
fea3a744
authored
May 03, 2023
by
Zhiyi Zhang
Committed by
Alexandre Julliard
May 29, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Support playing back pen custom start line cap.
parent
78261ecb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
123 additions
and
2 deletions
+123
-2
metafile.c
dlls/gdiplus/metafile.c
+123
-1
metafile.c
dlls/gdiplus/tests/metafile.c
+0
-1
No files found.
dlls/gdiplus/metafile.c
View file @
fea3a744
...
...
@@ -2340,6 +2340,122 @@ static GpStatus metafile_deserialize_brush(const BYTE *record_data, UINT data_si
return
status
;
}
static
GpStatus
metafile_deserialize_custom_line_cap
(
const
BYTE
*
record_data
,
UINT
data_size
,
GpCustomLineCap
**
cap
)
{
EmfPlusCustomStartCapData
*
custom_cap_data
=
(
EmfPlusCustomStartCapData
*
)
record_data
;
EmfPlusCustomLineCap
*
line_cap
;
GpStatus
status
;
UINT
offset
;
*
cap
=
NULL
;
if
(
data_size
<
FIELD_OFFSET
(
EmfPlusCustomStartCapData
,
data
))
return
InvalidParameter
;
if
(
data_size
<
FIELD_OFFSET
(
EmfPlusCustomStartCapData
,
data
)
+
custom_cap_data
->
CustomStartCapSize
)
return
InvalidParameter
;
offset
=
FIELD_OFFSET
(
EmfPlusCustomStartCapData
,
data
);
line_cap
=
(
EmfPlusCustomLineCap
*
)(
record_data
+
offset
);
if
(
data_size
<
offset
+
FIELD_OFFSET
(
EmfPlusCustomLineCap
,
CustomLineCapData
))
return
InvalidParameter
;
offset
+=
FIELD_OFFSET
(
EmfPlusCustomLineCap
,
CustomLineCapData
);
if
(
line_cap
->
Type
==
CustomLineCapTypeAdjustableArrow
)
{
EmfPlusCustomLineCapArrowData
*
arrow_data
;
GpAdjustableArrowCap
*
arrow_cap
;
arrow_data
=
(
EmfPlusCustomLineCapArrowData
*
)(
record_data
+
offset
);
if
(
data_size
<
offset
+
sizeof
(
EmfPlusCustomLineCapArrowData
))
return
InvalidParameter
;
if
((
status
=
GdipCreateAdjustableArrowCap
(
arrow_data
->
Height
,
arrow_data
->
Width
,
arrow_data
->
FillState
,
&
arrow_cap
)))
return
status
;
if
((
status
=
GdipSetAdjustableArrowCapMiddleInset
(
arrow_cap
,
arrow_data
->
MiddleInset
)))
goto
arrow_cap_failed
;
if
((
status
=
GdipSetCustomLineCapStrokeCaps
((
GpCustomLineCap
*
)
arrow_cap
,
arrow_data
->
LineStartCap
,
arrow_data
->
LineEndCap
)))
goto
arrow_cap_failed
;
if
((
status
=
GdipSetCustomLineCapStrokeJoin
((
GpCustomLineCap
*
)
arrow_cap
,
arrow_data
->
LineJoin
)))
goto
arrow_cap_failed
;
if
((
status
=
GdipSetCustomLineCapWidthScale
((
GpCustomLineCap
*
)
arrow_cap
,
arrow_data
->
WidthScale
)))
goto
arrow_cap_failed
;
*
cap
=
(
GpCustomLineCap
*
)
arrow_cap
;
return
Ok
;
arrow_cap_failed:
GdipDeleteCustomLineCap
((
GpCustomLineCap
*
)
arrow_cap
);
return
status
;
}
else
{
GpPath
*
path
,
*
fill_path
=
NULL
,
*
stroke_path
=
NULL
;
EmfPlusCustomLineCapData
*
line_cap_data
;
GpCustomLineCap
*
line_cap
=
NULL
;
GpStatus
status
;
line_cap_data
=
(
EmfPlusCustomLineCapData
*
)(
record_data
+
offset
);
if
(
data_size
<
offset
+
FIELD_OFFSET
(
EmfPlusCustomLineCapData
,
OptionalData
))
return
InvalidParameter
;
offset
+=
FIELD_OFFSET
(
EmfPlusCustomLineCapData
,
OptionalData
);
if
(
line_cap_data
->
CustomLineCapDataFlags
==
CustomLineCapDataFillPath
)
{
EmfPlusCustomLineCapDataFillPath
*
fill_path
=
(
EmfPlusCustomLineCapDataFillPath
*
)(
record_data
+
offset
);
if
(
data_size
<
offset
+
FIELD_OFFSET
(
EmfPlusCustomLineCapDataFillPath
,
FillPath
))
return
InvalidParameter
;
if
(
data_size
<
offset
+
fill_path
->
FillPathLength
)
return
InvalidParameter
;
offset
+=
FIELD_OFFSET
(
EmfPlusCustomLineCapDataFillPath
,
FillPath
);
}
else
{
EmfPlusCustomLineCapDataLinePath
*
line_path
=
(
EmfPlusCustomLineCapDataLinePath
*
)(
record_data
+
offset
);
if
(
data_size
<
offset
+
FIELD_OFFSET
(
EmfPlusCustomLineCapDataLinePath
,
LinePath
))
return
InvalidParameter
;
if
(
data_size
<
offset
+
line_path
->
LinePathLength
)
return
InvalidParameter
;
offset
+=
FIELD_OFFSET
(
EmfPlusCustomLineCapDataLinePath
,
LinePath
);
}
if
((
status
=
metafile_deserialize_path
(
record_data
+
offset
,
data_size
-
offset
,
&
path
)))
return
status
;
if
(
line_cap_data
->
CustomLineCapDataFlags
==
CustomLineCapDataFillPath
)
fill_path
=
path
;
else
stroke_path
=
path
;
if
((
status
=
GdipCreateCustomLineCap
(
fill_path
,
stroke_path
,
line_cap_data
->
BaseCap
,
line_cap_data
->
BaseInset
,
&
line_cap
)))
goto
default_cap_failed
;
if
((
status
=
GdipSetCustomLineCapStrokeCaps
(
line_cap
,
line_cap_data
->
StrokeStartCap
,
line_cap_data
->
StrokeEndCap
)))
goto
default_cap_failed
;
if
((
status
=
GdipSetCustomLineCapStrokeJoin
(
line_cap
,
line_cap_data
->
StrokeJoin
)))
goto
default_cap_failed
;
if
((
status
=
GdipSetCustomLineCapWidthScale
(
line_cap
,
line_cap_data
->
WidthScale
)))
goto
default_cap_failed
;
GdipDeletePath
(
path
);
*
cap
=
line_cap
;
return
Ok
;
default_cap_failed:
if
(
line_cap
)
GdipDeleteCustomLineCap
(
line_cap
);
GdipDeletePath
(
path
);
return
status
;
}
}
static
GpStatus
metafile_get_pen_brush_data_offset
(
EmfPlusPen
*
data
,
UINT
data_size
,
DWORD
*
ret
)
{
EmfPlusPenData
*
pendata
=
(
EmfPlusPenData
*
)
data
->
data
;
...
...
@@ -2446,6 +2562,7 @@ static GpStatus METAFILE_PlaybackObject(GpMetafile *metafile, UINT flags, UINT d
{
EmfPlusPen
*
data
=
(
EmfPlusPen
*
)
record_data
;
EmfPlusPenData
*
pendata
=
(
EmfPlusPenData
*
)
data
->
data
;
GpCustomLineCap
*
custom_line_cap
;
GpBrush
*
brush
;
DWORD
offset
;
GpPen
*
pen
;
...
...
@@ -2542,7 +2659,12 @@ static GpStatus METAFILE_PlaybackObject(GpMetafile *metafile, UINT flags, UINT d
if
(
pendata
->
PenDataFlags
&
PenDataCustomStartCap
)
{
EmfPlusCustomStartCapData
*
startcap
=
(
EmfPlusCustomStartCapData
*
)((
BYTE
*
)
pendata
+
offset
);
FIXME
(
"PenDataCustomStartCap is not supported.
\n
"
);
if
((
status
=
metafile_deserialize_custom_line_cap
((
BYTE
*
)
startcap
,
data_size
,
&
custom_line_cap
))
!=
Ok
)
goto
penfailed
;
status
=
GdipSetPenCustomStartCap
(
pen
,
custom_line_cap
);
GdipDeleteCustomLineCap
(
custom_line_cap
);
if
(
status
!=
Ok
)
goto
penfailed
;
offset
+=
FIELD_OFFSET
(
EmfPlusCustomStartCapData
,
data
)
+
startcap
->
CustomStartCapSize
;
}
...
...
dlls/gdiplus/tests/metafile.c
View file @
fea3a744
...
...
@@ -3983,7 +3983,6 @@ static void test_pen(void)
stat
=
GdipBitmapGetPixel
(
bitmap
,
10
,
10
,
&
color
);
expect
(
Ok
,
stat
);
todo_wine
expect
(
0xffff0000
,
color
);
stat
=
GdipBitmapGetPixel
(
bitmap
,
40
,
90
,
&
color
);
...
...
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