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
10516308
Commit
10516308
authored
Jun 24, 2016
by
Vincent Povirk
Committed by
Alexandre Julliard
Jul 03, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Clip metafile drawing to destination points.
Signed-off-by:
Vincent Povirk
<
vincent@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9df85c48
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
0 deletions
+47
-0
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+1
-0
metafile.c
dlls/gdiplus/metafile.c
+46
-0
No files found.
dlls/gdiplus/gdiplus_private.h
View file @
10516308
...
@@ -358,6 +358,7 @@ struct GpMetafile{
...
@@ -358,6 +358,7 @@ struct GpMetafile{
GpMatrix
*
world_transform
;
GpMatrix
*
world_transform
;
GpUnit
page_unit
;
GpUnit
page_unit
;
REAL
page_scale
;
REAL
page_scale
;
GpRegion
*
base_clip
;
/* clip region in device space for all metafile output */
};
};
struct
GpBitmap
{
struct
GpBitmap
{
...
...
dlls/gdiplus/metafile.c
View file @
10516308
...
@@ -591,6 +591,11 @@ static void METAFILE_PlaybackReleaseDC(GpMetafile *metafile)
...
@@ -591,6 +591,11 @@ static void METAFILE_PlaybackReleaseDC(GpMetafile *metafile)
}
}
}
}
static
GpStatus
METAFILE_PlaybackUpdateClip
(
GpMetafile
*
metafile
)
{
return
GdipCombineRegionRegion
(
metafile
->
playback_graphics
->
clip
,
metafile
->
base_clip
,
CombineModeReplace
);
}
static
GpStatus
METAFILE_PlaybackUpdateWorldTransform
(
GpMetafile
*
metafile
)
static
GpStatus
METAFILE_PlaybackUpdateWorldTransform
(
GpMetafile
*
metafile
)
{
{
GpMatrix
*
real_transform
;
GpMatrix
*
real_transform
;
...
@@ -822,6 +827,7 @@ GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoints(GpGraphics *graphics,
...
@@ -822,6 +827,7 @@ GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoints(GpGraphics *graphics,
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
;
GraphicsContainer
state
;
GpPath
*
dst_path
;
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
,
...
@@ -862,6 +868,38 @@ GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoints(GpGraphics *graphics,
...
@@ -862,6 +868,38 @@ GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoints(GpGraphics *graphics,
stat
=
GdipSetPageUnit
(
graphics
,
UnitPixel
);
stat
=
GdipSetPageUnit
(
graphics
,
UnitPixel
);
if
(
stat
==
Ok
)
if
(
stat
==
Ok
)
stat
=
GdipResetWorldTransform
(
graphics
);
if
(
stat
==
Ok
)
stat
=
GdipCreateRegion
(
&
real_metafile
->
base_clip
);
if
(
stat
==
Ok
)
stat
=
GdipGetClip
(
graphics
,
real_metafile
->
base_clip
);
if
(
stat
==
Ok
)
stat
=
GdipCreatePath
(
FillModeAlternate
,
&
dst_path
);
if
(
stat
==
Ok
)
{
GpPointF
clip_points
[
4
];
clip_points
[
0
]
=
real_metafile
->
playback_points
[
0
];
clip_points
[
1
]
=
real_metafile
->
playback_points
[
1
];
clip_points
[
2
].
X
=
real_metafile
->
playback_points
[
1
].
X
+
real_metafile
->
playback_points
[
2
].
X
-
real_metafile
->
playback_points
[
0
].
X
;
clip_points
[
2
].
Y
=
real_metafile
->
playback_points
[
1
].
Y
+
real_metafile
->
playback_points
[
2
].
Y
-
real_metafile
->
playback_points
[
0
].
Y
;
clip_points
[
3
]
=
real_metafile
->
playback_points
[
2
];
stat
=
GdipAddPathPolygon
(
dst_path
,
clip_points
,
4
);
if
(
stat
==
Ok
)
stat
=
GdipCombineRegionPath
(
real_metafile
->
base_clip
,
dst_path
,
CombineModeIntersect
);
GdipDeletePath
(
dst_path
);
}
if
(
stat
==
Ok
)
stat
=
GdipCreateMatrix
(
&
real_metafile
->
world_transform
);
stat
=
GdipCreateMatrix
(
&
real_metafile
->
world_transform
);
if
(
stat
==
Ok
)
if
(
stat
==
Ok
)
...
@@ -871,6 +909,11 @@ GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoints(GpGraphics *graphics,
...
@@ -871,6 +909,11 @@ GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoints(GpGraphics *graphics,
stat
=
METAFILE_PlaybackUpdateWorldTransform
(
real_metafile
);
stat
=
METAFILE_PlaybackUpdateWorldTransform
(
real_metafile
);
}
}
if
(
stat
==
Ok
)
{
stat
=
METAFILE_PlaybackUpdateClip
(
real_metafile
);
}
if
(
stat
==
Ok
&&
(
metafile
->
metafile_type
==
MetafileTypeEmf
||
if
(
stat
==
Ok
&&
(
metafile
->
metafile_type
==
MetafileTypeEmf
||
metafile
->
metafile_type
==
MetafileTypeWmfPlaceable
||
metafile
->
metafile_type
==
MetafileTypeWmfPlaceable
||
metafile
->
metafile_type
==
MetafileTypeWmf
))
metafile
->
metafile_type
==
MetafileTypeWmf
))
...
@@ -884,6 +927,9 @@ GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoints(GpGraphics *graphics,
...
@@ -884,6 +927,9 @@ GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoints(GpGraphics *graphics,
GdipDeleteMatrix
(
real_metafile
->
world_transform
);
GdipDeleteMatrix
(
real_metafile
->
world_transform
);
real_metafile
->
world_transform
=
NULL
;
real_metafile
->
world_transform
=
NULL
;
GdipDeleteRegion
(
real_metafile
->
base_clip
);
real_metafile
->
base_clip
=
NULL
;
GdipEndContainer
(
graphics
,
state
);
GdipEndContainer
(
graphics
,
state
);
}
}
...
...
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