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
1e67fcce
Commit
1e67fcce
authored
Apr 06, 2016
by
Vincent Povirk
Committed by
Alexandre Julliard
Apr 07, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add test for creating a metafile with NULL frameRect.
Signed-off-by:
Vincent Povirk
<
vincent@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
18e65a95
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
112 additions
and
0 deletions
+112
-0
metafile.c
dlls/gdiplus/tests/metafile.c
+112
-0
No files found.
dlls/gdiplus/tests/metafile.c
View file @
1e67fcce
...
...
@@ -862,6 +862,117 @@ static void test_fillrect(void)
expect
(
Ok
,
stat
);
}
static
void
test_nullframerect
(
void
)
{
GpStatus
stat
;
GpMetafile
*
metafile
;
GpGraphics
*
graphics
;
HDC
hdc
,
metafile_dc
;
static
const
WCHAR
description
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
't'
,
'e'
,
's'
,
't'
,
0
};
GpBrush
*
brush
;
HBRUSH
hbrush
,
holdbrush
;
GpRectF
bounds
;
GpUnit
unit
;
hdc
=
CreateCompatibleDC
(
0
);
stat
=
GdipRecordMetafile
(
hdc
,
EmfTypeEmfPlusOnly
,
NULL
,
MetafileFrameUnitPixel
,
description
,
&
metafile
);
todo_wine
expect
(
Ok
,
stat
);
DeleteDC
(
hdc
);
if
(
stat
!=
Ok
)
return
;
stat
=
GdipGetImageBounds
((
GpImage
*
)
metafile
,
&
bounds
,
&
unit
);
expect
(
Ok
,
stat
);
expect
(
UnitPixel
,
unit
);
expectf
(
0
.
0
,
bounds
.
X
);
expectf
(
0
.
0
,
bounds
.
Y
);
expectf
(
1
.
0
,
bounds
.
Width
);
expectf
(
1
.
0
,
bounds
.
Height
);
stat
=
GdipGetImageGraphicsContext
((
GpImage
*
)
metafile
,
&
graphics
);
expect
(
Ok
,
stat
);
stat
=
GdipCreateSolidFill
((
ARGB
)
0xff0000ff
,
(
GpSolidFill
**
)
&
brush
);
expect
(
Ok
,
stat
);
stat
=
GdipFillRectangleI
(
graphics
,
brush
,
25
,
25
,
75
,
75
);
expect
(
Ok
,
stat
);
stat
=
GdipDeleteBrush
(
brush
);
expect
(
Ok
,
stat
);
stat
=
GdipGetImageBounds
((
GpImage
*
)
metafile
,
&
bounds
,
&
unit
);
expect
(
Ok
,
stat
);
expect
(
UnitPixel
,
unit
);
expectf
(
0
.
0
,
bounds
.
X
);
expectf
(
0
.
0
,
bounds
.
Y
);
expectf
(
1
.
0
,
bounds
.
Width
);
expectf
(
1
.
0
,
bounds
.
Height
);
stat
=
GdipDeleteGraphics
(
graphics
);
expect
(
Ok
,
stat
);
stat
=
GdipGetImageBounds
((
GpImage
*
)
metafile
,
&
bounds
,
&
unit
);
expect
(
Ok
,
stat
);
expect
(
UnitPixel
,
unit
);
expectf_
(
25
.
0
,
bounds
.
X
,
0
.
05
);
expectf_
(
25
.
0
,
bounds
.
Y
,
0
.
05
);
expectf_
(
75
.
0
,
bounds
.
Width
,
0
.
05
);
expectf_
(
75
.
0
,
bounds
.
Height
,
0
.
05
);
stat
=
GdipDisposeImage
((
GpImage
*
)
metafile
);
expect
(
Ok
,
stat
);
hdc
=
CreateCompatibleDC
(
0
);
stat
=
GdipRecordMetafile
(
hdc
,
EmfTypeEmfPlusOnly
,
NULL
,
MetafileFrameUnitMillimeter
,
description
,
&
metafile
);
expect
(
Ok
,
stat
);
DeleteDC
(
hdc
);
stat
=
GdipGetImageGraphicsContext
((
GpImage
*
)
metafile
,
&
graphics
);
expect
(
Ok
,
stat
);
stat
=
GdipGetDC
(
graphics
,
&
metafile_dc
);
expect
(
Ok
,
stat
);
if
(
stat
!=
Ok
)
{
GdipDeleteGraphics
(
graphics
);
GdipDisposeImage
((
GpImage
*
)
metafile
);
return
;
}
hbrush
=
CreateSolidBrush
(
0xff0000
);
holdbrush
=
SelectObject
(
metafile_dc
,
hbrush
);
Rectangle
(
metafile_dc
,
25
,
25
,
75
,
75
);
SelectObject
(
metafile_dc
,
holdbrush
);
DeleteObject
(
hbrush
);
stat
=
GdipReleaseDC
(
graphics
,
metafile_dc
);
expect
(
Ok
,
stat
);
stat
=
GdipDeleteGraphics
(
graphics
);
expect
(
Ok
,
stat
);
stat
=
GdipGetImageBounds
((
GpImage
*
)
metafile
,
&
bounds
,
&
unit
);
expect
(
Ok
,
stat
);
expect
(
UnitPixel
,
unit
);
expectf_
(
25
.
0
,
bounds
.
X
,
0
.
05
);
expectf_
(
25
.
0
,
bounds
.
Y
,
0
.
05
);
expectf_
(
50
.
0
,
bounds
.
Width
,
0
.
05
);
expectf_
(
50
.
0
,
bounds
.
Height
,
0
.
05
);
stat
=
GdipDisposeImage
((
GpImage
*
)
metafile
);
expect
(
Ok
,
stat
);
}
static
const
emfplus_record
pagetransform_records
[]
=
{
{
0
,
EMR_HEADER
},
{
0
,
EmfPlusRecordTypeHeader
},
...
...
@@ -1226,6 +1337,7 @@ START_TEST(metafile)
test_getdc
();
test_emfonly
();
test_fillrect
();
test_nullframerect
();
test_pagetransform
();
test_converttoemfplus
();
test_frameunit
();
...
...
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