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
b06e6147
Commit
b06e6147
authored
Jun 17, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Implement PolyDraw in enhanced metafiles.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1f004c42
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
8 deletions
+59
-8
enhmetafiledrv.h
dlls/gdi32/enhmfdrv/enhmetafiledrv.h
+1
-0
graphics.c
dlls/gdi32/enhmfdrv/graphics.c
+37
-0
init.c
dlls/gdi32/enhmfdrv/init.c
+1
-1
metafile.c
dlls/gdi32/tests/metafile.c
+20
-7
No files found.
dlls/gdi32/enhmfdrv/enhmetafiledrv.h
View file @
b06e6147
...
...
@@ -94,6 +94,7 @@ extern BOOL EMFDRV_Pie( PHYSDEV dev, INT left, INT top, INT right, INT botto
INT
xstart
,
INT
ystart
,
INT
xend
,
INT
yend
)
DECLSPEC_HIDDEN
;
extern
BOOL
EMFDRV_PolyBezier
(
PHYSDEV
dev
,
const
POINT
*
pts
,
DWORD
count
)
DECLSPEC_HIDDEN
;
extern
BOOL
EMFDRV_PolyBezierTo
(
PHYSDEV
dev
,
const
POINT
*
pts
,
DWORD
count
)
DECLSPEC_HIDDEN
;
extern
BOOL
EMFDRV_PolyDraw
(
PHYSDEV
dev
,
const
POINT
*
pts
,
const
BYTE
*
types
,
DWORD
count
)
DECLSPEC_HIDDEN
;
extern
BOOL
EMFDRV_PolyPolygon
(
PHYSDEV
dev
,
const
POINT
*
pt
,
const
INT
*
counts
,
UINT
polys
)
DECLSPEC_HIDDEN
;
extern
BOOL
EMFDRV_PolyPolyline
(
PHYSDEV
dev
,
const
POINT
*
pt
,
const
DWORD
*
counts
,
DWORD
polys
)
DECLSPEC_HIDDEN
;
extern
BOOL
EMFDRV_Polygon
(
PHYSDEV
dev
,
const
POINT
*
pt
,
INT
count
)
DECLSPEC_HIDDEN
;
...
...
dlls/gdi32/enhmfdrv/graphics.c
View file @
b06e6147
...
...
@@ -576,6 +576,43 @@ BOOL EMFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT p
/**********************************************************************
* EMFDRV_PolyDraw
*/
BOOL
EMFDRV_PolyDraw
(
PHYSDEV
dev
,
const
POINT
*
pts
,
const
BYTE
*
types
,
DWORD
count
)
{
EMFDRV_PDEVICE
*
physDev
=
(
EMFDRV_PDEVICE
*
)
dev
;
EMRPOLYDRAW
*
emr
;
BOOL
ret
;
BYTE
*
types_dest
;
BOOL
use_small_emr
=
can_use_short_points
(
pts
,
count
);
DWORD
size
;
size
=
use_small_emr
?
offsetof
(
EMRPOLYDRAW16
,
apts
[
count
]
)
:
offsetof
(
EMRPOLYDRAW
,
aptl
[
count
]
);
size
+=
(
count
+
3
)
&
~
3
;
if
(
!
(
emr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
return
FALSE
;
emr
->
emr
.
iType
=
use_small_emr
?
EMR_POLYDRAW16
:
EMR_POLYDRAW
;
emr
->
emr
.
nSize
=
size
;
emr
->
cptl
=
count
;
types_dest
=
store_points
(
emr
->
aptl
,
pts
,
count
,
use_small_emr
);
memcpy
(
types_dest
,
types
,
count
);
if
(
count
&
3
)
memset
(
types_dest
+
count
,
0
,
4
-
(
count
&
3
)
);
if
(
!
physDev
->
path
)
get_points_bounds
(
&
emr
->
rclBounds
,
pts
,
count
,
0
);
else
emr
->
rclBounds
=
empty_bounds
;
ret
=
EMFDRV_WriteRecord
(
dev
,
&
emr
->
emr
);
if
(
ret
&&
!
physDev
->
path
)
EMFDRV_UpdateBBox
(
dev
,
&
emr
->
rclBounds
);
HeapFree
(
GetProcessHeap
(),
0
,
emr
);
return
ret
;
}
/**********************************************************************
* EMFDRV_ExtFloodFill
*/
BOOL
EMFDRV_ExtFloodFill
(
PHYSDEV
dev
,
INT
x
,
INT
y
,
COLORREF
color
,
UINT
fillType
)
...
...
dlls/gdi32/enhmfdrv/init.c
View file @
b06e6147
...
...
@@ -106,7 +106,7 @@ static const struct gdi_dc_funcs EMFDRV_Funcs =
EMFDRV_Pie
,
/* pPie */
EMFDRV_PolyBezier
,
/* pPolyBezier */
EMFDRV_PolyBezierTo
,
/* pPolyBezierTo */
NULL
,
/* pPolyDraw */
EMFDRV_PolyDraw
,
/* pPolyDraw */
EMFDRV_PolyPolygon
,
/* pPolyPolygon */
EMFDRV_PolyPolyline
,
/* pPolyPolyline */
EMFDRV_Polygon
,
/* pPolygon */
...
...
dlls/gdi32/tests/metafile.c
View file @
b06e6147
...
...
@@ -3601,7 +3601,7 @@ static const unsigned char EMF_PATH_BITS[] =
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xd8
,
0xff
,
0xff
,
0xff
,
0xd8
,
0xff
,
0xff
,
0xff
,
0x20
,
0x45
,
0x4d
,
0x46
,
0x00
,
0x00
,
0x01
,
0x00
,
0x
60
,
0x02
,
0x00
,
0x00
,
0x13
,
0x00
,
0x00
,
0x00
,
0x
ac
,
0x02
,
0x00
,
0x00
,
0x14
,
0x00
,
0x00
,
0x00
,
0x01
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x20
,
0x03
,
0x00
,
0x00
,
0x58
,
0x02
,
0x00
,
0x00
,
...
...
@@ -3667,16 +3667,28 @@ static const unsigned char EMF_PATH_BITS[] =
0x04
,
0x00
,
0x00
,
0x00
,
0x02
,
0x00
,
0x00
,
0x00
,
0x02
,
0x00
,
0x00
,
0x00
,
0x0a
,
0x00
,
0x0a
,
0x00
,
0x14
,
0x00
,
0x0a
,
0x00
,
0x0a
,
0x00
,
0x14
,
0x00
,
0x14
,
0x00
,
0x14
,
0x00
,
0x3c
,
0x00
,
0x00
,
0x00
,
0x08
,
0x00
,
0x00
,
0x00
,
0x0e
,
0x00
,
0x00
,
0x00
,
0x14
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x10
,
0x00
,
0x00
,
0x00
,
0x14
,
0x00
,
0x00
,
0x00
0x14
,
0x00
,
0x14
,
0x00
,
0x5c
,
0x00
,
0x00
,
0x00
,
0x4c
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0x09
,
0x00
,
0x00
,
0x00
,
0x0a
,
0x00
,
0x0a
,
0x00
,
0x14
,
0x00
,
0x0a
,
0x00
,
0x0a
,
0x00
,
0x14
,
0x00
,
0x14
,
0x00
,
0x14
,
0x00
,
0x1e
,
0x00
,
0x1e
,
0x00
,
0x28
,
0x00
,
0x14
,
0x00
,
0x14
,
0x00
,
0x1e
,
0x00
,
0x14
,
0x00
,
0x14
,
0x00
,
0x14
,
0x00
,
0x0a
,
0x00
,
0x06
,
0x02
,
0x04
,
0x04
,
0x04
,
0x02
,
0x03
,
0x06
,
0x02
,
0x00
,
0x00
,
0x00
,
0x3c
,
0x00
,
0x00
,
0x00
,
0x08
,
0x00
,
0x00
,
0x00
,
0x0e
,
0x00
,
0x00
,
0x00
,
0x14
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x10
,
0x00
,
0x00
,
0x00
,
0x14
,
0x00
,
0x00
,
0x00
};
static
void
test_emf_GetPath
(
void
)
{
POINT
pts
[
4
]
=
{{
10
,
10
},
{
20
,
10
},
{
10
,
20
},
{
20
,
2
0
}};
POINT
pts
[
9
]
=
{{
10
,
10
},
{
20
,
10
},
{
10
,
20
},
{
20
,
20
},
{
30
,
30
},
{
40
,
20
},
{
20
,
30
},
{
20
,
20
},
{
20
,
1
0
}};
DWORD
counts
[
2
]
=
{
2
,
2
};
BYTE
types
[
9
]
=
{
PT_MOVETO
,
PT_LINETO
,
PT_BEZIERTO
,
PT_BEZIERTO
,
PT_BEZIERTO
,
PT_LINETO
,
PT_LINETO
|
PT_CLOSEFIGURE
,
PT_MOVETO
,
PT_LINETO
};
HDC
hdcMetafile
;
HENHMETAFILE
hemf
;
BOOL
ret
;
...
...
@@ -3707,10 +3719,11 @@ static void test_emf_GetPath(void)
Polyline
(
hdcMetafile
,
pts
,
4
);
PolylineTo
(
hdcMetafile
,
pts
,
4
);
PolyPolyline
(
hdcMetafile
,
pts
,
counts
,
2
);
PolyDraw
(
hdcMetafile
,
pts
,
types
,
9
);
EndPath
(
hdcMetafile
);
size
=
GetPath
(
hdcMetafile
,
NULL
,
NULL
,
0
);
todo_wine
ok
(
size
==
93
,
"GetPath returned %d.
\n
"
,
size
);
todo_wine
ok
(
size
==
102
,
"GetPath returned %d.
\n
"
,
size
);
hemf
=
CloseEnhMetaFile
(
hdcMetafile
);
ok
(
hemf
!=
0
,
"CloseEnhMetaFile error %d
\n
"
,
GetLastError
());
...
...
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