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
a65718a3
Commit
a65718a3
authored
Aug 03, 2016
by
Vincent Povirk
Committed by
Alexandre Julliard
Aug 03, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implement ResetWorldTransform metafile playback/recording.
Signed-off-by:
Vincent Povirk
<
vincent@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1816698f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
0 deletions
+64
-0
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+1
-0
graphics.c
dlls/gdiplus/graphics.c
+9
-0
metafile.c
dlls/gdiplus/metafile.c
+28
-0
metafile.c
dlls/gdiplus/tests/metafile.c
+26
-0
No files found.
dlls/gdiplus/gdiplus_private.h
View file @
a65718a3
...
...
@@ -91,6 +91,7 @@ extern GpStatus METAFILE_FillRectangles(GpMetafile* metafile, GpBrush* brush,
GDIPCONST
GpRectF
*
rects
,
INT
count
)
DECLSPEC_HIDDEN
;
extern
GpStatus
METAFILE_SetPageTransform
(
GpMetafile
*
metafile
,
GpUnit
unit
,
REAL
scale
)
DECLSPEC_HIDDEN
;
extern
GpStatus
METAFILE_ScaleWorldTransform
(
GpMetafile
*
metafile
,
REAL
sx
,
REAL
sy
,
MatrixOrder
order
)
DECLSPEC_HIDDEN
;
extern
GpStatus
METAFILE_ResetWorldTransform
(
GpMetafile
*
metafile
)
DECLSPEC_HIDDEN
;
extern
GpStatus
METAFILE_GraphicsDeleted
(
GpMetafile
*
metafile
)
DECLSPEC_HIDDEN
;
extern
void
calc_curve_bezier
(
const
GpPointF
*
pts
,
REAL
tension
,
REAL
*
x1
,
...
...
dlls/gdiplus/graphics.c
View file @
a65718a3
...
...
@@ -5128,6 +5128,8 @@ GpStatus WINGDIPAPI GdipResetClip(GpGraphics *graphics)
GpStatus
WINGDIPAPI
GdipResetWorldTransform
(
GpGraphics
*
graphics
)
{
GpStatus
stat
;
TRACE
(
"(%p)
\n
"
,
graphics
);
if
(
!
graphics
)
...
...
@@ -5136,6 +5138,13 @@ GpStatus WINGDIPAPI GdipResetWorldTransform(GpGraphics *graphics)
if
(
graphics
->
busy
)
return
ObjectBusy
;
if
(
graphics
->
image
&&
graphics
->
image
->
type
==
ImageTypeMetafile
)
{
stat
=
METAFILE_ResetWorldTransform
((
GpMetafile
*
)
graphics
->
image
);
if
(
stat
!=
Ok
)
return
stat
;
}
return
GdipSetMatrixElements
(
&
graphics
->
worldtrans
,
1
.
0
,
0
.
0
,
0
.
0
,
1
.
0
,
0
.
0
,
0
.
0
);
}
...
...
dlls/gdiplus/metafile.c
View file @
a65718a3
...
...
@@ -586,6 +586,28 @@ GpStatus METAFILE_ScaleWorldTransform(GpMetafile* metafile, REAL sx, REAL sy, Ma
return
Ok
;
}
GpStatus
METAFILE_ResetWorldTransform
(
GpMetafile
*
metafile
)
{
if
(
metafile
->
metafile_type
==
MetafileTypeEmfPlusOnly
||
metafile
->
metafile_type
==
MetafileTypeEmfPlusDual
)
{
EmfPlusRecordHeader
*
record
;
GpStatus
stat
;
stat
=
METAFILE_AllocateRecord
(
metafile
,
sizeof
(
EmfPlusRecordHeader
),
(
void
**
)
&
record
);
if
(
stat
!=
Ok
)
return
stat
;
record
->
Type
=
EmfPlusRecordTypeResetWorldTransform
;
record
->
Flags
=
0
;
METAFILE_WriteRecords
(
metafile
);
}
return
Ok
;
}
GpStatus
METAFILE_ReleaseDC
(
GpMetafile
*
metafile
,
HDC
hdc
)
{
if
(
hdc
!=
metafile
->
record_dc
)
...
...
@@ -935,6 +957,12 @@ GpStatus WINGDIPAPI GdipPlayMetafileRecord(GDIPCONST GpMetafile *metafile,
return
METAFILE_PlaybackUpdateWorldTransform
(
real_metafile
);
}
case
EmfPlusRecordTypeResetWorldTransform
:
{
GdipSetMatrixElements
(
real_metafile
->
world_transform
,
1
.
0
,
0
.
0
,
0
.
0
,
1
.
0
,
0
.
0
,
0
.
0
);
return
METAFILE_PlaybackUpdateWorldTransform
(
real_metafile
);
}
default:
FIXME
(
"Not implemented for record type %x
\n
"
,
recordType
);
return
NotImplemented
;
...
...
dlls/gdiplus/tests/metafile.c
View file @
a65718a3
...
...
@@ -1273,6 +1273,8 @@ static const emfplus_record worldtransform_records[] = {
{
0
,
EmfPlusRecordTypeFillRects
},
{
0
,
EmfPlusRecordTypeScaleWorldTransform
},
{
0
,
EmfPlusRecordTypeFillRects
},
{
0
,
EmfPlusRecordTypeResetWorldTransform
},
{
0
,
EmfPlusRecordTypeFillRects
},
{
0
,
EmfPlusRecordTypeEndOfFile
},
{
0
,
EMR_EOF
},
{
0
}
...
...
@@ -1352,6 +1354,26 @@ static void test_worldtransform(void)
stat
=
GdipDeleteBrush
(
brush
);
expect
(
Ok
,
stat
);
/* reset transform */
stat
=
GdipResetWorldTransform
(
graphics
);
expect
(
Ok
,
stat
);
stat
=
GdipGetWorldTransform
(
graphics
,
transform
);
expect
(
Ok
,
stat
);
stat
=
GdipIsMatrixIdentity
(
transform
,
&
identity
);
expect
(
Ok
,
stat
);
expect
(
TRUE
,
identity
);
stat
=
GdipCreateSolidFill
((
ARGB
)
0xff00ffff
,
(
GpSolidFill
**
)
&
brush
);
expect
(
Ok
,
stat
);
stat
=
GdipFillRectangle
(
graphics
,
brush
,
1
.
0
,
0
.
0
,
1
.
0
,
1
.
0
);
expect
(
Ok
,
stat
);
stat
=
GdipDeleteBrush
(
brush
);
expect
(
Ok
,
stat
);
stat
=
GdipDeleteMatrix
(
transform
);
expect
(
Ok
,
stat
);
...
...
@@ -1382,6 +1404,10 @@ static void test_worldtransform(void)
expect
(
Ok
,
stat
);
expect
(
0xff00ff00
,
color
);
stat
=
GdipBitmapGetPixel
(
bitmap
,
30
,
10
,
&
color
);
expect
(
Ok
,
stat
);
expect
(
0xff00ffff
,
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