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
28cfa306
Commit
28cfa306
authored
Oct 07, 2016
by
Vincent Povirk
Committed by
Alexandre Julliard
Oct 10, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implement EMR_SETWORLDTRANSFORM playback.
Signed-off-by:
Vincent Povirk
<
vincent@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
094516d4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
15 deletions
+36
-15
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+1
-0
metafile.c
dlls/gdiplus/metafile.c
+34
-14
metafile.c
dlls/gdiplus/tests/metafile.c
+1
-1
No files found.
dlls/gdiplus/gdiplus_private.h
View file @
28cfa306
...
...
@@ -374,6 +374,7 @@ struct GpMetafile{
GpRectF
src_rect
;
HANDLETABLE
*
handle_table
;
int
handle_count
;
XFORM
gdiworldtransform
;
GpMatrix
*
world_transform
;
GpUnit
page_unit
;
REAL
page_scale
;
...
...
dlls/gdiplus/metafile.c
View file @
28cfa306
...
...
@@ -1040,6 +1040,30 @@ GpStatus WINGDIPAPI GdipGetHemfFromMetafile(GpMetafile *metafile, HENHMETAFILE *
return
Ok
;
}
static
GpStatus
METAFILE_PlaybackUpdateGdiTransform
(
GpMetafile
*
metafile
)
{
XFORM
combined
,
final
;
const
GpRectF
*
rect
;
const
GpPointF
*
pt
;
/* This transforms metafile device space to output points. */
rect
=
&
metafile
->
src_rect
;
pt
=
metafile
->
playback_points
;
final
.
eM11
=
(
pt
[
1
].
X
-
pt
[
0
].
X
)
/
rect
->
Width
;
final
.
eM21
=
(
pt
[
2
].
X
-
pt
[
0
].
X
)
/
rect
->
Height
;
final
.
eDx
=
pt
[
0
].
X
-
final
.
eM11
*
rect
->
X
-
final
.
eM21
*
rect
->
Y
;
final
.
eM12
=
(
pt
[
1
].
Y
-
pt
[
0
].
Y
)
/
rect
->
Width
;
final
.
eM22
=
(
pt
[
2
].
Y
-
pt
[
0
].
Y
)
/
rect
->
Height
;
final
.
eDy
=
pt
[
0
].
Y
-
final
.
eM12
*
rect
->
X
-
final
.
eM22
*
rect
->
Y
;
CombineTransform
(
&
combined
,
&
metafile
->
gdiworldtransform
,
&
final
);
SetGraphicsMode
(
metafile
->
playback_dc
,
GM_ADVANCED
);
SetWorldTransform
(
metafile
->
playback_dc
,
&
combined
);
return
Ok
;
}
static
GpStatus
METAFILE_PlaybackGetDC
(
GpMetafile
*
metafile
)
{
GpStatus
stat
=
Ok
;
...
...
@@ -1048,20 +1072,10 @@ static GpStatus METAFILE_PlaybackGetDC(GpMetafile *metafile)
if
(
stat
==
Ok
)
{
/* The result of GdipGetDC always expects device co-ordinates, but the
* device co-ordinates of the source metafile do not correspond to
* device co-ordinates of the destination. Therefore, we set up the DC
* so that the metafile's bounds map to the destination points where we
* are drawing this metafile. */
SetMapMode
(
metafile
->
playback_dc
,
MM_ANISOTROPIC
);
SetWindowOrgEx
(
metafile
->
playback_dc
,
metafile
->
bounds
.
X
,
metafile
->
bounds
.
Y
,
NULL
);
SetWindowExtEx
(
metafile
->
playback_dc
,
metafile
->
bounds
.
Width
,
metafile
->
bounds
.
Height
,
NULL
);
static
const
XFORM
identity
=
{
1
,
0
,
0
,
1
,
0
,
0
};
SetViewportOrgEx
(
metafile
->
playback_dc
,
metafile
->
playback_points
[
0
].
X
,
metafile
->
playback_points
[
0
].
Y
,
NULL
);
SetViewportExtEx
(
metafile
->
playback_dc
,
metafile
->
playback_points
[
1
].
X
-
metafile
->
playback_points
[
0
].
X
,
metafile
->
playback_points
[
2
].
Y
-
metafile
->
playback_points
[
0
].
Y
,
NULL
);
metafile
->
gdiworldtransform
=
identity
;
METAFILE_PlaybackUpdateGdiTransform
(
metafile
);
}
return
stat
;
...
...
@@ -1141,12 +1155,18 @@ GpStatus WINGDIPAPI GdipPlayMetafileRecord(GDIPCONST GpMetafile *metafile,
case
EMR_SETVIEWPORTORGEX
:
case
EMR_SETVIEWPORTEXTEX
:
case
EMR_EXTSELECTCLIPRGN
:
case
EMR_SETWORLDTRANSFORM
:
case
EMR_SCALEVIEWPORTEXTEX
:
case
EMR_SCALEWINDOWEXTEX
:
case
EMR_MODIFYWORLDTRANSFORM
:
FIXME
(
"not implemented for record type %x
\n
"
,
recordType
);
break
;
case
EMR_SETWORLDTRANSFORM
:
{
const
XFORM
*
xform
=
(
void
*
)
data
;
real_metafile
->
gdiworldtransform
=
*
xform
;
METAFILE_PlaybackUpdateGdiTransform
(
real_metafile
);
break
;
}
default:
break
;
}
...
...
dlls/gdiplus/tests/metafile.c
View file @
28cfa306
...
...
@@ -2260,7 +2260,7 @@ static void test_gditransform(void)
stat
=
GdipBitmapGetPixel
(
bitmap
,
30
,
30
,
&
color
);
expect
(
Ok
,
stat
);
todo_wine
expect
(
0x00000000
,
color
);
expect
(
0x00000000
,
color
);
stat
=
GdipDeleteGraphics
(
graphics
);
expect
(
Ok
,
stat
);
...
...
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