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
2e4a37f2
Commit
2e4a37f2
authored
Mar 09, 2016
by
Huw Davies
Committed by
Alexandre Julliard
Mar 09, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Generate EMR_POLYPOLY{LINE|GON}16 records if the co-ords fit.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ce3921df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
6 deletions
+33
-6
graphics.c
dlls/gdi32/enhmfdrv/graphics.c
+33
-6
No files found.
dlls/gdi32/enhmfdrv/graphics.c
View file @
2e4a37f2
...
...
@@ -482,11 +482,11 @@ EMFDRV_PolyPolylinegon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT po
DWORD
iType
)
{
EMRPOLYPOLYLINE
*
emr
;
DWORD
cptl
=
0
,
poly
,
size
;
DWORD
cptl
=
0
,
poly
,
size
,
i
;
INT
point
;
RECTL
bounds
;
const
POINT
*
pts
;
BOOL
ret
;
BOOL
ret
,
use_small_emr
=
TRUE
;
bounds
.
left
=
bounds
.
right
=
pt
[
0
].
x
;
bounds
.
top
=
bounds
.
bottom
=
pt
[
0
].
y
;
...
...
@@ -495,6 +495,10 @@ EMFDRV_PolyPolylinegon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT po
for
(
poly
=
0
;
poly
<
polys
;
poly
++
)
{
cptl
+=
counts
[
poly
];
for
(
point
=
0
;
point
<
counts
[
poly
];
point
++
)
{
/* check whether all points fit in the SHORT int POINT structure */
if
(
((
pts
->
x
+
0x8000
)
&
~
0xffff
)
||
((
pts
->
y
+
0x8000
)
&
~
0xffff
)
)
use_small_emr
=
FALSE
;
if
(
bounds
.
left
>
pts
->
x
)
bounds
.
left
=
pts
->
x
;
else
if
(
bounds
.
right
<
pts
->
x
)
bounds
.
right
=
pts
->
x
;
if
(
bounds
.
top
>
pts
->
y
)
bounds
.
top
=
pts
->
y
;
...
...
@@ -503,18 +507,41 @@ EMFDRV_PolyPolylinegon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT po
}
}
size
=
sizeof
(
EMRPOLYPOLYLINE
)
+
(
polys
-
1
)
*
sizeof
(
DWORD
)
+
(
cptl
-
1
)
*
sizeof
(
POINTL
);
size
=
FIELD_OFFSET
(
EMRPOLYPOLYLINE
,
aPolyCounts
[
polys
]);
if
(
use_small_emr
)
size
+=
cptl
*
sizeof
(
POINTS
);
else
size
+=
cptl
*
sizeof
(
POINTL
);
emr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
emr
->
emr
.
iType
=
iType
;
if
(
use_small_emr
)
emr
->
emr
.
iType
+=
EMR_POLYPOLYLINE16
-
EMR_POLYPOLYLINE
;
emr
->
emr
.
nSize
=
size
;
emr
->
rclBounds
=
bounds
;
emr
->
nPolys
=
polys
;
emr
->
cptl
=
cptl
;
memcpy
(
emr
->
aPolyCounts
,
counts
,
polys
*
sizeof
(
DWORD
));
memcpy
(
emr
->
aPolyCounts
+
polys
,
pt
,
cptl
*
sizeof
(
POINTL
));
if
(
polys
)
{
memcpy
(
emr
->
aPolyCounts
,
counts
,
polys
*
sizeof
(
DWORD
)
);
if
(
cptl
)
{
if
(
use_small_emr
)
{
POINTS
*
out_pts
=
(
POINTS
*
)(
emr
->
aPolyCounts
+
polys
);
for
(
i
=
0
;
i
<
cptl
;
i
++
)
{
out_pts
[
i
].
x
=
pt
[
i
].
x
;
out_pts
[
i
].
y
=
pt
[
i
].
y
;
}
}
else
memcpy
(
emr
->
aPolyCounts
+
polys
,
pt
,
cptl
*
sizeof
(
POINTL
)
);
}
}
ret
=
EMFDRV_WriteRecord
(
dev
,
&
emr
->
emr
);
if
(
ret
)
EMFDRV_UpdateBBox
(
dev
,
&
emr
->
rclBounds
);
...
...
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