Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
68b60c0d
Commit
68b60c0d
authored
Nov 20, 2013
by
Vincent Povirk
Committed by
Alexandre Julliard
Nov 25, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add metafile test for FillRectangles.
parent
681cd545
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
109 additions
and
0 deletions
+109
-0
metafile.c
dlls/gdiplus/tests/metafile.c
+109
-0
No files found.
dlls/gdiplus/tests/metafile.c
View file @
68b60c0d
...
...
@@ -601,6 +601,114 @@ static void test_emfonly(void)
ok
(
ret
!=
0
,
"Failed to delete enhmetafile %p
\n
"
,
hemf
);
}
static
const
emfplus_record
fillrect_records
[]
=
{
{
0
,
EMR_HEADER
},
{
0
,
EmfPlusRecordTypeHeader
},
{
0
,
EmfPlusRecordTypeFillRects
},
{
0
,
EmfPlusRecordTypeEndOfFile
},
{
0
,
EMR_EOF
},
{
0
}
};
static
void
test_fillrect
(
void
)
{
GpStatus
stat
;
GpMetafile
*
metafile
;
GpGraphics
*
graphics
;
HDC
hdc
;
HENHMETAFILE
hemf
;
static
const
GpRectF
frame
=
{
0
.
0
,
0
.
0
,
100
.
0
,
100
.
0
};
static
const
GpPointF
dst_points
[
3
]
=
{{
0
.
0
,
0
.
0
},{
100
.
0
,
0
.
0
},{
0
.
0
,
100
.
0
}};
static
const
GpPointF
dst_points_half
[
3
]
=
{{
0
.
0
,
0
.
0
},{
50
.
0
,
0
.
0
},{
0
.
0
,
50
.
0
}};
static
const
WCHAR
description
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
't'
,
'e'
,
's'
,
't'
,
0
};
GpBitmap
*
bitmap
;
ARGB
color
;
GpBrush
*
brush
;
hdc
=
CreateCompatibleDC
(
0
);
stat
=
GdipRecordMetafile
(
hdc
,
EmfTypeEmfPlusOnly
,
&
frame
,
MetafileFrameUnitPixel
,
description
,
&
metafile
);
expect
(
Ok
,
stat
);
DeleteDC
(
hdc
);
if
(
stat
!=
Ok
)
return
;
stat
=
GdipGetHemfFromMetafile
(
metafile
,
&
hemf
);
expect
(
InvalidParameter
,
stat
);
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
=
GdipDeleteGraphics
(
graphics
);
expect
(
Ok
,
stat
);
check_metafile
(
metafile
,
fillrect_records
,
"fillrect metafile"
,
dst_points
,
&
frame
,
UnitPixel
);
stat
=
GdipCreateBitmapFromScan0
(
100
,
100
,
0
,
PixelFormat32bppARGB
,
NULL
,
&
bitmap
);
expect
(
Ok
,
stat
);
stat
=
GdipGetImageGraphicsContext
((
GpImage
*
)
bitmap
,
&
graphics
);
expect
(
Ok
,
stat
);
play_metafile
(
metafile
,
graphics
,
fillrect_records
,
"fillrect playback"
,
dst_points
,
&
frame
,
UnitPixel
);
stat
=
GdipBitmapGetPixel
(
bitmap
,
15
,
15
,
&
color
);
expect
(
Ok
,
stat
);
expect
(
0
,
color
);
stat
=
GdipBitmapGetPixel
(
bitmap
,
50
,
50
,
&
color
);
expect
(
Ok
,
stat
);
expect
(
0xff0000ff
,
color
);
stat
=
GdipBitmapSetPixel
(
bitmap
,
50
,
50
,
0
);
expect
(
Ok
,
stat
);
play_metafile
(
metafile
,
graphics
,
fillrect_records
,
"fillrect playback"
,
dst_points_half
,
&
frame
,
UnitPixel
);
stat
=
GdipBitmapGetPixel
(
bitmap
,
15
,
15
,
&
color
);
expect
(
Ok
,
stat
);
expect
(
0xff0000ff
,
color
);
stat
=
GdipBitmapGetPixel
(
bitmap
,
50
,
50
,
&
color
);
expect
(
Ok
,
stat
);
expect
(
0
,
color
);
stat
=
GdipBitmapSetPixel
(
bitmap
,
15
,
15
,
0
);
expect
(
Ok
,
stat
);
stat
=
GdipDrawImagePointsRect
(
graphics
,
(
GpImage
*
)
metafile
,
dst_points
,
3
,
0
.
0
,
0
.
0
,
100
.
0
,
100
.
0
,
UnitPixel
,
NULL
,
NULL
,
NULL
);
expect
(
Ok
,
stat
);
stat
=
GdipBitmapGetPixel
(
bitmap
,
15
,
15
,
&
color
);
expect
(
Ok
,
stat
);
expect
(
0
,
color
);
stat
=
GdipBitmapGetPixel
(
bitmap
,
50
,
50
,
&
color
);
expect
(
Ok
,
stat
);
expect
(
0xff0000ff
,
color
);
stat
=
GdipDeleteGraphics
(
graphics
);
expect
(
Ok
,
stat
);
stat
=
GdipDisposeImage
((
GpImage
*
)
bitmap
);
expect
(
Ok
,
stat
);
stat
=
GdipDisposeImage
((
GpImage
*
)
metafile
);
expect
(
Ok
,
stat
);
}
START_TEST
(
metafile
)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
...
@@ -616,6 +724,7 @@ START_TEST(metafile)
test_empty
();
test_getdc
();
test_emfonly
();
test_fillrect
();
GdiplusShutdown
(
gdiplusToken
);
}
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