This passes on my Windows XP vm and on Wine here.
On Tue, Nov 17, 2009 at 12:44 PM, Charles Davis cdavis@mymail.mines.edu wrote:
Hi,
I have a test that I wrote from scratch for bug 4543. It tests the operation of BitBlt to a metafile, first from the screen then pure whiteness. Unfortunately, I have no Windows boxes to test on, so I need people to run my test on Windows. After all, I need to verify that this test is an accurate representation of Windows' behavior!
Also, testing under Wine would be appreciated. As a Mac user, I don't think my system is representative of the vast majority of Wine users (who probably run Linux).
I've attached the patch so you can build a gdi32_test.exe that contains my tests.
Thanks in advance.
Chip
From db073155c888747b9259cb8fe0d5ff2a59ee5666 Mon Sep 17 00:00:00 2001 From: Charles Davis cdavis@mymail.mines.edu Date: Tue, 17 Nov 2009 11:10:50 -0700 Subject: [PATCH] gdi32/tests: Test BitBlt() to a metafile. To: wine-patches wine-patches@winehq.org Reply-To: wine-devel wine-devel@winehq.org
dlls/gdi32/tests/metafile.c | 68 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 68 insertions(+), 0 deletions(-)
diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c index b559901..6bf25e4 100644 --- a/dlls/gdi32/tests/metafile.c +++ b/dlls/gdi32/tests/metafile.c @@ -665,6 +665,74 @@ static void test_SaveDC(void) DestroyWindow(hwnd); }
+static int CALLBACK test_BitBlt_record(HDC hdc, HANDLETABLE *table, const ENHMETARECORD *emfr, int nobj, LPARAM data) +{
- UINT *pi = (UINT *)data;
- EMRBITBLT *emrbb;
- if(emfr->iType != EMR_BITBLT) return 1;
- emrbb = (EMRBITBLT *)emfr;
- *pi++;
- if(*pi > 2) return 1;
- ok( emrbb->xDest == 0, "wrong xDest for BitBlt record: got %d, expected 0\n", emrbb->xDest );
- ok( emrbb->yDest == 0, "wrong yDest for BitBlt record: got %d, expected 0\n", emrbb->yDest );
- ok( emrbb->xSrc == 0, "wrong xSrc for BitBlt record: got %d, expected 0\n", emrbb->xSrc );
- ok( emrbb->ySrc == 0, "wrong ySrc for BitBlt record: got %d, expected 0\n", emrbb->ySrc );
- ok( emrbb->cxDest == GetSystemMetrics(SM_CXSCREEN), "wrong cxDest for BitBlt record: got %d\n", emrbb->cxDest );
- ok( emrbb->cyDest == GetSystemMetrics(SM_CYSCREEN), "wrong cyDest for BitBlt record: got %d\n", emrbb->cyDest );
- if(*pi == 1) /* First BitBlt */
- {
- ok( emrbb->dwRop == SRCCOPY, "wrong ROP for BitBlt record: got %x, expected SRCCOPY\n", emrbb->dwRop );
- }
- else
- {
- ok( emrbb->dwRop == WHITENESS, "wrong ROP for BitBlt record: got %x, expected WHITENESS\n", emrbb->dwRop );
- }
- return 1;
+}
+static void test_emf_BitBlt(void) +{
- HDC hdcDisplay, hdcMetafile;
- HENHMETAFILE hMetafile;
- ENHMETAHEADER emh;
- BYTE *bits;
- BOOL ret;
- UINT i;
- hdcDisplay = CreateDCA(NULL, "DISPLAY", NULL, NULL);
- ok( hdcDisplay != 0, "CreateDCA error %d\n", GetLastError() );
- hdcMetafile = CreateEnhMetaFileA(hdcDisplay, NULL, NULL, NULL);
- ok( hdcMetafile != 0, "CreateEnhMetaFileA error %d\n", GetLastError() );
- ret = BitBlt(hdcMetafile, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), hdcDisplay, 0, 0, SRCCOPY);
- ok( ret, "BitBlt error %d\n", GetLastError() );
- ret = BitBlt(hdcMetafile, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), 0, 0, 0, WHITENESS);
- ok( ret, "BitBlt error %d\n", GetLastError() );
- hMetafile = CloseEnhMetaFile(hdcMetafile);
- ok( hMetafile != 0, "CloseEnhMetaFile error %d\n", GetLastError() );
- ret = GetEnhMetaFileHeader( hMetafile, sizeof(emh), &emh );
- ok( ret != 0, "GetEnhMetaFileHeader error %d\n", GetLastError() );
- ok( emh.dSignature == ENHMETA_SIGNATURE, "bad metafile signature %x\n", emh.dSignature );
- bits = HeapAlloc( GetProcessHeap(), 0, emh.nBytes );
- if(!bits)
- {
- skip( "not enough memory for EMF bits\n" );
- return;
- }
- ret = GetEnhMetaFileBits( hMetafile, emh.nBytes, bits );
- ok( ret != 0, "GetEnhMetaFileBits error %d\n", GetLastError() );
- for(i = 0; i < emh.nBytes; i++)
- ok( bits[i] == 0xff, "unexpected EMF bits: got %02x, expected 0xff\n", bits[i] );
- EnumEnhMetaFile(0, hMetafile, test_BitBlt_record, (LPARAM)&i, NULL);
- ok( i == 2, "too many/not enough BitBlt records: got %d, expected 2\n", i );
+}
static void test_mf_SaveDC(void) { HDC hdcMetafile; -- 1.6.5.2