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
3f1281cc
Commit
3f1281cc
authored
Nov 22, 2009
by
Charles Davis
Committed by
Alexandre Julliard
Nov 23, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32/tests: Test BitBlt() to an enhanced metafile.
parent
b6f841ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
122 additions
and
0 deletions
+122
-0
metafile.c
dlls/gdi32/tests/metafile.c
+122
-0
No files found.
dlls/gdi32/tests/metafile.c
View file @
3f1281cc
...
...
@@ -1030,6 +1030,63 @@ static const unsigned char EMF_LINETO_MM_TEXT_BITS[] = {
0x14
,
0x00
,
0x00
,
0x00
};
static
const
unsigned
char
EMF_BITBLT
[]
=
{
0x01
,
0x00
,
0x00
,
0x00
,
0x6c
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x03
,
0x00
,
0x00
,
0x00
,
0x03
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x6a
,
0x00
,
0x00
,
0x00
,
0x6a
,
0x00
,
0x00
,
0x00
,
0x20
,
0x45
,
0x4d
,
0x46
,
0x00
,
0x00
,
0x01
,
0x00
,
0xa0
,
0x01
,
0x00
,
0x00
,
0x04
,
0x00
,
0x00
,
0x00
,
0x01
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x23
,
0x04
,
0x00
,
0x00
,
0x3b
,
0x02
,
0x00
,
0x00
,
0x75
,
0x01
,
0x00
,
0x00
,
0xc9
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x08
,
0xb1
,
0x05
,
0x00
,
0x28
,
0x11
,
0x03
,
0x00
,
0x4c
,
0x00
,
0x00
,
0x00
,
0xbc
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x03
,
0x00
,
0x00
,
0x00
,
0x03
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x04
,
0x00
,
0x00
,
0x00
,
0x04
,
0x00
,
0x00
,
0x00
,
0x20
,
0x00
,
0xcc
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x80
,
0x3f
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x80
,
0x3f
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xff
,
0xff
,
0xff
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x64
,
0x00
,
0x00
,
0x00
,
0x28
,
0x00
,
0x00
,
0x00
,
0x8c
,
0x00
,
0x00
,
0x00
,
0x30
,
0x00
,
0x00
,
0x00
,
0x28
,
0x00
,
0x00
,
0x00
,
0x04
,
0x00
,
0x00
,
0x00
,
0x04
,
0x00
,
0x00
,
0x00
,
0x01
,
0x00
,
0x18
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x30
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x4c
,
0x00
,
0x00
,
0x00
,
0x64
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x03
,
0x00
,
0x00
,
0x00
,
0x03
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x04
,
0x00
,
0x00
,
0x00
,
0x04
,
0x00
,
0x00
,
0x00
,
0x62
,
0x00
,
0xff
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x80
,
0x3f
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x80
,
0x3f
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x0e
,
0x00
,
0x00
,
0x00
,
0x14
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x10
,
0x00
,
0x00
,
0x00
,
0x14
,
0x00
,
0x00
,
0x00
};
/* For debugging or dumping the raw metafiles produced by
* new test functions.
*/
...
...
@@ -1382,6 +1439,70 @@ static int compare_emf_bits(const HENHMETAFILE mf, const unsigned char *bits,
return
0
;
}
/* tests blitting to an EMF */
static
void
test_emf_BitBlt
(
void
)
{
HDC
hdcDisplay
,
hdcMetafile
,
hdcBitmap
;
HBITMAP
hBitmap
,
hOldBitmap
;
HENHMETAFILE
hMetafile
;
#define BMP_DIM 4
BITMAPINFOHEADER
bmih
=
{
sizeof
(
BITMAPINFOHEADER
),
BMP_DIM
,
/* biWidth */
BMP_DIM
,
/* biHeight */
1
,
/* biPlanes */
24
,
/* biBitCount */
BI_RGB
,
/* biCompression */
0
,
/* biXPelsPerMeter */
0
,
/* biYPelsPerMeter */
0
,
/* biClrUsed */
0
,
/* biClrImportant */
};
void
*
bits
;
BOOL
ret
;
hdcDisplay
=
CreateDCA
(
"DISPLAY"
,
NULL
,
NULL
,
NULL
);
ok
(
hdcDisplay
!=
0
,
"CreateDCA error %d
\n
"
,
GetLastError
()
);
hdcBitmap
=
CreateCompatibleDC
(
hdcDisplay
);
ok
(
hdcBitmap
!=
0
,
"CreateCompatibleDC failed
\n
"
);
bmih
.
biXPelsPerMeter
=
MulDiv
(
GetDeviceCaps
(
hdcDisplay
,
LOGPIXELSX
),
100
,
3937
);
bmih
.
biYPelsPerMeter
=
MulDiv
(
GetDeviceCaps
(
hdcDisplay
,
LOGPIXELSY
),
100
,
3937
);
hBitmap
=
CreateDIBSection
(
hdcDisplay
,
(
const
BITMAPINFO
*
)
&
bmih
,
DIB_RGB_COLORS
,
&
bits
,
NULL
,
0
);
hOldBitmap
=
SelectObject
(
hdcBitmap
,
hBitmap
);
hdcMetafile
=
CreateEnhMetaFileA
(
hdcBitmap
,
NULL
,
NULL
,
NULL
);
ok
(
hdcMetafile
!=
0
,
"CreateEnhMetaFileA failed
\n
"
);
/* First fill the bitmap DC with something recognizable, like BLACKNESS */
ret
=
BitBlt
(
hdcBitmap
,
0
,
0
,
BMP_DIM
,
BMP_DIM
,
0
,
0
,
0
,
BLACKNESS
);
ok
(
ret
,
"BitBlt(BLACKNESS) failed
\n
"
);
ret
=
BitBlt
(
hdcMetafile
,
0
,
0
,
BMP_DIM
,
BMP_DIM
,
hdcBitmap
,
0
,
0
,
SRCCOPY
);
ok
(
ret
,
"BitBlt(SRCCOPY) failed
\n
"
);
ret
=
BitBlt
(
hdcMetafile
,
0
,
0
,
BMP_DIM
,
BMP_DIM
,
0
,
0
,
0
,
WHITENESS
);
ok
(
ret
,
"BitBlt(WHITENESS) failed
\n
"
);
hMetafile
=
CloseEnhMetaFile
(
hdcMetafile
);
ok
(
hMetafile
!=
0
,
"CloseEnhMetaFile failed
\n
"
);
if
(
compare_emf_bits
(
hMetafile
,
EMF_BITBLT
,
sizeof
(
EMF_BITBLT
),
"emf_BitBlt"
,
FALSE
)
!=
0
)
{
dump_emf_bits
(
hMetafile
,
"emf_BitBlt"
);
dump_emf_records
(
hMetafile
,
"emf_BitBlt"
);
}
SelectObject
(
hdcBitmap
,
hOldBitmap
);
DeleteObject
(
hBitmap
);
DeleteDC
(
hdcBitmap
);
DeleteDC
(
hdcDisplay
);
#undef BMP_DIM
}
/* Test a blank metafile. May be used as a template for new tests. */
static
void
test_mf_Blank
(
void
)
...
...
@@ -2628,6 +2749,7 @@ START_TEST(metafile)
/* For enhanced metafiles (enhmfdrv) */
test_ExtTextOut
();
test_SaveDC
();
test_emf_BitBlt
();
/* For win-format metafiles (mfdrv) */
test_mf_SaveDC
();
...
...
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