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
681cd545
Commit
681cd545
authored
Nov 22, 2013
by
Vincent Povirk
Committed by
Alexandre Julliard
Nov 25, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Set world transform when drawing metafiles.
parent
fc560b21
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
6 deletions
+60
-6
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+4
-0
metafile.c
dlls/gdiplus/metafile.c
+56
-6
No files found.
dlls/gdiplus/gdiplus_private.h
View file @
681cd545
...
@@ -298,8 +298,12 @@ struct GpMetafile{
...
@@ -298,8 +298,12 @@ struct GpMetafile{
GpGraphics
*
playback_graphics
;
GpGraphics
*
playback_graphics
;
HDC
playback_dc
;
HDC
playback_dc
;
GpPointF
playback_points
[
3
];
GpPointF
playback_points
[
3
];
GpRectF
src_rect
;
HANDLETABLE
*
handle_table
;
HANDLETABLE
*
handle_table
;
int
handle_count
;
int
handle_count
;
GpMatrix
*
world_transform
;
GpUnit
page_unit
;
REAL
page_scale
;
};
};
struct
GpBitmap
{
struct
GpBitmap
{
...
...
dlls/gdiplus/metafile.c
View file @
681cd545
...
@@ -484,6 +484,28 @@ static void METAFILE_PlaybackReleaseDC(GpMetafile *metafile)
...
@@ -484,6 +484,28 @@ static void METAFILE_PlaybackReleaseDC(GpMetafile *metafile)
}
}
}
}
static
GpStatus
METAFILE_PlaybackUpdateWorldTransform
(
GpMetafile
*
metafile
)
{
GpMatrix
*
real_transform
;
GpStatus
stat
;
stat
=
GdipCreateMatrix3
(
&
metafile
->
src_rect
,
metafile
->
playback_points
,
&
real_transform
);
if
(
stat
==
Ok
)
{
/* FIXME: Prepend page transform. */
stat
=
GdipMultiplyMatrix
(
real_transform
,
metafile
->
world_transform
,
MatrixOrderPrepend
);
if
(
stat
==
Ok
)
stat
=
GdipSetWorldTransform
(
metafile
->
playback_graphics
,
real_transform
);
GdipDeleteMatrix
(
real_transform
);
}
return
stat
;
}
GpStatus
WINGDIPAPI
GdipPlayMetafileRecord
(
GDIPCONST
GpMetafile
*
metafile
,
GpStatus
WINGDIPAPI
GdipPlayMetafileRecord
(
GDIPCONST
GpMetafile
*
metafile
,
EmfPlusRecordType
recordType
,
UINT
flags
,
UINT
dataSize
,
GDIPCONST
BYTE
*
data
)
EmfPlusRecordType
recordType
,
UINT
flags
,
UINT
dataSize
,
GDIPCONST
BYTE
*
data
)
{
{
...
@@ -672,6 +694,7 @@ GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoints(GpGraphics *graphics,
...
@@ -672,6 +694,7 @@ GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoints(GpGraphics *graphics,
struct
enum_metafile_data
data
;
struct
enum_metafile_data
data
;
GpStatus
stat
;
GpStatus
stat
;
GpMetafile
*
real_metafile
=
(
GpMetafile
*
)
metafile
;
/* whoever made this const was joking */
GpMetafile
*
real_metafile
=
(
GpMetafile
*
)
metafile
;
/* whoever made this const was joking */
GraphicsContainer
state
;
TRACE
(
"(%p,%p,%p,%i,%p,%i,%p,%p,%p)
\n
"
,
graphics
,
metafile
,
TRACE
(
"(%p,%p,%p,%i,%p,%i,%p,%p,%p)
\n
"
,
graphics
,
metafile
,
destPoints
,
count
,
srcRect
,
srcUnit
,
callback
,
callbackData
,
destPoints
,
count
,
srcRect
,
srcUnit
,
callback
,
callbackData
,
...
@@ -696,19 +719,46 @@ GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoints(GpGraphics *graphics,
...
@@ -696,19 +719,46 @@ GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoints(GpGraphics *graphics,
real_metafile
->
playback_graphics
=
graphics
;
real_metafile
->
playback_graphics
=
graphics
;
real_metafile
->
playback_dc
=
NULL
;
real_metafile
->
playback_dc
=
NULL
;
real_metafile
->
src_rect
=
*
srcRect
;
memcpy
(
real_metafile
->
playback_points
,
destPoints
,
sizeof
(
PointF
)
*
3
);
memcpy
(
real_metafile
->
playback_points
,
destPoints
,
sizeof
(
PointF
)
*
3
);
stat
=
GdipTransformPoints
(
graphics
,
CoordinateSpaceDevice
,
CoordinateSpaceWorld
,
real_metafile
->
playback_points
,
3
);
stat
=
GdipTransformPoints
(
graphics
,
CoordinateSpaceDevice
,
CoordinateSpaceWorld
,
real_metafile
->
playback_points
,
3
);
if
(
stat
==
Ok
&&
(
metafile
->
metafile_type
==
MetafileTypeEmf
||
if
(
stat
==
Ok
)
metafile
->
metafile_type
==
MetafileTypeWmfPlaceable
||
stat
=
GdipBeginContainer2
(
graphics
,
&
state
);
metafile
->
metafile_type
==
MetafileTypeWmf
))
stat
=
METAFILE_PlaybackGetDC
((
GpMetafile
*
)
metafile
);
if
(
stat
==
Ok
)
if
(
stat
==
Ok
)
EnumEnhMetaFile
(
0
,
metafile
->
hemf
,
enum_metafile_proc
,
&
data
,
NULL
);
{
stat
=
GdipSetPageScale
(
graphics
,
1
.
0
);
if
(
stat
==
Ok
)
stat
=
GdipSetPageUnit
(
graphics
,
UnitPixel
);
METAFILE_PlaybackReleaseDC
((
GpMetafile
*
)
metafile
);
if
(
stat
==
Ok
)
stat
=
GdipCreateMatrix
(
&
real_metafile
->
world_transform
);
if
(
stat
==
Ok
)
{
real_metafile
->
page_unit
=
UnitPixel
;
/* FIXME: Use frame unit here? */
real_metafile
->
page_scale
=
1
.
0
;
stat
=
METAFILE_PlaybackUpdateWorldTransform
(
real_metafile
);
}
if
(
stat
==
Ok
&&
(
metafile
->
metafile_type
==
MetafileTypeEmf
||
metafile
->
metafile_type
==
MetafileTypeWmfPlaceable
||
metafile
->
metafile_type
==
MetafileTypeWmf
))
stat
=
METAFILE_PlaybackGetDC
(
real_metafile
);
if
(
stat
==
Ok
)
EnumEnhMetaFile
(
0
,
metafile
->
hemf
,
enum_metafile_proc
,
&
data
,
NULL
);
METAFILE_PlaybackReleaseDC
(
real_metafile
);
GdipDeleteMatrix
(
real_metafile
->
world_transform
);
real_metafile
->
world_transform
=
NULL
;
GdipEndContainer
(
graphics
,
state
);
}
real_metafile
->
playback_graphics
=
NULL
;
real_metafile
->
playback_graphics
=
NULL
;
...
...
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