Wine-devel
Threads by month
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
May 2021
- 86 participants
- 705 discussions
[PATCH 1/7] riched20/tests: Simplify tests of IRichEditOle_InsertObject() by improving CHECK_REOBJECT_STRUCT().
by Jactry Zeng 24 May '21
by Jactry Zeng 24 May '21
24 May '21
Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com>
---
This series includes a patch superseded patch 205182.
---
dlls/riched20/tests/richole.c | 144 ++++++++++++----------------------
1 file changed, 48 insertions(+), 96 deletions(-)
diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c
index e6329c5b1b6..0fab1106a29 100644
--- a/dlls/riched20/tests/richole.c
+++ b/dlls/riched20/tests/richole.c
@@ -3212,11 +3212,18 @@ static void fill_reobject_struct(REOBJECT *reobj, LONG cp, LPOLEOBJECT poleobj,
reobj->dwUser = user;
}
-#define CHECK_REOBJECT_STRUCT(reobj,poleobj,pstg,polesite,user) \
- _check_reobject_struct(reobj, poleobj, pstg, polesite, user, __LINE__)
-static void _check_reobject_struct(REOBJECT reobj, LPOLEOBJECT poleobj, LPSTORAGE pstg,
- LPOLECLIENTSITE polesite, DWORD user, int line)
+#define CHECK_REOBJECT_STRUCT(reole,index,flags,cp,poleobj,pstg,polesite,user) \
+ _check_reobject_struct(reole, index, flags, cp, poleobj, pstg, polesite, user, __LINE__)
+static void _check_reobject_struct(IRichEditOle *reole, LONG index, DWORD flags, LONG cp,
+ LPOLEOBJECT poleobj, LPSTORAGE pstg, LPOLECLIENTSITE polesite, DWORD user, int line)
{
+ REOBJECT reobj;
+ HRESULT hr;
+
+ reobj.cbStruct = sizeof(reobj);
+ reobj.cp = cp;
+ hr = IRichEditOle_GetObject(reole, index, &reobj, flags);
+ ok(hr == S_OK, "IRichEditOle_GetObject failed: %#x.\n", hr);
ok_(__FILE__,line)(reobj.poleobj == poleobj, "got wrong object interface.\n");
ok_(__FILE__,line)(reobj.pstg == pstg, "got wrong storage interface.\n");
ok_(__FILE__,line)(reobj.polesite == polesite, "got wrong site interface.\n");
@@ -3229,7 +3236,7 @@ static void test_InsertObject(void)
IRichEditOle *reole = NULL;
ITextDocument *doc = NULL;
IOleClientSite *clientsite;
- REOBJECT reo1, reo2, reo3, received_reo1, received_reo2, received_reo3, received_reo4;
+ REOBJECT reo1, reo2, reo3, received_reo;
HRESULT hr;
HWND hwnd;
LONG count;
@@ -3274,132 +3281,77 @@ static void test_InsertObject(void)
IOleClientSite_Release(clientsite);
/* tests below show that order of rebject (from 0 to 2) is: reo1,reo3,reo2 */
- received_reo1.cbStruct = sizeof(received_reo1);
- hr = IRichEditOle_GetObject(reole, 0, &received_reo1, REO_GETOBJ_ALL_INTERFACES);
- ok(hr == S_OK, "IRichEditOle_GetObject failed: 0x%08x\n", hr);
- CHECK_REOBJECT_STRUCT(received_reo1, NULL, NULL, reo1.polesite, 1);
-
- received_reo2.cbStruct = sizeof(received_reo2);
- hr = IRichEditOle_GetObject(reole, 1, &received_reo2, REO_GETOBJ_ALL_INTERFACES);
- ok(hr == S_OK, "IRichEditOle_GetObject failed: 0x%08x\n", hr);
- CHECK_REOBJECT_STRUCT(received_reo2, NULL, NULL, reo3.polesite, 3);
-
- received_reo3.cbStruct = sizeof(received_reo3);
- hr = IRichEditOle_GetObject(reole, 2, &received_reo3, REO_GETOBJ_ALL_INTERFACES);
- ok(hr == S_OK, "IRichEditOle_GetObject failed: 0x%08x\n", hr);
- CHECK_REOBJECT_STRUCT(received_reo3, NULL, NULL, reo2.polesite, 2);
+ CHECK_REOBJECT_STRUCT(reole, 0, REO_GETOBJ_ALL_INTERFACES, 0, NULL, NULL, reo1.polesite, 1);
+ CHECK_REOBJECT_STRUCT(reole, 1, REO_GETOBJ_ALL_INTERFACES, 0, NULL, NULL, reo3.polesite, 3);
+ CHECK_REOBJECT_STRUCT(reole, 2, REO_GETOBJ_ALL_INTERFACES, 0, NULL, NULL, reo2.polesite, 2);
hr = IRichEditOle_GetObject(reole, 2, NULL, REO_GETOBJ_ALL_INTERFACES);
ok(hr == E_INVALIDARG, "IRichEditOle_GetObject should fail: 0x%08x\n", hr);
- received_reo4.cbStruct = 0;
- hr = IRichEditOle_GetObject(reole, 2, &received_reo4, REO_GETOBJ_ALL_INTERFACES);
+ received_reo.cbStruct = 0;
+ hr = IRichEditOle_GetObject(reole, 2, &received_reo, REO_GETOBJ_ALL_INTERFACES);
ok(hr == E_INVALIDARG, "IRichEditOle_GetObject should fail: 0x%08x\n", hr);
- received_reo4.cbStruct = sizeof(received_reo4);
- hr = IRichEditOle_GetObject(reole, 2, &received_reo4, REO_GETOBJ_PSTG);
- ok(hr == S_OK, "IRichEditOle_GetObject failed: 0x%08x\n", hr);
- CHECK_REOBJECT_STRUCT(received_reo4, NULL, NULL, NULL, 2);
+ CHECK_REOBJECT_STRUCT(reole, 2, REO_GETOBJ_PSTG, 0, NULL, NULL, NULL, 2);
+ CHECK_REOBJECT_STRUCT(reole, 2, REO_GETOBJ_POLESITE, 0, NULL, NULL, reo2.polesite, 2);
- hr = IRichEditOle_GetObject(reole, 2, &received_reo4, REO_GETOBJ_POLESITE);
- ok(hr == S_OK, "IRichEditOle_GetObject failed: 0x%08x\n", hr);
- CHECK_REOBJECT_STRUCT(received_reo4, NULL, NULL, reo2.polesite, 2);
-
- hr = IRichEditOle_GetObject(reole, 3, &received_reo4, REO_GETOBJ_POLESITE);
+ hr = IRichEditOle_GetObject(reole, 3, &received_reo, REO_GETOBJ_POLESITE);
ok(hr == E_INVALIDARG, "IRichEditOle_GetObject should fail: 0x%08x\n", hr);
- hr = IRichEditOle_GetObject(reole, 4, &received_reo4, REO_GETOBJ_POLESITE);
+ hr = IRichEditOle_GetObject(reole, 4, &received_reo, REO_GETOBJ_POLESITE);
ok(hr == E_INVALIDARG, "IRichEditOle_GetObject should fail: 0x%08x\n", hr);
- hr = IRichEditOle_GetObject(reole, 1024, &received_reo4, REO_GETOBJ_POLESITE);
+ hr = IRichEditOle_GetObject(reole, 1024, &received_reo, REO_GETOBJ_POLESITE);
ok(hr == E_INVALIDARG, "IRichEditOle_GetObject should fail: 0x%08x\n", hr);
- hr = IRichEditOle_GetObject(reole, -10, &received_reo4, REO_GETOBJ_POLESITE);
+ hr = IRichEditOle_GetObject(reole, -10, &received_reo, REO_GETOBJ_POLESITE);
ok(hr == E_INVALIDARG, "IRichEditOle_GetObject should fail: 0x%08x\n", hr);
- /* received_reo4 will be zeroed before be used */
- hr = IRichEditOle_GetObject(reole, 2, &received_reo4, REO_GETOBJ_NO_INTERFACES);
- ok(hr == S_OK, "IRichEditOle_GetObject failed: 0x%08x\n", hr);
- CHECK_REOBJECT_STRUCT(received_reo4, NULL, NULL, NULL, 2);
-
- received_reo4.cbStruct = sizeof(received_reo4);
- received_reo4.cp = 0;
- hr = IRichEditOle_GetObject(reole, REO_IOB_USE_CP, &received_reo4, REO_GETOBJ_ALL_INTERFACES);
- ok(hr == S_OK, "IRichEditOle_GetObject failed: 0x%08x\n", hr);
- CHECK_REOBJECT_STRUCT(received_reo4, NULL, NULL, reo1.polesite, 1);
-
- received_reo4.cbStruct = sizeof(received_reo4);
- received_reo4.cp = 1;
- hr = IRichEditOle_GetObject(reole, REO_IOB_USE_CP, &received_reo4, REO_GETOBJ_ALL_INTERFACES);
+ /* received_reo will be zeroed before be used */
+ received_reo.cbStruct = sizeof(received_reo);
+ received_reo.polesite = (IOleClientSite *)0xdeadbeef;
+ hr = IRichEditOle_GetObject(reole, 2, &received_reo, REO_GETOBJ_NO_INTERFACES);
ok(hr == S_OK, "IRichEditOle_GetObject failed: 0x%08x\n", hr);
- CHECK_REOBJECT_STRUCT(received_reo4, NULL, NULL, reo3.polesite, 3);
+ ok(received_reo.polesite == (IOleClientSite *)NULL, "Got wrong site interface.\n");
- received_reo4.cbStruct = sizeof(received_reo4);
- received_reo4.cp = 2;
- hr = IRichEditOle_GetObject(reole, REO_IOB_USE_CP, &received_reo4, REO_GETOBJ_ALL_INTERFACES);
- ok(hr == S_OK, "IRichEditOle_GetObject failed: 0x%08x\n", hr);
- CHECK_REOBJECT_STRUCT(received_reo4, NULL, NULL, reo2.polesite, 2);
+ CHECK_REOBJECT_STRUCT(reole, REO_IOB_USE_CP, REO_GETOBJ_ALL_INTERFACES, 0, NULL, NULL, reo1.polesite, 1);
+ CHECK_REOBJECT_STRUCT(reole, REO_IOB_USE_CP, REO_GETOBJ_ALL_INTERFACES, 1, NULL, NULL, reo3.polesite, 3);
+ CHECK_REOBJECT_STRUCT(reole, REO_IOB_USE_CP, REO_GETOBJ_ALL_INTERFACES, 2, NULL, NULL, reo2.polesite, 2);
- received_reo4.cbStruct = sizeof(received_reo4);
- received_reo4.cp = 4;
- hr = IRichEditOle_GetObject(reole, REO_IOB_USE_CP, &received_reo4, REO_GETOBJ_ALL_INTERFACES);
+ received_reo.cbStruct = sizeof(received_reo);
+ received_reo.polesite = (IOleClientSite *)0xdeadbeef;
+ received_reo.dwUser = 4;
+ received_reo.cp = 4;
+ hr = IRichEditOle_GetObject(reole, REO_IOB_USE_CP, &received_reo, REO_GETOBJ_ALL_INTERFACES);
ok(hr == E_INVALIDARG, "IRichEditOle_GetObject should fail: 0x%08x\n", hr);
- /* received_reo4 didn't be zeroed in E_INVALIDARG case */
- CHECK_REOBJECT_STRUCT(received_reo4, NULL, NULL, reo2.polesite, 2);
+ ok(received_reo.polesite == (IOleClientSite *)0xdeadbeef, "Got wrong site interface.\n");
+ ok(received_reo.dwUser == 4, "Got wrong user-defined value: %d.\n", received_reo.dwUser);
SendMessageA(hwnd, EM_SETSEL, 0, 1);
- received_reo4.cbStruct = sizeof(received_reo4);
- received_reo4.cp = 1;
- hr = IRichEditOle_GetObject(reole, REO_IOB_SELECTION, &received_reo4, REO_GETOBJ_ALL_INTERFACES);
- ok(hr == S_OK, "IRichEditOle_GetObject failed: 0x%08x\n", hr);
- CHECK_REOBJECT_STRUCT(received_reo4, NULL, NULL, reo1.polesite, 1);
+ CHECK_REOBJECT_STRUCT(reole, REO_IOB_SELECTION, REO_GETOBJ_ALL_INTERFACES, 0, NULL, NULL, reo1.polesite, 1);
SendMessageA(hwnd, EM_SETSEL, 1, 2);
- received_reo4.cbStruct = sizeof(received_reo4);
- received_reo4.cp = 0;
- hr = IRichEditOle_GetObject(reole, REO_IOB_SELECTION, &received_reo4, REO_GETOBJ_ALL_INTERFACES);
- ok(hr == S_OK, "IRichEditOle_GetObject failed: 0x%08x\n", hr);
- CHECK_REOBJECT_STRUCT(received_reo4, NULL, NULL, reo3.polesite, 3);
+ CHECK_REOBJECT_STRUCT(reole, REO_IOB_SELECTION, REO_GETOBJ_ALL_INTERFACES, 0, NULL, NULL, reo3.polesite, 3);
SendMessageA(hwnd, EM_SETSEL, 2, 3);
- received_reo4.cbStruct = sizeof(received_reo4);
- received_reo4.cp = 0;
- hr = IRichEditOle_GetObject(reole, REO_IOB_SELECTION, &received_reo4, REO_GETOBJ_ALL_INTERFACES);
- ok(hr == S_OK, "IRichEditOle_GetObject failed: 0x%08x\n", hr);
- CHECK_REOBJECT_STRUCT(received_reo4, NULL, NULL, reo2.polesite, 2);
+ CHECK_REOBJECT_STRUCT(reole, REO_IOB_SELECTION, REO_GETOBJ_ALL_INTERFACES, 0, NULL, NULL, reo2.polesite, 2);
SendMessageA(hwnd, EM_SETSEL, 0, 2);
- received_reo4.cbStruct = sizeof(received_reo4);
- received_reo4.cp = 0;
- hr = IRichEditOle_GetObject(reole, REO_IOB_SELECTION, &received_reo4, REO_GETOBJ_ALL_INTERFACES);
- ok(hr == S_OK, "IRichEditOle_GetObject failed: 0x%08x\n", hr);
- CHECK_REOBJECT_STRUCT(received_reo4, NULL, NULL, reo1.polesite, 1);
+ CHECK_REOBJECT_STRUCT(reole, REO_IOB_SELECTION, REO_GETOBJ_ALL_INTERFACES, 0, NULL, NULL, reo1.polesite, 1);
SendMessageA(hwnd, EM_SETSEL, 1, 3);
- received_reo4.cbStruct = sizeof(received_reo4);
- received_reo4.cp = 0;
- hr = IRichEditOle_GetObject(reole, REO_IOB_SELECTION, &received_reo4, REO_GETOBJ_ALL_INTERFACES);
- ok(hr == S_OK, "IRichEditOle_GetObject failed: 0x%08x\n", hr);
- CHECK_REOBJECT_STRUCT(received_reo4, NULL, NULL, reo3.polesite, 3);
+ CHECK_REOBJECT_STRUCT(reole, REO_IOB_SELECTION, REO_GETOBJ_ALL_INTERFACES, 0, NULL, NULL, reo3.polesite, 3);
SendMessageA(hwnd, EM_SETSEL, 2, 0);
- received_reo4.cbStruct = sizeof(received_reo4);
- received_reo4.cp = 0;
- hr = IRichEditOle_GetObject(reole, REO_IOB_SELECTION, &received_reo4, REO_GETOBJ_ALL_INTERFACES);
- ok(hr == S_OK, "IRichEditOle_GetObject failed: 0x%08x\n", hr);
- CHECK_REOBJECT_STRUCT(received_reo4, NULL, NULL, reo1.polesite, 1);
+ CHECK_REOBJECT_STRUCT(reole, REO_IOB_SELECTION, REO_GETOBJ_ALL_INTERFACES, 0, NULL, NULL, reo1.polesite, 1);
SendMessageA(hwnd, EM_SETSEL, 0, 6);
- received_reo4.cbStruct = sizeof(received_reo4);
- received_reo4.cp = 0;
- hr = IRichEditOle_GetObject(reole, REO_IOB_SELECTION, &received_reo4, REO_GETOBJ_ALL_INTERFACES);
- ok(hr == S_OK, "IRichEditOle_GetObject failed: 0x%08x\n", hr);
- CHECK_REOBJECT_STRUCT(received_reo4, NULL, NULL, reo1.polesite, 1);
+ CHECK_REOBJECT_STRUCT(reole, REO_IOB_SELECTION, REO_GETOBJ_ALL_INTERFACES, 0, NULL, NULL, reo1.polesite, 1);
SendMessageA(hwnd, EM_SETSEL, 4, 5);
- received_reo4.cbStruct = sizeof(received_reo4);
- received_reo4.cp = 0;
- hr = IRichEditOle_GetObject(reole, REO_IOB_SELECTION, &received_reo4, REO_GETOBJ_ALL_INTERFACES);
+ received_reo.cbStruct = sizeof(received_reo);
+ received_reo.cp = 0;
+ hr = IRichEditOle_GetObject(reole, REO_IOB_SELECTION, &received_reo, REO_GETOBJ_ALL_INTERFACES);
ok(hr == E_INVALIDARG, "IRichEditOle_GetObject should fail: 0x%08x\n", hr);
release_interfaces(&hwnd, &reole, &doc, NULL);
--
2.30.2
2
14
24 May '21
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
dlls/kernel32/process.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index b31d73bc5a5..9041b00d512 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -638,7 +638,7 @@ DWORD WINAPI GetMaximumProcessorCount(WORD group)
/***********************************************************************
* GetMaximumProcessorGroupCount (KERNEL32.@)
*/
-DWORD WINAPI GetMaximumProcessorGroupCount(void)
+WORD WINAPI GetMaximumProcessorGroupCount(void)
{
FIXME("semi-stub, always returning 1\n");
return 1;
--
2.31.1
3
7
COLORONCOLOR(STRETCH_DELETESCANS) was used in place of HALFTONE. COLORONCOLOR mode may delete rows
of pixels without trying to preserve information so it will cause Wine to render poorly when the
destination rectangle is small.
According to tests, HALFTONE mode uses box filter when doing integer downscaling and nearest
neighbor interpolation when doing upscaling in both horizontally and vertically. In other cases,
HALFTONE mode uses a lanczos3 like algorithm to interpolate pixels. There are also other heuristics
involved. For example, shrinking a 2x2 image to 1x1 may not use box filter depending on image data.
Since this algorithm is undocumented, it's difficult to reverse engineer the original algorithm and
produce identical results. Instead, this patch uses a naive implementation of bilinear interpolation
to implement HALFTONE mode and it produces good quality images.
For 8-bit and lower color depth images, nulldrv_StretchBlt should resize the images first and then
converts color depth.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46375
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/gdi32/dibdrv/bitblt.c | 89 +++
dlls/gdi32/dibdrv/dibdrv.h | 1 +
dlls/gdi32/dibdrv/primitives.c | 81 +++
dlls/gdi32/tests/bitmap.c | 1136 ++++++++++++++++++++++++++++++++
4 files changed, 1307 insertions(+)
diff --git a/dlls/gdi32/dibdrv/bitblt.c b/dlls/gdi32/dibdrv/bitblt.c
index d2f59965b02..ff12a7ca1dd 100644
--- a/dlls/gdi32/dibdrv/bitblt.c
+++ b/dlls/gdi32/dibdrv/bitblt.c
@@ -1193,6 +1193,88 @@ static DWORD calc_1d_stretch_params( INT dst_start, INT dst_length, INT dst_vis_
return ERROR_SUCCESS;
}
+static float clampf( float value, float min, float max )
+{
+ return max( min, min( value, max ) );
+}
+
+static int clamp( int value, int min, int max )
+{
+ return max( min, min( value, max ) );
+}
+
+static BYTE linear_interpolate( BYTE start, BYTE end, float delta )
+{
+ return start + (end - start) * delta + 0.5f;
+}
+
+static BYTE bilinear_interpolate( BYTE c00, BYTE c01, BYTE c10, BYTE c11, float dx, float dy )
+{
+ return linear_interpolate( linear_interpolate( c00, c01, dx ),
+ linear_interpolate( c10, c11, dx ), dy );
+}
+
+static void halftone( const dib_info *dst_dib, struct bitblt_coords *dst,
+ const dib_info *src_dib, struct bitblt_coords *src )
+{
+ int src_start_x, src_start_y, dst_x, dst_y, x0, x1, y0, y1;
+ int left_most, right_most, top_most, bottom_most;
+ int src_width, src_height, dst_width, dst_height;
+ float float_x, float_y, dx, dy, inc_x, inc_y;
+ BOOL mirrored_x, mirrored_y;
+ COLORREF c00, c01, c10, c11;
+ RECT src_rect, dst_rect;
+ BYTE r, g, b;
+
+ get_bounding_rect( &src_rect, src->x, src->y, src->width, src->height );
+ get_bounding_rect( &dst_rect, dst->x, dst->y, dst->width, dst->height );
+ intersect_rect( &src_rect, &src->visrect, &src_rect );
+ intersect_rect( &dst_rect, &dst->visrect, &dst_rect );
+ offset_rect( &dst_rect, -dst_rect.left, -dst_rect.top );
+
+ left_most = src_rect.left;
+ right_most = src_rect.right - 1;
+ top_most = src_rect.top;
+ bottom_most = src_rect.bottom - 1;
+
+ src_width = src_rect.right - src_rect.left;
+ src_height = src_rect.bottom - src_rect.top;
+ dst_width = dst_rect.right - dst_rect.left;
+ dst_height = dst_rect.bottom - dst_rect.top;
+
+ mirrored_x = (dst->width < 0) != (src->width < 0);
+ mirrored_y = (dst->height < 0) != (src->height < 0);
+ src_start_x = mirrored_x ? right_most : left_most;
+ src_start_y = mirrored_y ? bottom_most : top_most;
+ inc_x = mirrored_x ? -(float)src_width / dst_width : (float)src_width / dst_width;
+ inc_y = mirrored_y ? -(float)src_height / dst_height : (float)src_height / dst_height;
+
+ for (dst_y = dst_rect.top; dst_y < dst_rect.bottom; ++dst_y)
+ {
+ for (dst_x = dst_rect.left; dst_x < dst_rect.right; ++dst_x)
+ {
+ float_x = src_start_x + (dst_x - dst_rect.left) * inc_x;
+ float_y = src_start_y + (dst_y - dst_rect.top) * inc_y;
+ float_x = clampf(float_x, left_most, right_most);
+ float_y = clampf(float_y, top_most, bottom_most);
+ x0 = float_x;
+ y0 = float_y;
+ x1 = clamp(x0 + 1, left_most, right_most);
+ y1 = clamp(y0 + 1, top_most, bottom_most);
+ dx = float_x - x0;
+ dy = float_y - y0;
+
+ c00 = src_dib->funcs->pixel_to_colorref(src_dib, src_dib->funcs->get_pixel(src_dib, x0, y0));
+ c01 = src_dib->funcs->pixel_to_colorref(src_dib, src_dib->funcs->get_pixel(src_dib, x1, y0));
+ c10 = src_dib->funcs->pixel_to_colorref(src_dib, src_dib->funcs->get_pixel(src_dib, x0, y1));
+ c11 = src_dib->funcs->pixel_to_colorref(src_dib, src_dib->funcs->get_pixel(src_dib, x1, y1));
+ r = bilinear_interpolate(GetRValue(c00), GetRValue(c01), GetRValue(c10), GetRValue(c11), dx, dy);
+ g = bilinear_interpolate(GetGValue(c00), GetGValue(c01), GetGValue(c10), GetGValue(c11), dx, dy);
+ b = bilinear_interpolate(GetBValue(c00), GetBValue(c01), GetBValue(c10), GetBValue(c11), dx, dy);
+ dst_dib->funcs->set_colorref(dst_dib, dst_x, dst_y, r, g, b);
+ }
+ }
+}
DWORD stretch_bitmapinfo( const BITMAPINFO *src_info, void *src_bits, struct bitblt_coords *src,
const BITMAPINFO *dst_info, void *dst_bits, struct bitblt_coords *dst,
@@ -1216,6 +1298,12 @@ DWORD stretch_bitmapinfo( const BITMAPINFO *src_info, void *src_bits, struct bit
init_dib_info_from_bitmapinfo( &src_dib, src_info, src_bits );
init_dib_info_from_bitmapinfo( &dst_dib, dst_info, dst_bits );
+ if (mode == HALFTONE)
+ {
+ halftone( &dst_dib, dst, &src_dib, src );
+ goto done;
+ }
+
/* v */
ret = calc_1d_stretch_params( dst->y, dst->height, dst->visrect.top, dst->visrect.bottom,
src->y, src->height, src->visrect.top, src->visrect.bottom,
@@ -1300,6 +1388,7 @@ DWORD stretch_bitmapinfo( const BITMAPINFO *src_info, void *src_bits, struct bit
}
}
+done:
/* update coordinates, the destination rectangle is always stored at 0,0 */
*src = *dst;
src->x -= src->visrect.left;
diff --git a/dlls/gdi32/dibdrv/dibdrv.h b/dlls/gdi32/dibdrv/dibdrv.h
index d3a35b96c75..e52b08431d7 100644
--- a/dlls/gdi32/dibdrv/dibdrv.h
+++ b/dlls/gdi32/dibdrv/dibdrv.h
@@ -199,6 +199,7 @@ typedef struct primitive_funcs
void (* draw_subpixel_glyph)(const dib_info *dst, const RECT *rc, const dib_info *glyph,
const POINT *origin, DWORD text_pixel, const struct font_gamma_ramp *gamma_ramp);
DWORD (* get_pixel)(const dib_info *dib, int x, int y);
+ void (* set_colorref)(const dib_info *dib, int x, int y, BYTE r, BYTE g, BYTE b);
DWORD (* colorref_to_pixel)(const dib_info *dib, COLORREF color);
COLORREF (* pixel_to_colorref)(const dib_info *dib, DWORD pixel);
void (* convert_to)(dib_info *dst, const dib_info *src, const RECT *src_rect, BOOL dither);
diff --git a/dlls/gdi32/dibdrv/primitives.c b/dlls/gdi32/dibdrv/primitives.c
index e4b18a6656d..a501316c859 100644
--- a/dlls/gdi32/dibdrv/primitives.c
+++ b/dlls/gdi32/dibdrv/primitives.c
@@ -7430,6 +7430,78 @@ static void shrink_row_null(const dib_info *dst_dib, const POINT *dst_start,
return;
}
+static void set_colorref_888(const dib_info *dib, int x, int y, BYTE r, BYTE g, BYTE b)
+{
+ DWORD *ptr = get_pixel_ptr_32( dib, x, y );
+ *ptr = ((r << 16) & 0xff0000) | ((g << 8) & 0x00ff00) | (b & 0x0000ff);
+}
+
+static void set_colorref_32(const dib_info *dib, int x, int y, BYTE r, BYTE g, BYTE b)
+{
+ DWORD *ptr = get_pixel_ptr_32( dib, x, y );
+ *ptr = rgb_to_pixel_masks( dib, r, g, b );
+}
+
+static void set_colorref_24(const dib_info *dib, int x, int y, BYTE r, BYTE g, BYTE b)
+{
+ BYTE *ptr = get_pixel_ptr_24( dib, x, y );
+ ptr[0] = b;
+ ptr[1] = g;
+ ptr[2] = r;
+}
+
+static void set_pixel_555(const dib_info *dib, int x, int y, BYTE r, BYTE g, BYTE b)
+{
+ WORD *ptr = get_pixel_ptr_16( dib, x, y );
+ *ptr = ((r << 7) & 0x7c00) | ((g << 2) & 0x03e0) | ((b >> 3) & 0x001f);
+}
+
+static void set_colorref_16(const dib_info *dib, int x, int y, BYTE r, BYTE g, BYTE b)
+{
+ WORD *ptr = get_pixel_ptr_16( dib, x, y );
+ *ptr = rgb_to_pixel_masks( dib, r, g, b );
+}
+
+static void set_colorref_8(const dib_info *dib, int x, int y, BYTE r, BYTE g, BYTE b)
+{
+ BYTE *ptr = get_pixel_ptr_8( dib, x, y );
+ *ptr = rgb_to_pixel_colortable( dib, r, g, b );
+}
+
+static void set_colorref_4(const dib_info *dib, int x, int y, BYTE r, BYTE g, BYTE b)
+{
+ BYTE *ptr = get_pixel_ptr_4( dib, x, y );
+ BYTE val;
+
+ val = rgb_to_pixel_colortable( dib, r, g, b );
+ if ((x - dib->rect.left) & 1)
+ *ptr = (val & 0x0f) | (*ptr & 0xf0);
+ else
+ *ptr = (val << 4) & 0xf0;
+}
+
+static void set_colorref_1(const dib_info *dib, int x, int y, BYTE r, BYTE g, BYTE b)
+{
+ BYTE *ptr = get_pixel_ptr_1( dib, x, y );
+ RGBQUAD bg_entry;
+ DWORD bg_pixel;
+ BYTE dst_val;
+ int bit_pos;
+
+ bit_pos = (x - dib->rect.left) & 7;
+ bg_entry = *get_dib_color_table( dib );
+ bg_pixel = FILTER_DIBINDEX(bg_entry, RGB(bg_entry.rgbRed, bg_entry.rgbGreen, bg_entry.rgbBlue));
+
+ dst_val = rgb_to_pixel_mono( dib, FALSE, x, y, RGB(r, g, b), bg_pixel, r, g, b );
+ if (bit_pos == 0)
+ *ptr = 0;
+ *ptr = (*ptr & ~pixel_masks_1[bit_pos]) | (dst_val & pixel_masks_1[bit_pos]);
+}
+
+static void set_colorref_null(const dib_info *dib, int x, int y, BYTE r, BYTE g, BYTE b)
+{
+}
+
const primitive_funcs funcs_8888 =
{
solid_rects_32,
@@ -7442,6 +7514,7 @@ const primitive_funcs funcs_8888 =
draw_glyph_8888,
draw_subpixel_glyph_8888,
get_pixel_32,
+ set_colorref_888,
colorref_to_pixel_888,
pixel_to_colorref_888,
convert_to_8888,
@@ -7463,6 +7536,7 @@ const primitive_funcs funcs_32 =
draw_glyph_32,
draw_subpixel_glyph_32,
get_pixel_32,
+ set_colorref_32,
colorref_to_pixel_masks,
pixel_to_colorref_masks,
convert_to_32,
@@ -7484,6 +7558,7 @@ const primitive_funcs funcs_24 =
draw_glyph_24,
draw_subpixel_glyph_24,
get_pixel_24,
+ set_colorref_24,
colorref_to_pixel_888,
pixel_to_colorref_888,
convert_to_24,
@@ -7505,6 +7580,7 @@ const primitive_funcs funcs_555 =
draw_glyph_555,
draw_subpixel_glyph_555,
get_pixel_16,
+ set_pixel_555,
colorref_to_pixel_555,
pixel_to_colorref_555,
convert_to_555,
@@ -7526,6 +7602,7 @@ const primitive_funcs funcs_16 =
draw_glyph_16,
draw_subpixel_glyph_16,
get_pixel_16,
+ set_colorref_16,
colorref_to_pixel_masks,
pixel_to_colorref_masks,
convert_to_16,
@@ -7547,6 +7624,7 @@ const primitive_funcs funcs_8 =
draw_glyph_8,
draw_subpixel_glyph_null,
get_pixel_8,
+ set_colorref_8,
colorref_to_pixel_colortable,
pixel_to_colorref_colortable,
convert_to_8,
@@ -7568,6 +7646,7 @@ const primitive_funcs funcs_4 =
draw_glyph_4,
draw_subpixel_glyph_null,
get_pixel_4,
+ set_colorref_4,
colorref_to_pixel_colortable,
pixel_to_colorref_colortable,
convert_to_4,
@@ -7589,6 +7668,7 @@ const primitive_funcs funcs_1 =
draw_glyph_1,
draw_subpixel_glyph_null,
get_pixel_1,
+ set_colorref_1,
colorref_to_pixel_colortable,
pixel_to_colorref_colortable,
convert_to_1,
@@ -7610,6 +7690,7 @@ const primitive_funcs funcs_null =
draw_glyph_null,
draw_subpixel_glyph_null,
get_pixel_null,
+ set_colorref_null,
colorref_to_pixel_null,
pixel_to_colorref_null,
convert_to_null,
diff --git a/dlls/gdi32/tests/bitmap.c b/dlls/gdi32/tests/bitmap.c
index fe3482671b2..c28dde8159b 100644
--- a/dlls/gdi32/tests/bitmap.c
+++ b/dlls/gdi32/tests/bitmap.c
@@ -57,6 +57,29 @@ static inline int get_dib_image_size( const BITMAPINFO *info )
* abs( info->bmiHeader.biHeight );
}
+static void dump_bits(int bpp, int width, const BYTE *expected, const BYTE *result, int size,
+ const char *comment)
+{
+ int i, stride;
+
+ stride = get_dib_stride(width, bpp);
+ printf("%s expected:\n", comment);
+ for (i = 0; i < size; i++)
+ {
+ printf("%02x ", expected[i]);
+ if ((i + 1) % stride == 0)
+ printf("\n");
+ }
+ printf("\n%s got:\n", comment);
+ for (i = 0; i < size; i++)
+ {
+ printf("%02x ", result[i]);
+ if ((i + 1) % stride == 0)
+ printf("\n");
+ }
+ printf("\n");
+}
+
static void test_bitmap_info(HBITMAP hbm, INT expected_depth, const BITMAPINFOHEADER *bmih)
{
BITMAP bm;
@@ -3426,6 +3449,1118 @@ static void test_StretchBlt(void)
DeleteDC(hdcScreen);
}
+static void test_StretchBlt_HALFTONE(void)
+{
+#define PAD_ZERO 0x00,
+
+ /* Same dimension */
+ /* 1x1 -> 1x1 */
+ static const unsigned char test_bits_0[] =
+ {
+ 0xff, 0x7f, 0x00,
+ };
+ static const unsigned char expected_bits_0[] =
+ {
+ 0xff, 0x7f, 0x00,
+ };
+
+ /* Shrink horizontally */
+ /* 2x1 -> 1x1 */
+ /* 0xff / 2 = 0x7f.8, (0xff + 1) / 2 = 0x80 */
+ static const unsigned char test_bits_1[] =
+ {
+ 0xff, 0xff, 0xff, 0x00, 0x01, 0x00,
+ };
+ static const unsigned char expected_bits_1[] =
+ {
+ 0x7f, 0x80, 0x7f,
+ };
+ static const unsigned char test_bits_2[] =
+ {
+ 0x00, 0x01, 0x00, 0xff, 0xff, 0xff,
+ };
+ static const unsigned char expected_bits_2[] =
+ {
+ 0x7f, 0x80, 0x7f,
+ };
+
+ /* 3x1 -> 1x1 */
+ /* 0xff / 3 = 0x55 */
+ static const unsigned char test_bits_3[] =
+ {
+ 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ };
+ static const unsigned char expected_bits_3[] =
+ {
+ 0x54, 0x54, 0x54,
+ };
+ static const unsigned char test_bits_4[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
+ };
+ static const unsigned char expected_bits_4[] =
+ {
+ 0x55, 0x55, 0x55,
+ };
+ static const unsigned char test_bits_5[] =
+ {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
+ };
+ static const unsigned char expected_bits_5[] =
+ {
+ 0x55, 0x55, 0x55,
+ };
+ /* 0xff * 2 / 3 = 0xaa */
+ static const unsigned char test_bits_6[] =
+ {
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
+ };
+ static const unsigned char expected_bits_6[] =
+ {
+ 0xa9, 0xa9, 0xa9,
+ };
+ static const unsigned char test_bits_7[] =
+ {
+ 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
+ };
+ static const unsigned char expected_bits_7[] =
+ {
+ 0xa9, 0xa9, 0xa9,
+ };
+ static const unsigned char test_bits_8[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ };
+ static const unsigned char expected_bits_8[] =
+ {
+ 0xaa, 0xaa, 0xaa,
+ };
+ static const unsigned char test_bits_9[] =
+ {
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ };
+ static const unsigned char expected_bits_9[] =
+ {
+ 0xff, 0xff, 0xff,
+ };
+
+ /* 4x1 -> 1x1 */
+ /* 0xff * 3 / 4 = 0xbf.4 */
+ static const unsigned char test_bits_10[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ };
+ static const unsigned char expected_bits_10[] =
+ {
+ 0xbf, 0xbf, 0xbf,
+ };
+
+ /* 5x1 -> 1x1 */
+ /* 0xff * 4 / 5 = 0xcc */
+ static const unsigned char test_bits_11[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ };
+ static const unsigned char expected_bits_11[] =
+ {
+ 0xcc, 0xcc, 0xcc,
+ };
+
+ /* Shrink horizontally with non-integer ratio */
+ /* 3x1 -> 2x1 */
+ static const unsigned char test_bits_12[] =
+ {
+ 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ };
+ static const unsigned char expected_bits_12[] =
+ {
+ 0xd4, 0xd4, 0xd4, 0x00, 0x00, 0x00,
+ };
+ static const unsigned char test_bits_13[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
+ };
+ static const unsigned char expected_bits_13[] =
+ {
+ 0x55, 0x55, 0x55, 0x54, 0x54, 0x54,
+ };
+ static const unsigned char test_bits_14[] =
+ {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
+ };
+ static const unsigned char expected_bits_14[] =
+ {
+ 0x00, 0x00, 0x00, 0xd4, 0xd4, 0xd4,
+ };
+ static const unsigned char test_bits_15[] =
+ {
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
+ };
+ static const unsigned char expected_bits_15[] =
+ {
+ 0xff, 0xff, 0xff, 0x2a, 0x2a, 0x2a,
+ };
+ static const unsigned char test_bits_16[] =
+ {
+ 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
+ };
+ static const unsigned char expected_bits_16[] =
+ {
+ 0xa9, 0xa9, 0xa9, 0xaa, 0xaa, 0xaa,
+ };
+ static const unsigned char test_bits_17[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ };
+ static const unsigned char expected_bits_17[] =
+ {
+ 0x2a, 0x2a, 0x2a, 0xff, 0xff, 0xff,
+ };
+ static const unsigned char test_bits_18[] =
+ {
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ };
+ static const unsigned char expected_bits_18[] =
+ {
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ };
+
+ /* 4x1 -> 3x1 */
+ static const unsigned char test_bits_19[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ };
+ static const unsigned char expected_bits_19[] =
+ {
+ 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ };
+ static const unsigned char test_bits_20[] =
+ {
+ 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
+ };
+ static const unsigned char expected_bits_20[] =
+ {
+ 0xcf, 0xcf, 0xcf, 0x7f, 0x7f, 0x7f, 0x2f, 0x2f, 0x2f,
+ };
+ static const unsigned char test_bits_21[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
+ };
+ static const unsigned char expected_bits_21[] =
+ {
+ 0x2f, 0x2f, 0x2f, 0x7f, 0x7f, 0x7f, 0xcf, 0xcf, 0xcf,
+ };
+ static const unsigned char test_bits_22[] =
+ {
+ 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff
+ };
+ static const unsigned char expected_bits_22[] =
+ {
+ 0xef, 0xef, 0xef, 0x00, 0x00, 0x00, 0xef, 0xef, 0xef,
+ };
+ static const unsigned char test_bits_23[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
+ };
+ static const unsigned char expected_bits_23[] =
+ {
+ 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f,
+ };
+
+ /* 5x1 -> 3x1 */
+ static const unsigned char test_bits_24[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ };
+ static const unsigned char expected_bits_24[] =
+ {
+ 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ };
+ static const unsigned char test_bits_25[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
+ };
+ static const unsigned char expected_bits_25[] =
+ {
+ 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x65, 0x65, 0x65,
+ };
+ static const unsigned char test_bits_26[] =
+ {
+ 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
+ };
+ static const unsigned char expected_bits_26[] =
+ {
+ 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x99, 0x99, 0x99,
+ };
+
+ /* Shrink vertically */
+ /* 1x2 -> 1x1 */
+ /* 0xff / 2 = 0x7f.8, (0xff + 1) / 2 = 0x80 */
+ static const unsigned char test_bits_27[] =
+ {
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0x00, 0x01, 0x00, PAD_ZERO
+ };
+ static const unsigned char expected_bits_27[] =
+ {
+ 0x7f, 0x80, 0x7f
+ };
+ static const unsigned char test_bits_28[] =
+ {
+ 0x00, 0x01, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ static const unsigned char expected_bits_28[] =
+ {
+ 0x7f, 0x80, 0x7f
+ };
+
+ /* 1x3 -> 1x1 */
+ /* 0xff / 3 = 0x55 */
+ static const unsigned char test_bits_29[] =
+ {
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ };
+ static const unsigned char expected_bits_29[] =
+ {
+ 0x55, 0x55, 0x55,
+ };
+ static const unsigned char test_bits_30[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ };
+ static const unsigned char expected_bits_30[] =
+ {
+ 0x55, 0x55, 0x55,
+ };
+ static const unsigned char test_bits_31[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ static const unsigned char expected_bits_31[] =
+ {
+ 0x54, 0x54, 0x54,
+ };
+ /* 0xff * 2 / 3 = 0xaa */
+ static const unsigned char test_bits_32[] =
+ {
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ };
+ static const unsigned char expected_bits_32[] =
+ {
+ 0xaa, 0xaa, 0xaa,
+ };
+ static const unsigned char test_bits_33[] =
+ {
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ static const unsigned char expected_bits_33[] =
+ {
+ 0xa9, 0xa9, 0xa9,
+ };
+ static const unsigned char test_bits_34[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ static const unsigned char expected_bits_34[] =
+ {
+ 0xa9, 0xa9, 0xa9,
+ };
+ static const unsigned char test_bits_35[] =
+ {
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ static const unsigned char expected_bits_35[] =
+ {
+ 0xff, 0xff, 0xff,
+ };
+
+ /* 1x4 -> 1x1 */
+ /* 0xff * 3 / 4 = 0xbf.4 */
+ static const unsigned char test_bits_36[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ static const unsigned char expected_bits_36[] =
+ {
+ 0xbf, 0xbf, 0xbf,
+ };
+
+ /* 1x5 -> 1x1 */
+ /* 0xff * 4 / 5 = 0xcc */
+ static const unsigned char test_bits_37[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ static const unsigned char expected_bits_37[] =
+ {
+ 0xcb, 0xcb, 0xcb,
+ };
+
+ /* Shrink vertically with a non-integer ratio */
+ /* 3x1 -> 2x1 */
+ static const unsigned char test_bits_38[] =
+ {
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ };
+ static const unsigned char expected_bits_38[] =
+ {
+ 0xd4, 0xd4, 0xd4, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ };
+ static const unsigned char test_bits_39[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ };
+ static const unsigned char expected_bits_39[] =
+ {
+ 0x54, 0x54, 0x54, PAD_ZERO
+ 0x55, 0x55, 0x55, PAD_ZERO
+ };
+ static const unsigned char test_bits_40[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ static const unsigned char expected_bits_40[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xd4, 0xd4, 0xd4, PAD_ZERO
+ };
+ static const unsigned char test_bits_41[] =
+ {
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ };
+ static const unsigned char expected_bits_41[] =
+ {
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0x2a, 0x2a, 0x2a, PAD_ZERO
+ };
+ static const unsigned char test_bits_42[] =
+ {
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ static const unsigned char expected_bits_42[] =
+ {
+ 0xaa, 0xaa, 0xaa, PAD_ZERO
+ 0xa9, 0xa9, 0xa9, PAD_ZERO
+ };
+ static const unsigned char test_bits_43[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ static const unsigned char expected_bits_43[] =
+ {
+ 0x2a, 0x2a, 0x2a, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ static const unsigned char test_bits_44[] =
+ {
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ static const unsigned char expected_bits_44[] =
+ {
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+
+ /* 4x1 -> 3x1 */
+ static const unsigned char test_bits_45[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ static const unsigned char expected_bits_45[] =
+ {
+ 0x0f, 0x0f, 0x0f, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ static const unsigned char test_bits_46[] =
+ {
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ };
+ static const unsigned char expected_bits_46[] =
+ {
+ 0xcf, 0xcf, 0xcf, PAD_ZERO
+ 0x7f, 0x7f, 0x7f, PAD_ZERO
+ 0x2f, 0x2f, 0x2f, PAD_ZERO
+ };
+ static const unsigned char test_bits_47[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ static const unsigned char expected_bits_47[] =
+ {
+ 0x2f, 0x2f, 0x2f, PAD_ZERO
+ 0x7f, 0x7f, 0x7f, PAD_ZERO
+ 0xcf, 0xcf, 0xcf, PAD_ZERO
+ };
+ static const unsigned char test_bits_48[] =
+ {
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ static const unsigned char expected_bits_48[] =
+ {
+ 0xef, 0xef, 0xef, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xef, 0xef, 0xef, PAD_ZERO
+ };
+ static const unsigned char test_bits_49[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ };
+ static const unsigned char expected_bits_49[] =
+ {
+ 0x0f, 0x0f, 0x0f, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0x0f, 0x0f, 0x0f, PAD_ZERO
+ };
+
+ /* 5x1 -> 3x1 */
+ static const unsigned char test_bits_50[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ static const unsigned char expected_bits_50[] =
+ {
+ 0x3f, 0x3f, 0x3f, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ static const unsigned char test_bits_51[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ };
+ static const unsigned char expected_bits_51[] =
+ {
+ 0x65, 0x65, 0x65, PAD_ZERO
+ 0x66, 0x66, 0x66, PAD_ZERO
+ 0x66, 0x66, 0x66, PAD_ZERO
+ };
+ static const unsigned char test_bits_52[] =
+ {
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ static const unsigned char expected_bits_52[] =
+ {
+ 0x99, 0x99, 0x99, PAD_ZERO
+ 0x98, 0x98, 0x98, PAD_ZERO
+ 0x98, 0x98, 0x98, PAD_ZERO
+ };
+
+ /* Stretch horizontally */
+ /* 1x1 -> 2x1 */
+ static const unsigned char test_bits_53[] =
+ {
+ 0xff, 0xff, 0xff,
+ };
+ static const unsigned char expected_bits_53[] =
+ {
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ };
+ /* 2x1 -> 3x1 */
+ static const unsigned char test_bits_54[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
+ };
+ static const unsigned char expected_bits_54[] =
+ {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
+ };
+ /* 3x1 -> 4x1 */
+ static const unsigned char test_bits_55[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ };
+ static const unsigned char expected_bits_55[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ };
+ /* 4x1 -> 5x1 */
+ static const unsigned char test_bits_56[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ };
+ static const unsigned char expected_bits_56[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ };
+
+ /* Stretch vertically */
+ /* 1x1 -> 1x2 */
+ static const unsigned char test_bits_57[] =
+ {
+ 0xff, 0xff, 0xff,
+ };
+ static const unsigned char expected_bits_57[] =
+ {
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ /* 1x2 -> 1x3 */
+ static const unsigned char test_bits_58[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ static const unsigned char expected_bits_58[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ /* 1x3 -> 1x4 */
+ static const unsigned char test_bits_59[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ static const unsigned char expected_bits_59[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ /* 1x4 -> 1x5 */
+ static const unsigned char test_bits_60[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ static const unsigned char expected_bits_60[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+
+ /* Shrink both horizontally and vertically*/
+ /* 2x2 -> 1x1 */
+ /* 0xff / 4 = 0x3f.c */
+ static const unsigned char test_bits_61[] =
+ {
+ 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_61[] =
+ {
+ 0x40, 0x40, 0x40,
+ };
+ static const unsigned char test_bits_62[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, PAD_ZERO PAD_ZERO
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_62[] =
+ {
+ 0x40, 0x40, 0x40,
+ };
+ static const unsigned char test_bits_63[] =
+ {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_63[] =
+ {
+ 0x40, 0x40, 0x40,
+ };
+ static const unsigned char test_bits_64[] =
+ {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_64[] =
+ {
+ 0x40, 0x40, 0x40,
+ };
+ /* 0xff * 2 / 4 = 0x7f.8 */
+ static const unsigned char test_bits_65[] =
+ {
+ 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_65[] =
+ {
+ 0x80, 0x80, 0x80,
+ };
+ static const unsigned char test_bits_66[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, PAD_ZERO PAD_ZERO
+ 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_66[] =
+ {
+ 0x80, 0x80, 0x80,
+ };
+ static const unsigned char test_bits_67[] =
+ {
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, PAD_ZERO PAD_ZERO
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_67[] =
+ {
+ 0xff, 0xff, 0xff,
+ };
+
+ /* Stretch horizontally and shrink vertically */
+ /* 2x2 -> 1x4 */
+ static const unsigned char test_bits_68[] =
+ {
+ 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_68[] =
+ {
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ };
+ static const unsigned char test_bits_69[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, PAD_ZERO PAD_ZERO
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_69[] =
+ {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
+ };
+ static const unsigned char test_bits_70[] =
+ {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_70[] =
+ {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ };
+ static const unsigned char test_bits_71[] =
+ {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_71[] =
+ {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ };
+ static const unsigned char test_bits_72[] =
+ {
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, PAD_ZERO PAD_ZERO
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_72[] =
+ {
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ };
+ static const unsigned char test_bits_73[] =
+ {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_73[] =
+ {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ };
+ /* 0xff * 2 / 4 = 0x7f.8 */
+ static const unsigned char test_bits_74[] =
+ {
+ 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_74[] =
+ {
+ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80
+ };
+ static const unsigned char test_bits_75[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, PAD_ZERO PAD_ZERO
+ 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_75[] =
+ {
+ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80
+ };
+ static const unsigned char test_bits_76[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, PAD_ZERO PAD_ZERO
+ 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_76[] =
+ {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
+ };
+ /* 0xfe * 2 / 4 = 0x7f */
+ static const unsigned char test_bits_77[] =
+ {
+ 0x00, 0x00, 0x00, 0xfe, 0xfe, 0xfe, PAD_ZERO PAD_ZERO
+ 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_77[] =
+ {
+ 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f
+ };
+
+ /* Stretch vertically and shrink horizontally */
+ /* 2x2 -> 4x1 */
+ static const unsigned char test_bits_78[] =
+ {
+ 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_78[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ };
+ static const unsigned char test_bits_79[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, PAD_ZERO PAD_ZERO
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_79[] =
+ {
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ };
+ static const unsigned char test_bits_80[] =
+ {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_80[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ };
+ static const unsigned char test_bits_81[] =
+ {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_81[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ static const unsigned char test_bits_82[] =
+ {
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, PAD_ZERO PAD_ZERO
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_82[] =
+ {
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ };
+ static const unsigned char test_bits_83[] =
+ {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_83[] =
+ {
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ };
+ /* 0xff * 2 / 4 = 0x7f.8 */
+ static const unsigned char test_bits_84[] =
+ {
+ 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_84[] =
+ {
+ 0x80, 0x80, 0x80, PAD_ZERO
+ 0x80, 0x80, 0x80, PAD_ZERO
+ 0x80, 0x80, 0x80, PAD_ZERO
+ 0x80, 0x80, 0x80, PAD_ZERO
+ };
+ static const unsigned char test_bits_85[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, PAD_ZERO PAD_ZERO
+ 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_85[] =
+ {
+ 0x80, 0x80, 0x80, PAD_ZERO
+ 0x80, 0x80, 0x80, PAD_ZERO
+ 0x80, 0x80, 0x80, PAD_ZERO
+ 0x80, 0x80, 0x80, PAD_ZERO
+ };
+ static const unsigned char test_bits_86[] =
+ {
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, PAD_ZERO PAD_ZERO
+ 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_86[] =
+ {
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0xff, 0xff, 0xff, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ 0x00, 0x00, 0x00, PAD_ZERO
+ };
+ /* 0xfe * 2 / 4 = 0x7f */
+ static const unsigned char test_bits_87[] =
+ {
+ 0x00, 0x00, 0x00, 0xfe, 0xfe, 0xfe, PAD_ZERO PAD_ZERO
+ 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, PAD_ZERO PAD_ZERO
+ };
+ static const unsigned char expected_bits_87[] =
+ {
+ 0x7f, 0x7f, 0x7f, PAD_ZERO
+ 0x7f, 0x7f, 0x7f, PAD_ZERO
+ 0x7f, 0x7f, 0x7f, PAD_ZERO
+ 0x7f, 0x7f, 0x7f, PAD_ZERO
+ };
+
+#undef PAD_ZERO
+
+ static const struct
+ {
+ const unsigned char *src_bits;
+ size_t src_bits_size;
+ const unsigned char *dst_bits;
+ size_t dst_bits_size;
+ int bpp;
+ int src_width;
+ int src_height;
+ int dst_width;
+ int dst_height;
+ BOOL todo;
+ }
+ tests[] =
+ {
+#define BITS(x) test_bits_##x, sizeof(test_bits_##x), expected_bits_##x, sizeof(expected_bits_##x)
+
+ {BITS(0), 24, 1, 1, 1, 1},
+ {BITS(1), 24, 2, 1, 1, 1, TRUE},
+ {BITS(2), 24, 2, 1, 1, 1, TRUE},
+ {BITS(3), 24, 3, 1, 1, 1, TRUE},
+ {BITS(4), 24, 3, 1, 1, 1, TRUE},
+ {BITS(5), 24, 3, 1, 1, 1, TRUE},
+ {BITS(6), 24, 3, 1, 1, 1, TRUE},
+ {BITS(7), 24, 3, 1, 1, 1, TRUE},
+ {BITS(8), 24, 3, 1, 1, 1, TRUE},
+ {BITS(9), 24, 3, 1, 1, 1},
+ {BITS(10), 24, 4, 1, 1, 1, TRUE},
+ {BITS(11), 24, 5, 1, 1, 1, TRUE},
+ {BITS(12), 24, 3, 1, 2, 1, TRUE},
+ {BITS(13), 24, 3, 1, 2, 1, TRUE},
+ {BITS(14), 24, 3, 1, 2, 1, TRUE},
+ {BITS(15), 24, 3, 1, 2, 1, TRUE},
+ {BITS(16), 24, 3, 1, 2, 1, TRUE},
+ {BITS(17), 24, 3, 1, 2, 1, TRUE},
+ {BITS(18), 24, 3, 1, 2, 1},
+ {BITS(19), 24, 4, 1, 3, 1, TRUE},
+ {BITS(20), 24, 4, 1, 3, 1, TRUE},
+ {BITS(21), 24, 4, 1, 3, 1, TRUE},
+ {BITS(22), 24, 4, 1, 3, 1, TRUE},
+ {BITS(23), 24, 4, 1, 3, 1, TRUE},
+ {BITS(24), 24, 5, 1, 3, 1, TRUE},
+ {BITS(25), 24, 5, 1, 3, 1, TRUE},
+ {BITS(26), 24, 5, 1, 3, 1, TRUE},
+ {BITS(27), 24, 1, 2, 1, 1, TRUE},
+ {BITS(28), 24, 1, 2, 1, 1, TRUE},
+ {BITS(29), 24, 1, 3, 1, 1, TRUE},
+ {BITS(30), 24, 1, 3, 1, 1, TRUE},
+ {BITS(31), 24, 1, 3, 1, 1, TRUE},
+ {BITS(32), 24, 1, 3, 1, 1, TRUE},
+ {BITS(33), 24, 1, 3, 1, 1, TRUE},
+ {BITS(34), 24, 1, 3, 1, 1, TRUE},
+ {BITS(35), 24, 1, 3, 1, 1},
+ {BITS(36), 24, 1, 4, 1, 1, TRUE},
+ {BITS(37), 24, 1, 5, 1, 1, TRUE},
+ {BITS(38), 24, 1, 3, 1, 2, TRUE},
+ {BITS(39), 24, 1, 3, 1, 2, TRUE},
+ {BITS(40), 24, 1, 3, 1, 2, TRUE},
+ {BITS(41), 24, 1, 3, 1, 2, TRUE},
+ {BITS(42), 24, 1, 3, 1, 2, TRUE},
+ {BITS(43), 24, 1, 3, 1, 2, TRUE},
+ {BITS(44), 24, 1, 3, 1, 2},
+ {BITS(45), 24, 1, 4, 1, 3, TRUE},
+ {BITS(46), 24, 1, 4, 1, 3, TRUE},
+ {BITS(47), 24, 1, 4, 1, 3, TRUE},
+ {BITS(48), 24, 1, 4, 1, 3, TRUE},
+ {BITS(49), 24, 1, 4, 1, 3, TRUE},
+ {BITS(50), 24, 1, 5, 1, 3, TRUE},
+ {BITS(51), 24, 1, 5, 1, 3, TRUE},
+ {BITS(52), 24, 1, 5, 1, 3, TRUE},
+ {BITS(53), 24, 1, 1, 2, 1},
+ {BITS(54), 24, 2, 1, 3, 1, TRUE},
+ {BITS(55), 24, 3, 1, 4, 1, TRUE},
+ {BITS(56), 24, 4, 1, 5, 1, TRUE},
+ {BITS(57), 24, 1, 1, 1, 2},
+ {BITS(58), 24, 1, 2, 1, 3, TRUE},
+ {BITS(59), 24, 1, 3, 1, 4, TRUE},
+ {BITS(60), 24, 1, 4, 1, 5, TRUE},
+ {BITS(61), 24, 2, 2, 1, 1, TRUE},
+ {BITS(62), 24, 2, 2, 1, 1, TRUE},
+ {BITS(63), 24, 2, 2, 1, 1, TRUE},
+ {BITS(64), 24, 2, 2, 1, 1, TRUE},
+ {BITS(65), 24, 2, 2, 1, 1, TRUE},
+ {BITS(66), 24, 2, 2, 1, 1, TRUE},
+ {BITS(67), 24, 2, 2, 1, 1},
+ {BITS(68), 24, 2, 2, 4, 1, TRUE},
+ {BITS(69), 24, 2, 2, 4, 1, TRUE},
+ {BITS(70), 24, 2, 2, 4, 1, TRUE},
+ {BITS(71), 24, 2, 2, 4, 1, TRUE},
+ {BITS(72), 24, 2, 2, 4, 1, TRUE},
+ {BITS(73), 24, 2, 2, 4, 1, TRUE},
+ {BITS(74), 24, 2, 2, 4, 1, TRUE},
+ {BITS(75), 24, 2, 2, 4, 1, TRUE},
+ {BITS(76), 24, 2, 2, 4, 1, TRUE},
+ {BITS(77), 24, 2, 2, 4, 1, TRUE},
+ {BITS(78), 24, 2, 2, 1, 4, TRUE},
+ {BITS(79), 24, 2, 2, 1, 4, TRUE},
+ {BITS(80), 24, 2, 2, 1, 4, TRUE},
+ {BITS(81), 24, 2, 2, 1, 4, TRUE},
+ {BITS(82), 24, 2, 2, 1, 4, TRUE},
+ {BITS(83), 24, 2, 2, 1, 4, TRUE},
+ {BITS(84), 24, 2, 2, 1, 4, TRUE},
+ {BITS(85), 24, 2, 2, 1, 4, TRUE},
+ {BITS(86), 24, 2, 2, 1, 4, TRUE},
+ {BITS(87), 24, 2, 2, 1, 4, TRUE},
+
+#undef BITS
+ };
+
+ unsigned char bmi_buffer[FIELD_OFFSET(BITMAPINFO, bmiColors[256])];
+ HBITMAP src_bmp, dst_bmp, old_src_bmp, old_dst_bmp;
+ BITMAPINFO *bmi = (BITMAPINFO *)bmi_buffer;
+ unsigned char *src_bits, *dst_bits;
+ HDC dc, src_dc, dst_dc;
+ int i, ret;
+
+ dc = GetDC(0);
+
+ memset(&bmi_buffer, 0, sizeof(bmi_buffer));
+ bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ bmi->bmiHeader.biPlanes = 1;
+ bmi->bmiHeader.biCompression = BI_RGB;
+
+ for (i = 0; i < ARRAY_SIZE(tests); ++i)
+ {
+ winetest_push_context("Test %d", i);
+
+ bmi->bmiHeader.biBitCount = tests[i].bpp;
+ bmi->bmiHeader.biWidth = tests[i].src_width;
+ bmi->bmiHeader.biHeight = tests[i].src_height;
+ src_dc = CreateCompatibleDC(dc);
+ src_bmp = CreateDIBSection(src_dc, bmi, DIB_RGB_COLORS, (void **)&src_bits, NULL, 0);
+ ok(src_bmp && src_bits, "CreateDIBSection failed, error %u.\n", GetLastError());
+ memcpy(src_bits, tests[i].src_bits, tests[i].src_bits_size);
+ old_src_bmp = SelectObject(src_dc, src_bmp);
+
+ bmi->bmiHeader.biWidth = tests[i].dst_width;
+ bmi->bmiHeader.biHeight = tests[i].dst_height;
+ dst_dc = CreateCompatibleDC(dc);
+ dst_bmp = CreateDIBSection(dst_dc, bmi, DIB_RGB_COLORS, (void **)&dst_bits, NULL, 0);
+ ok(dst_bmp && dst_bits, "CreateDIBSection failed, error %u.\n", GetLastError());
+ old_dst_bmp = SelectObject(dst_dc, dst_bmp);
+
+ SetStretchBltMode(dst_dc, HALFTONE);
+ ret = GetStretchBltMode(dst_dc);
+ ok(ret == HALFTONE, "Expected mode %#x, got %#x\n", HALFTONE, ret);
+ ret = StretchBlt(dst_dc, 0, 0, tests[i].dst_width, tests[i].dst_height, src_dc, 0, 0,
+ tests[i].src_width, tests[i].src_height, SRCCOPY);
+ ok(ret, "StretchBlt failed, error %u.\n", GetLastError());
+
+ ret = memcmp(dst_bits, tests[i].dst_bits, tests[i].dst_bits_size);
+ todo_wine_if(tests[i].todo)
+ ok(!ret, "Bits mismatch.\n");
+ if (ret)
+ dump_bits(tests[i].bpp, tests[i].dst_width, tests[i].dst_bits, dst_bits,
+ tests[i].dst_bits_size, "StretchBlt_HALFTONE");
+
+ SelectObject(dst_dc, old_dst_bmp);
+ SelectObject(src_dc, old_src_bmp);
+ DeleteObject(dst_bmp);
+ DeleteObject(src_bmp);
+ DeleteDC(dst_dc);
+ DeleteDC(src_dc);
+
+ winetest_pop_context();
+ }
+
+ ReleaseDC(0, dc);
+}
+
static void check_StretchDIBits_pixel(HDC hdcDst, UINT32 *dstBuffer, UINT32 *srcBuffer,
DWORD dwRop, UINT32 expected, int line)
{
@@ -5963,6 +7098,7 @@ START_TEST(bitmap)
test_CreateBitmap();
test_BitBlt();
test_StretchBlt();
+ test_StretchBlt_HALFTONE();
test_StretchDIBits();
test_GdiAlphaBlend();
test_GdiGradientFill();
--
2.30.2
2
1
24 May '21
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
dlls/kernel32/process.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index b31d73bc5a5..9041b00d512 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -638,7 +638,7 @@ DWORD WINAPI GetMaximumProcessorCount(WORD group)
/***********************************************************************
* GetMaximumProcessorGroupCount (KERNEL32.@)
*/
-DWORD WINAPI GetMaximumProcessorGroupCount(void)
+WORD WINAPI GetMaximumProcessorGroupCount(void)
{
FIXME("semi-stub, always returning 1\n");
return 1;
--
2.31.1
1
4
[PATCH 3/4] gdi32: Make EMFDRV_StretchBlt() compatible with display drivers.
by Zhiyi Zhang 24 May '21
by Zhiyi Zhang 24 May '21
24 May '21
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/gdi32/enhmfdrv/bitblt.c | 121 +++++------------------------------
dlls/gdi32/tests/metafile.c | 29 ++++-----
2 files changed, 27 insertions(+), 123 deletions(-)
diff --git a/dlls/gdi32/enhmfdrv/bitblt.c b/dlls/gdi32/enhmfdrv/bitblt.c
index 597a6110abd..0fa6226ebaa 100644
--- a/dlls/gdi32/enhmfdrv/bitblt.c
+++ b/dlls/gdi32/enhmfdrv/bitblt.c
@@ -27,14 +27,15 @@
#include "enhmetafiledrv.h"
#include "wine/debug.h"
-BOOL CDECL EMFDRV_AlphaBlend( PHYSDEV dev_dst, struct bitblt_coords *dst,
- PHYSDEV dev_src, struct bitblt_coords *src, BLENDFUNCTION func )
+/* Generate an EMRSTRETCHBLT or EMRALPHABLEND record depending on the alpha_blend parameter */
+static BOOL emfdrv_stretchblt( PHYSDEV dev_dst, struct bitblt_coords *dst, PHYSDEV dev_src,
+ struct bitblt_coords *src, DWORD rop, BOOL alpha_blend )
{
unsigned char src_buffer[FIELD_OFFSET(BITMAPINFO, bmiColors[256])];
BITMAPINFO *src_info = (BITMAPINFO *)src_buffer;
UINT bits_size, bmi_size, emr_size, size, bpp;
struct gdi_image_bits bits;
- EMRALPHABLEND *emr;
+ EMRSTRETCHBLT *emr;
BITMAPINFO *bmi;
DC *dc_src;
DWORD err;
@@ -56,14 +57,15 @@ BOOL CDECL EMFDRV_AlphaBlend( PHYSDEV dev_dst, struct bitblt_coords *dst,
bmi_size = sizeof(BITMAPINFOHEADER) + 3 * sizeof(RGBQUAD);
else
bmi_size = sizeof(BITMAPINFOHEADER);
- emr_size = sizeof(EMRALPHABLEND);
+ /* EMRALPHABLEND and EMRSTRETCHBLT have the same structure */
+ emr_size = sizeof(EMRSTRETCHBLT);
bits_size = src_info->bmiHeader.biSizeImage;
size = emr_size + bmi_size + bits_size;
emr = HeapAlloc(GetProcessHeap(), 0, size);
if (!emr) goto err;
- emr->emr.iType = EMR_ALPHABLEND;
+ emr->emr.iType = alpha_blend ? EMR_ALPHABLEND : EMR_STRETCHBLT;
emr->emr.nSize = size;
emr->rclBounds.left = dst->log_x;
emr->rclBounds.top = dst->log_y;
@@ -77,7 +79,7 @@ BOOL CDECL EMFDRV_AlphaBlend( PHYSDEV dev_dst, struct bitblt_coords *dst,
emr->ySrc = src->log_y;
emr->cxSrc = src->log_width;
emr->cySrc = src->log_height;
- emr->dwRop = *(DWORD *)&func;
+ emr->dwRop = rop;
GetTransform(dev_src->hdc, 0x204, &emr->xformSrc);
emr->crBkColorSrc = GetBkColor(dev_src->hdc);
emr->iUsageSrc = DIB_RGB_COLORS;
@@ -115,6 +117,12 @@ err:
return ret;
}
+BOOL CDECL EMFDRV_AlphaBlend( PHYSDEV dev_dst, struct bitblt_coords *dst,
+ PHYSDEV dev_src, struct bitblt_coords *src, BLENDFUNCTION func )
+{
+ return emfdrv_stretchblt( dev_dst, dst, dev_src, src, *(DWORD *)&func, TRUE );
+}
+
BOOL CDECL EMFDRV_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop )
{
EMRBITBLT emr;
@@ -155,106 +163,7 @@ BOOL CDECL EMFDRV_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop )
BOOL CDECL EMFDRV_StretchBlt( PHYSDEV devDst, struct bitblt_coords *dst,
PHYSDEV devSrc, struct bitblt_coords *src, DWORD rop )
{
- BOOL ret;
- PEMRBITBLT pEMR;
- UINT emrSize;
- UINT bmiSize;
- UINT bitsSize;
- UINT size;
- BITMAP BM;
- WORD nBPP = 0;
- LPBITMAPINFOHEADER lpBmiH;
- HBITMAP hBitmap = NULL;
- DWORD emrType;
-
- if (devSrc->funcs == devDst->funcs) return FALSE; /* can't use a metafile DC as source */
-
- if (src->log_width == dst->log_width && src->log_height == dst->log_height)
- {
- emrType = EMR_BITBLT;
- emrSize = sizeof(EMRBITBLT);
- }
- else
- {
- emrType = EMR_STRETCHBLT;
- emrSize = sizeof(EMRSTRETCHBLT);
- }
-
- hBitmap = GetCurrentObject(devSrc->hdc, OBJ_BITMAP);
-
- if(sizeof(BITMAP) != GetObjectW(hBitmap, sizeof(BITMAP), &BM))
- return FALSE;
-
- nBPP = BM.bmPlanes * BM.bmBitsPixel;
- if(nBPP > 8) nBPP = 24; /* FIXME Can't get 16bpp to work for some reason */
- bitsSize = get_dib_stride( BM.bmWidth, nBPP ) * BM.bmHeight;
- bmiSize = sizeof(BITMAPINFOHEADER) +
- (nBPP <= 8 ? 1 << nBPP : 0) * sizeof(RGBQUAD);
-
- size = emrSize + bmiSize + bitsSize;
-
- pEMR = HeapAlloc(GetProcessHeap(), 0, size);
- if (!pEMR) return FALSE;
-
- /* Initialize EMR */
- pEMR->emr.iType = emrType;
- pEMR->emr.nSize = size;
- pEMR->rclBounds.left = dst->log_x;
- pEMR->rclBounds.top = dst->log_y;
- pEMR->rclBounds.right = dst->log_x + dst->log_width - 1;
- pEMR->rclBounds.bottom = dst->log_y + dst->log_height - 1;
- pEMR->xDest = dst->log_x;
- pEMR->yDest = dst->log_y;
- pEMR->cxDest = dst->log_width;
- pEMR->cyDest = dst->log_height;
- pEMR->dwRop = rop;
- pEMR->xSrc = src->log_x;
- pEMR->ySrc = src->log_y;
- GetTransform(devSrc->hdc, 0x204, &pEMR->xformSrc);
- pEMR->crBkColorSrc = GetBkColor(devSrc->hdc);
- pEMR->iUsageSrc = DIB_RGB_COLORS;
- pEMR->offBmiSrc = emrSize;
- pEMR->offBitsSrc = emrSize + bmiSize;
- pEMR->cbBmiSrc = bmiSize;
- pEMR->cbBitsSrc = bitsSize;
- if (emrType == EMR_STRETCHBLT)
- {
- PEMRSTRETCHBLT pEMRStretch = (PEMRSTRETCHBLT)pEMR;
- pEMRStretch->cxSrc = src->log_width;
- pEMRStretch->cySrc = src->log_height;
- }
-
- /* Initialize BITMAPINFO structure */
- lpBmiH = (LPBITMAPINFOHEADER)((BYTE*)pEMR + pEMR->offBmiSrc);
-
- lpBmiH->biSize = sizeof(BITMAPINFOHEADER);
- lpBmiH->biWidth = BM.bmWidth;
- lpBmiH->biHeight = BM.bmHeight;
- lpBmiH->biPlanes = BM.bmPlanes;
- lpBmiH->biBitCount = nBPP;
- /* Assume the bitmap isn't compressed and set the BI_RGB flag. */
- lpBmiH->biCompression = BI_RGB;
- lpBmiH->biSizeImage = bitsSize;
- lpBmiH->biYPelsPerMeter = 0;
- lpBmiH->biXPelsPerMeter = 0;
- lpBmiH->biClrUsed = nBPP <= 8 ? 1 << nBPP : 0;
- /* Set biClrImportant to 0, indicating that all of the
- device colors are important. */
- lpBmiH->biClrImportant = 0;
-
- /* Initialize bitmap bits */
- if (GetDIBits(devSrc->hdc, hBitmap, 0, (UINT)lpBmiH->biHeight,
- (BYTE*)pEMR + pEMR->offBitsSrc,
- (LPBITMAPINFO)lpBmiH, DIB_RGB_COLORS))
- {
- ret = EMFDRV_WriteRecord(devDst, (EMR*)pEMR);
- if (ret) EMFDRV_UpdateBBox(devDst, &(pEMR->rclBounds));
- }
- else
- ret = FALSE;
-
- HeapFree( GetProcessHeap(), 0, pEMR);
- return ret;
+ return emfdrv_stretchblt( devDst, dst, devSrc, src, rop, FALSE );
}
INT CDECL EMFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, INT heightDst,
diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c
index 0e35e02b8da..0ac7f366ae6 100644
--- a/dlls/gdi32/tests/metafile.c
+++ b/dlls/gdi32/tests/metafile.c
@@ -2829,26 +2829,25 @@ static void test_emf_StretchBlt(void)
DWORD used_color_count;
DWORD color_count;
RGBQUAD colors[3];
- BOOL todo;
}
tests[] =
{
{1, 3, 3, BI_RGB, EMF_STRETCHBLT_1BIT_3X3, sizeof(EMF_STRETCHBLT_1BIT_3X3), 1, 1, {{0xff, 0xff, 0xff}}},
{4, 3, 3, BI_RGB, EMF_STRETCHBLT_4BIT_3X3, sizeof(EMF_STRETCHBLT_4BIT_3X3), 1, 1, {{0xff, 0xff, 0xff}}},
{8, 3, 3, BI_RGB, EMF_STRETCHBLT_8BIT_3X3, sizeof(EMF_STRETCHBLT_8BIT_3X3), 1, 1, {{0xff, 0xff, 0xff}}},
- {16, 3, 3, BI_RGB, EMF_STRETCHBLT_16BIT_555_3X3, sizeof(EMF_STRETCHBLT_16BIT_555_3X3), 0, 0, {{0}}, TRUE},
+ {16, 3, 3, BI_RGB, EMF_STRETCHBLT_16BIT_555_3X3, sizeof(EMF_STRETCHBLT_16BIT_555_3X3)},
{24, 3, 3, BI_RGB, EMF_STRETCHBLT_24BIT_3X3, sizeof(EMF_STRETCHBLT_24BIT_3X3)},
- {32, 3, 3, BI_RGB, EMF_STRETCHBLT_32BIT_888_3X3, sizeof(EMF_STRETCHBLT_32BIT_888_3X3), 0, 0, {{0}}, TRUE},
- {16, 3, 3, BI_BITFIELDS, EMF_STRETCHBLT_16BIT_3X3, sizeof(EMF_STRETCHBLT_16BIT_3X3), 0, 3, {{0x00, 0xf8, 0x00}, {0xe0, 0x07, 0x00}, {0x1f, 0x00, 0x00}}, TRUE},
- {32, 3, 3, BI_BITFIELDS, EMF_STRETCHBLT_32BIT_3X3, sizeof(EMF_STRETCHBLT_32BIT_3X3), 0, 3, {{0x00, 0x00, 0xff}, {0xe0, 0xff, 0x00}, {0xff, 0x00, 0x00}}, TRUE},
- {1, 4, 4, BI_RGB, EMF_STRETCHBLT_1BIT_4X4, sizeof(EMF_STRETCHBLT_1BIT_4X4), 1, 1, {{0xff, 0xff, 0xff}}, TRUE},
- {4, 4, 4, BI_RGB, EMF_STRETCHBLT_4BIT_4X4, sizeof(EMF_STRETCHBLT_4BIT_4X4), 1, 1, {{0xff, 0xff, 0xff}}, TRUE},
- {8, 4, 4, BI_RGB, EMF_STRETCHBLT_8BIT_4X4, sizeof(EMF_STRETCHBLT_8BIT_4X4), 1, 1, {{0xff, 0xff, 0xff}}, TRUE},
- {16, 4, 4, BI_RGB, EMF_STRETCHBLT_16BIT_555_4X4, sizeof(EMF_STRETCHBLT_16BIT_555_4X4), 0, 0, {{0}}, TRUE},
- {24, 4, 4, BI_RGB, EMF_STRETCHBLT_24BIT_4X4, sizeof(EMF_STRETCHBLT_24BIT_4X4), 0, 0, {{0}}, TRUE},
- {32, 4, 4, BI_RGB, EMF_STRETCHBLT_32BIT_888_4X4, sizeof(EMF_STRETCHBLT_32BIT_888_4X4), 0, 0, {{0}}, TRUE},
- {16, 4, 4, BI_BITFIELDS, EMF_STRETCHBLT_16BIT_4X4, sizeof(EMF_STRETCHBLT_16BIT_4X4), 0, 3, {{0x00, 0xf8, 0x00}, {0xe0, 0x07, 0x00}, {0x1f, 0x00, 0x00}}, TRUE},
- {32, 4, 4, BI_BITFIELDS, EMF_STRETCHBLT_32BIT_4X4, sizeof(EMF_STRETCHBLT_32BIT_4X4), 0, 3, {{0x00, 0x00, 0xff}, {0xe0, 0xff, 0x00}, {0xff, 0x00, 0x00}}, TRUE},
+ {32, 3, 3, BI_RGB, EMF_STRETCHBLT_32BIT_888_3X3, sizeof(EMF_STRETCHBLT_32BIT_888_3X3)},
+ {16, 3, 3, BI_BITFIELDS, EMF_STRETCHBLT_16BIT_3X3, sizeof(EMF_STRETCHBLT_16BIT_3X3), 0, 3, {{0x00, 0xf8, 0x00}, {0xe0, 0x07, 0x00}, {0x1f, 0x00, 0x00}}},
+ {32, 3, 3, BI_BITFIELDS, EMF_STRETCHBLT_32BIT_3X3, sizeof(EMF_STRETCHBLT_32BIT_3X3), 0, 3, {{0x00, 0x00, 0xff}, {0xe0, 0xff, 0x00}, {0xff, 0x00, 0x00}}},
+ {1, 4, 4, BI_RGB, EMF_STRETCHBLT_1BIT_4X4, sizeof(EMF_STRETCHBLT_1BIT_4X4), 1, 1, {{0xff, 0xff, 0xff}}},
+ {4, 4, 4, BI_RGB, EMF_STRETCHBLT_4BIT_4X4, sizeof(EMF_STRETCHBLT_4BIT_4X4), 1, 1, {{0xff, 0xff, 0xff}}},
+ {8, 4, 4, BI_RGB, EMF_STRETCHBLT_8BIT_4X4, sizeof(EMF_STRETCHBLT_8BIT_4X4), 1, 1, {{0xff, 0xff, 0xff}}},
+ {16, 4, 4, BI_RGB, EMF_STRETCHBLT_16BIT_555_4X4, sizeof(EMF_STRETCHBLT_16BIT_555_4X4)},
+ {24, 4, 4, BI_RGB, EMF_STRETCHBLT_24BIT_4X4, sizeof(EMF_STRETCHBLT_24BIT_4X4)},
+ {32, 4, 4, BI_RGB, EMF_STRETCHBLT_32BIT_888_4X4, sizeof(EMF_STRETCHBLT_32BIT_888_4X4)},
+ {16, 4, 4, BI_BITFIELDS, EMF_STRETCHBLT_16BIT_4X4, sizeof(EMF_STRETCHBLT_16BIT_4X4), 0, 3, {{0x00, 0xf8, 0x00}, {0xe0, 0x07, 0x00}, {0x1f, 0x00, 0x00}}},
+ {32, 4, 4, BI_BITFIELDS, EMF_STRETCHBLT_32BIT_4X4, sizeof(EMF_STRETCHBLT_32BIT_4X4), 0, 3, {{0x00, 0x00, 0xff}, {0xe0, 0xff, 0x00}, {0xff, 0x00, 0x00}}},
};
hdc = GetDC(0);
@@ -2872,10 +2871,6 @@ static void test_emf_StretchBlt(void)
/* Test StretchBlt with different format of bitmaps */
for (test_idx = 0; test_idx < ARRAY_SIZE(tests); ++test_idx)
{
- /* Don't run tests failing on Wine */
- if (tests[test_idx].todo && !strcmp(winetest_platform, "wine"))
- continue;
-
winetest_push_context("Test %d", test_idx);
memset(bmi_buffer, 0, sizeof(bmi_buffer));
--
2.30.2
2
1
[PATCH] mfplat/allocator: Apply default bindflags only for RGBA formats.
by Nikolay Sivov 24 May '21
by Nikolay Sivov 24 May '21
24 May '21
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
These are the formats reported by dxva2 for render target formats.
I don't see a way to make this more API friendly by checking format support mask,
or using d3d11 video API, because RT format support is not limited to these two,
and when d3d11 video API is unavailable (what I see in a VM) 32bit bgra is still preffered.
dlls/mfplat/sample.c | 30 ++++++++++++++++++++----------
1 file changed, 20 insertions(+), 10 deletions(-)
diff --git a/dlls/mfplat/sample.c b/dlls/mfplat/sample.c
index 93c5f923cc2..09c65b5fcf1 100644
--- a/dlls/mfplat/sample.c
+++ b/dlls/mfplat/sample.c
@@ -1379,10 +1379,12 @@ static HRESULT sample_allocator_initialize(struct sample_allocator *allocator, u
unsigned int max_sample_count, IMFAttributes *attributes, IMFMediaType *media_type)
{
struct surface_service service;
+ DXGI_FORMAT dxgi_format;
unsigned int i;
GUID major, subtype;
UINT64 frame_size;
IMFSample *sample;
+ D3D11_USAGE usage;
HRESULT hr;
if (FAILED(hr = IMFMediaType_GetMajorType(media_type, &major)))
@@ -1400,22 +1402,30 @@ static HRESULT sample_allocator_initialize(struct sample_allocator *allocator, u
if (sample_count > max_sample_count)
return E_INVALIDARG;
- allocator->frame_desc.usage = D3D11_USAGE_DEFAULT;
+ usage = D3D11_USAGE_DEFAULT;
if (attributes)
{
IMFAttributes_GetUINT32(attributes, &MF_SA_BUFFERS_PER_SAMPLE, &allocator->frame_desc.buffer_count);
- IMFAttributes_GetUINT32(attributes, &MF_SA_D3D11_USAGE, &allocator->frame_desc.usage);
+ IMFAttributes_GetUINT32(attributes, &MF_SA_D3D11_USAGE, &usage);
}
- if (allocator->frame_desc.usage == D3D11_USAGE_IMMUTABLE || allocator->frame_desc.usage > D3D11_USAGE_STAGING)
+ if (usage == D3D11_USAGE_IMMUTABLE || usage > D3D11_USAGE_STAGING)
return E_INVALIDARG;
- if (allocator->frame_desc.usage == D3D11_USAGE_DEFAULT)
- allocator->frame_desc.bindflags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET;
- else if (allocator->frame_desc.usage == D3D11_USAGE_DYNAMIC)
- allocator->frame_desc.bindflags = D3D11_BIND_SHADER_RESOURCE;
- else
- allocator->frame_desc.bindflags = 0;
+ dxgi_format = MFMapDX9FormatToDXGIFormat(subtype.Data1);
+
+ allocator->frame_desc.bindflags = 0;
+ allocator->frame_desc.usage = D3D11_USAGE_DEFAULT;
+
+ if (dxgi_format == DXGI_FORMAT_B8G8R8A8_UNORM ||
+ dxgi_format == DXGI_FORMAT_B8G8R8X8_UNORM)
+ {
+ allocator->frame_desc.usage = usage;
+ if (allocator->frame_desc.usage == D3D11_USAGE_DEFAULT)
+ allocator->frame_desc.bindflags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET;
+ else if (allocator->frame_desc.usage == D3D11_USAGE_DYNAMIC)
+ allocator->frame_desc.bindflags = D3D11_BIND_SHADER_RESOURCE;
+ }
if (attributes)
IMFAttributes_GetUINT32(attributes, &MF_SA_D3D11_BINDFLAGS, &allocator->frame_desc.bindflags);
@@ -1427,7 +1437,7 @@ static HRESULT sample_allocator_initialize(struct sample_allocator *allocator, u
max_sample_count = max(1, max_sample_count);
allocator->frame_desc.d3d9_format = subtype.Data1;
- allocator->frame_desc.dxgi_format = MFMapDX9FormatToDXGIFormat(allocator->frame_desc.d3d9_format);
+ allocator->frame_desc.dxgi_format = dxgi_format;
allocator->frame_desc.width = frame_size >> 32;
allocator->frame_desc.height = frame_size;
allocator->frame_desc.buffer_count = max(1, allocator->frame_desc.buffer_count);
--
2.30.2
1
0
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/gdi32/tests/metafile.c | 1249 ++++++++++++++++++++++++++++++-----
1 file changed, 1096 insertions(+), 153 deletions(-)
diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c
index 83a10264589..0e35e02b8da 100644
--- a/dlls/gdi32/tests/metafile.c
+++ b/dlls/gdi32/tests/metafile.c
@@ -1265,87 +1265,6 @@ 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,
- 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00,
- 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
- 0x64, 0x02, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x80, 0x07, 0x00, 0x00, 0xb0, 0x04, 0x00, 0x00,
- 0xfc, 0x01, 0x00, 0x00, 0x3e, 0x01, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x60, 0xc0, 0x07, 0x00,
- 0x30, 0xda, 0x04, 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, 0x4d, 0x00, 0x00, 0x00,
- 0xc4, 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,
- 0x0a, 0xd7, 0xa3, 0x3b, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0a, 0xd7, 0x23, 0x3c,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x6c, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
- 0x94, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
- 0x90, 0x01, 0x00, 0x00, 0x90, 0x01, 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,
- 0x0e, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
- 0x14, 0x00, 0x00, 0x00
-};
-
static const unsigned char EMF_DCBRUSH_BITS[] =
{
0x01, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00,
@@ -1909,83 +1828,1107 @@ 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)
+static const unsigned char EMF_STRETCHBLT_1BIT_3X3[] =
{
- 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 */
- };
+ 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,
+ 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00,
+ 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
+ 0x2c, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x07, 0x00, 0x00, 0xd0, 0x03, 0x00, 0x00,
+ 0xfc, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x60, 0xc0, 0x07, 0x00,
+ 0xb9, 0xf0, 0x03, 0x00, 0x4d, 0x00, 0x00, 0x00,
+ 0xac, 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, 0x00, 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,
+ 0x6c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
+ 0x9c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 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
+};
+
+static const unsigned char EMF_STRETCHBLT_4BIT_3X3[] =
+{
+ 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,
+ 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00,
+ 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
+ 0x64, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x07, 0x00, 0x00, 0xd0, 0x03, 0x00, 0x00,
+ 0xfc, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x60, 0xc0, 0x07, 0x00,
+ 0xb9, 0xf0, 0x03, 0x00, 0x4d, 0x00, 0x00, 0x00,
+ 0xe4, 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, 0x00, 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,
+ 0x6c, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00,
+ 0xd4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 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, 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
+};
+
+static const unsigned char EMF_STRETCHBLT_8BIT_3X3[] =
+{
+ 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,
+ 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00,
+ 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
+ 0x24, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x07, 0x00, 0x00, 0xd0, 0x03, 0x00, 0x00,
+ 0xfc, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x60, 0xc0, 0x07, 0x00,
+ 0xb9, 0xf0, 0x03, 0x00, 0x4d, 0x00, 0x00, 0x00,
+ 0xa4, 0x04, 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, 0x00, 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,
+ 0x6c, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00, 0x00,
+ 0x94, 0x04, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 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, 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, 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, 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, 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, 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, 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,
+ 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, 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, 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, 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, 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, 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, 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, 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,
+ 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
+};
+
+static const unsigned char EMF_STRETCHBLT_16BIT_555_3X3[] =
+{
+ 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,
+ 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00,
+ 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
+ 0x40, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x07, 0x00, 0x00, 0xd0, 0x03, 0x00, 0x00,
+ 0xfc, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x60, 0xc0, 0x07, 0x00,
+ 0xb9, 0xf0, 0x03, 0x00, 0x4d, 0x00, 0x00, 0x00,
+ 0xc0, 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, 0x00, 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,
+ 0x6c, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
+ 0xa0, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x7c, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00,
+ 0x1f, 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, 0x0e, 0x00, 0x00, 0x00,
+ 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
+};
+
+static const unsigned char EMF_STRETCHBLT_24BIT_3X3[] =
+{
+ 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,
+ 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00,
+ 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
+ 0x44, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x07, 0x00, 0x00, 0xd0, 0x03, 0x00, 0x00,
+ 0xfc, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x60, 0xc0, 0x07, 0x00,
+ 0xb9, 0xf0, 0x03, 0x00, 0x4d, 0x00, 0x00, 0x00,
+ 0xc4, 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, 0x00, 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,
+ 0x6c, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
+ 0x94, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x03, 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,
+ 0x0e, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
+ 0x14, 0x00, 0x00, 0x00
+};
+
+static const unsigned char EMF_STRETCHBLT_32BIT_888_3X3[] =
+{
+ 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,
+ 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00,
+ 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
+ 0x60, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x07, 0x00, 0x00, 0xd0, 0x03, 0x00, 0x00,
+ 0xfc, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x60, 0xc0, 0x07, 0x00,
+ 0xb9, 0xf0, 0x03, 0x00, 0x4d, 0x00, 0x00, 0x00,
+ 0xe0, 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, 0x00, 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,
+ 0x6c, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
+ 0xa0, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x20, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00,
+ 0xff, 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, 0x0e, 0x00, 0x00, 0x00,
+ 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
+};
+
+static const unsigned char EMF_STRETCHBLT_16BIT_3X3[] =
+{
+ 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,
+ 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00,
+ 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
+ 0x40, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x07, 0x00, 0x00, 0xd0, 0x03, 0x00, 0x00,
+ 0xfc, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x60, 0xc0, 0x07, 0x00,
+ 0xb9, 0xf0, 0x03, 0x00, 0x4d, 0x00, 0x00, 0x00,
+ 0xc0, 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, 0x00, 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,
+ 0x6c, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
+ 0xa0, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf8, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00,
+ 0x1f, 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, 0x0e, 0x00, 0x00, 0x00,
+ 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
+};
+
+static const unsigned char EMF_STRETCHBLT_32BIT_3X3[] =
+{
+ 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,
+ 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00,
+ 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
+ 0x60, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x07, 0x00, 0x00, 0xd0, 0x03, 0x00, 0x00,
+ 0xfc, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x60, 0xc0, 0x07, 0x00,
+ 0xb9, 0xf0, 0x03, 0x00, 0x4d, 0x00, 0x00, 0x00,
+ 0xe0, 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, 0x00, 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,
+ 0x6c, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
+ 0xa0, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x20, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xff, 0x00, 0xe0, 0xff, 0x00, 0x00,
+ 0xff, 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, 0x0e, 0x00, 0x00, 0x00,
+ 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
+};
+
+static const unsigned char EMF_STRETCHBLT_1BIT_4X4[] =
+{
+ 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,
+ 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00,
+ 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
+ 0x2c, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x07, 0x00, 0x00, 0xd0, 0x03, 0x00, 0x00,
+ 0xfc, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x60, 0xc0, 0x07, 0x00,
+ 0xb9, 0xf0, 0x03, 0x00, 0x4d, 0x00, 0x00, 0x00,
+ 0xac, 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, 0x00, 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,
+ 0x6c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
+ 0x9c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 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
+};
+
+static const unsigned char EMF_STRETCHBLT_4BIT_4X4[] =
+{
+ 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,
+ 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00,
+ 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
+ 0x64, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x07, 0x00, 0x00, 0xd0, 0x03, 0x00, 0x00,
+ 0xfc, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x60, 0xc0, 0x07, 0x00,
+ 0xb9, 0xf0, 0x03, 0x00, 0x4d, 0x00, 0x00, 0x00,
+ 0xe4, 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, 0x00, 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,
+ 0x6c, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00,
+ 0xd4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 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, 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
+};
+
+static const unsigned char EMF_STRETCHBLT_8BIT_4X4[] =
+{
+ 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,
+ 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00,
+ 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
+ 0x24, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x07, 0x00, 0x00, 0xd0, 0x03, 0x00, 0x00,
+ 0xfc, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x60, 0xc0, 0x07, 0x00,
+ 0xb9, 0xf0, 0x03, 0x00, 0x4d, 0x00, 0x00, 0x00,
+ 0xa4, 0x04, 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, 0x00, 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,
+ 0x6c, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00, 0x00,
+ 0x94, 0x04, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 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, 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, 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, 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, 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, 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, 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,
+ 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, 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, 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, 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, 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, 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, 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, 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,
+ 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
+};
+
+static const unsigned char EMF_STRETCHBLT_16BIT_555_4X4[] =
+{
+ 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,
+ 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00,
+ 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
+ 0x40, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x07, 0x00, 0x00, 0xd0, 0x03, 0x00, 0x00,
+ 0xfc, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x60, 0xc0, 0x07, 0x00,
+ 0xb9, 0xf0, 0x03, 0x00, 0x4d, 0x00, 0x00, 0x00,
+ 0xc0, 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, 0x00, 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,
+ 0x6c, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
+ 0xa0, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x7c, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00,
+ 0x1f, 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, 0x0e, 0x00, 0x00, 0x00,
+ 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
+};
+
+static const unsigned char EMF_STRETCHBLT_24BIT_4X4[] =
+{
+ 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,
+ 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00,
+ 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
+ 0x44, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x07, 0x00, 0x00, 0xd0, 0x03, 0x00, 0x00,
+ 0xfc, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x60, 0xc0, 0x07, 0x00,
+ 0xb9, 0xf0, 0x03, 0x00, 0x4d, 0x00, 0x00, 0x00,
+ 0xc4, 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, 0x00, 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,
+ 0x6c, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
+ 0x94, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x04, 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,
+ 0x0e, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
+ 0x14, 0x00, 0x00, 0x00
+};
+
+static const unsigned char EMF_STRETCHBLT_32BIT_888_4X4[] =
+{
+ 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,
+ 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00,
+ 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
+ 0x60, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x07, 0x00, 0x00, 0xd0, 0x03, 0x00, 0x00,
+ 0xfc, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x60, 0xc0, 0x07, 0x00,
+ 0xb9, 0xf0, 0x03, 0x00, 0x4d, 0x00, 0x00, 0x00,
+ 0xe0, 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, 0x00, 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,
+ 0x6c, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
+ 0xa0, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x20, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00,
+ 0xff, 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, 0x0e, 0x00, 0x00, 0x00,
+ 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
+};
+
+static const unsigned char EMF_STRETCHBLT_16BIT_4X4[] =
+{
+ 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,
+ 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00,
+ 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
+ 0x40, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x07, 0x00, 0x00, 0xd0, 0x03, 0x00, 0x00,
+ 0xfc, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x60, 0xc0, 0x07, 0x00,
+ 0xb9, 0xf0, 0x03, 0x00, 0x4d, 0x00, 0x00, 0x00,
+ 0xc0, 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, 0x00, 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,
+ 0x6c, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
+ 0xa0, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf8, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00,
+ 0x1f, 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, 0x0e, 0x00, 0x00, 0x00,
+ 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
+};
+
+static const unsigned char EMF_STRETCHBLT_32BIT_4X4[] =
+{
+ 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,
+ 0x4f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00,
+ 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
+ 0x60, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x07, 0x00, 0x00, 0xd0, 0x03, 0x00, 0x00,
+ 0xfc, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x60, 0xc0, 0x07, 0x00,
+ 0xb9, 0xf0, 0x03, 0x00, 0x4d, 0x00, 0x00, 0x00,
+ 0xe0, 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, 0x00, 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,
+ 0x6c, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
+ 0xa0, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x20, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xff, 0x00, 0xe0, 0xff, 0x00, 0x00,
+ 0xff, 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, 0x0e, 0x00, 0x00, 0x00,
+ 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
+};
+
+static void test_emf_StretchBlt(void)
+{
+ static const XFORM xform = {0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f};
+ static const int bitmap_width = 4, bitmap_height = 4;
+ unsigned char bmi_buffer[FIELD_OFFSET(BITMAPINFO, bmiColors[256])];
+ BITMAPINFO *bmi = (BITMAPINFO *)bmi_buffer;
+ HDC hdc, hdc_emf, hdc_emf2, hdc_bitmap;
+ HBITMAP hbitmap, old_hbitmap;
+ HENHMETAFILE hemf, hemf2;
+ int ret, test_idx;
void *bits;
- XFORM xform;
- 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" );
- ok(SetGraphicsMode(hdcBitmap, GM_ADVANCED), "SetGraphicsMode 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" );
-
- ok(SetMapMode(hdcBitmap, MM_ANISOTROPIC), "SetMapMode failed\n");
- ok(SetWindowOrgEx(hdcBitmap, 0, 0, NULL), "SetWindowOrgEx failed\n");
- ok(SetWindowExtEx(hdcBitmap, 400, 400, NULL), "SetWindowExtEx failed\n");
- ok(SetViewportOrgEx(hdcBitmap, 0, 0, NULL), "SetViewportOrgEx failed\n");
- ok(SetViewportExtEx(hdcBitmap, BMP_DIM, BMP_DIM, NULL), "SetViewportExtEx failed\n");
- memset(&xform, 0, sizeof(xform));
- xform.eM11 = 0.5;
- xform.eM22 = 1.0;
- ok(SetWorldTransform(hdcBitmap, &xform), "SetWorldTransform failed\n");
-
- ret = StretchBlt(hdcMetafile, 0, 0, BMP_DIM, BMP_DIM, hdcBitmap, 0, 0, 400, 400, SRCCOPY);
- ok( ret, "StretchBlt(SRCCOPY) 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)
+ static const struct
{
- dump_emf_bits(hMetafile, "emf_BitBlt");
- dump_emf_records(hMetafile, "emf_BitBlt");
+ WORD bpp;
+ int src_width;
+ int src_height;
+ WORD compression;
+ const void *bits;
+ size_t bits_count;
+ DWORD used_color_count;
+ DWORD color_count;
+ RGBQUAD colors[3];
+ BOOL todo;
+ }
+ tests[] =
+ {
+ {1, 3, 3, BI_RGB, EMF_STRETCHBLT_1BIT_3X3, sizeof(EMF_STRETCHBLT_1BIT_3X3), 1, 1, {{0xff, 0xff, 0xff}}},
+ {4, 3, 3, BI_RGB, EMF_STRETCHBLT_4BIT_3X3, sizeof(EMF_STRETCHBLT_4BIT_3X3), 1, 1, {{0xff, 0xff, 0xff}}},
+ {8, 3, 3, BI_RGB, EMF_STRETCHBLT_8BIT_3X3, sizeof(EMF_STRETCHBLT_8BIT_3X3), 1, 1, {{0xff, 0xff, 0xff}}},
+ {16, 3, 3, BI_RGB, EMF_STRETCHBLT_16BIT_555_3X3, sizeof(EMF_STRETCHBLT_16BIT_555_3X3), 0, 0, {{0}}, TRUE},
+ {24, 3, 3, BI_RGB, EMF_STRETCHBLT_24BIT_3X3, sizeof(EMF_STRETCHBLT_24BIT_3X3)},
+ {32, 3, 3, BI_RGB, EMF_STRETCHBLT_32BIT_888_3X3, sizeof(EMF_STRETCHBLT_32BIT_888_3X3), 0, 0, {{0}}, TRUE},
+ {16, 3, 3, BI_BITFIELDS, EMF_STRETCHBLT_16BIT_3X3, sizeof(EMF_STRETCHBLT_16BIT_3X3), 0, 3, {{0x00, 0xf8, 0x00}, {0xe0, 0x07, 0x00}, {0x1f, 0x00, 0x00}}, TRUE},
+ {32, 3, 3, BI_BITFIELDS, EMF_STRETCHBLT_32BIT_3X3, sizeof(EMF_STRETCHBLT_32BIT_3X3), 0, 3, {{0x00, 0x00, 0xff}, {0xe0, 0xff, 0x00}, {0xff, 0x00, 0x00}}, TRUE},
+ {1, 4, 4, BI_RGB, EMF_STRETCHBLT_1BIT_4X4, sizeof(EMF_STRETCHBLT_1BIT_4X4), 1, 1, {{0xff, 0xff, 0xff}}, TRUE},
+ {4, 4, 4, BI_RGB, EMF_STRETCHBLT_4BIT_4X4, sizeof(EMF_STRETCHBLT_4BIT_4X4), 1, 1, {{0xff, 0xff, 0xff}}, TRUE},
+ {8, 4, 4, BI_RGB, EMF_STRETCHBLT_8BIT_4X4, sizeof(EMF_STRETCHBLT_8BIT_4X4), 1, 1, {{0xff, 0xff, 0xff}}, TRUE},
+ {16, 4, 4, BI_RGB, EMF_STRETCHBLT_16BIT_555_4X4, sizeof(EMF_STRETCHBLT_16BIT_555_4X4), 0, 0, {{0}}, TRUE},
+ {24, 4, 4, BI_RGB, EMF_STRETCHBLT_24BIT_4X4, sizeof(EMF_STRETCHBLT_24BIT_4X4), 0, 0, {{0}}, TRUE},
+ {32, 4, 4, BI_RGB, EMF_STRETCHBLT_32BIT_888_4X4, sizeof(EMF_STRETCHBLT_32BIT_888_4X4), 0, 0, {{0}}, TRUE},
+ {16, 4, 4, BI_BITFIELDS, EMF_STRETCHBLT_16BIT_4X4, sizeof(EMF_STRETCHBLT_16BIT_4X4), 0, 3, {{0x00, 0xf8, 0x00}, {0xe0, 0x07, 0x00}, {0x1f, 0x00, 0x00}}, TRUE},
+ {32, 4, 4, BI_BITFIELDS, EMF_STRETCHBLT_32BIT_4X4, sizeof(EMF_STRETCHBLT_32BIT_4X4), 0, 3, {{0x00, 0x00, 0xff}, {0xe0, 0xff, 0x00}, {0xff, 0x00, 0x00}}, TRUE},
+ };
+
+ hdc = GetDC(0);
+
+ /* Test that source DC cannot be an enhanced metafile */
+ hdc_emf = CreateEnhMetaFileW(hdc, NULL, NULL, NULL);
+ ok(!!hdc_emf, "CreateEnhMetaFileW failed, error %d\n", GetLastError());
+ hdc_emf2 = CreateEnhMetaFileW(hdc, NULL, NULL, NULL);
+ ok(!!hdc_emf2, "CreateEnhMetaFileW failed, error %d\n", GetLastError());
+
+ ret = StretchBlt(hdc_emf, 0, 0, 1, 1, hdc_emf2, 0, 0, 1, 1, SRCCOPY);
+ ok(!ret, "StretchBlt succeeded\n");
+
+ hemf2 = CloseEnhMetaFile(hdc_emf2);
+ ok(!!hemf2, "CloseEnhMetaFile failed, error %d\n", GetLastError());
+ hemf = CloseEnhMetaFile(hdc_emf);
+ ok(!!hemf, "CloseEnhMetaFile failed, error %d\n", GetLastError());
+ DeleteEnhMetaFile(hemf2);
+ DeleteEnhMetaFile(hemf);
+
+ /* Test StretchBlt with different format of bitmaps */
+ for (test_idx = 0; test_idx < ARRAY_SIZE(tests); ++test_idx)
+ {
+ /* Don't run tests failing on Wine */
+ if (tests[test_idx].todo && !strcmp(winetest_platform, "wine"))
+ continue;
+
+ winetest_push_context("Test %d", test_idx);
+
+ memset(bmi_buffer, 0, sizeof(bmi_buffer));
+ bmi->bmiHeader.biSize = sizeof(bmi->bmiHeader);
+ bmi->bmiHeader.biHeight = bitmap_width;
+ bmi->bmiHeader.biWidth = bitmap_height;
+ bmi->bmiHeader.biBitCount = tests[test_idx].bpp;
+ bmi->bmiHeader.biPlanes = 1;
+ bmi->bmiHeader.biCompression = tests[test_idx].compression;
+ bmi->bmiHeader.biClrUsed = tests[test_idx].used_color_count;
+ memcpy(bmi->bmiColors, tests[test_idx].colors, sizeof(RGBQUAD) * tests[test_idx].color_count);
+
+ hbitmap = CreateDIBSection(hdc, bmi, DIB_RGB_COLORS, &bits, NULL, 0);
+ ok(!!hbitmap, "CreateDIBSection failed, error %d\n", GetLastError());
+ hdc_bitmap = CreateCompatibleDC(hdc);
+ ok(!!hdc_bitmap, "CreateCompatibleDC failed, error %d\n", GetLastError());
+ old_hbitmap = SelectObject(hdc_bitmap, hbitmap);
+
+ SetBkColor(hdc_bitmap, RGB(0xff, 0xff, 0xff));
+ ret = SetGraphicsMode(hdc_bitmap, GM_ADVANCED);
+ ok(ret, "SetGraphicsMode failed, error %d\n", GetLastError());
+ ret = SetWorldTransform(hdc_bitmap, &xform);
+ ok(ret, "SetWorldTransform failed, error %d\n", GetLastError());
+
+ hdc_emf = CreateEnhMetaFileW(hdc, NULL, NULL, NULL);
+ ok(!!hdc_emf, "CreateEnhMetaFileW failed, error %d\n", GetLastError());
+
+ ret = BitBlt(hdc_bitmap, 0, 0, bitmap_width, bitmap_height, 0, 0, 0, BLACKNESS);
+ ok(ret, "BitBlt failed, error %d\n", GetLastError());
+ ret = StretchBlt(hdc_emf, 0, 0, bitmap_width, bitmap_height, hdc_bitmap, 0, 0,
+ tests[test_idx].src_width, tests[test_idx].src_height, SRCCOPY);
+ ok(ret, "StretchBlt failed, error %d\n", GetLastError());
+
+ hemf = CloseEnhMetaFile(hdc_emf);
+ ok(!!hemf, "CloseEnhMetaFile failed, %d\n", GetLastError());
+
+ ret = compare_emf_bits(hemf, tests[test_idx].bits, tests[test_idx].bits_count,
+ "test_emf_StretchBlt()", FALSE);
+ if (ret)
+ {
+ dump_emf_bits(hemf, "test_emf_StretchBlt()");
+ dump_emf_records(hemf, "test_emf_StretchBlt()");
+ }
+
+ DeleteEnhMetaFile(hemf);
+ SelectObject(hdc_bitmap, old_hbitmap);
+ DeleteDC(hdc_bitmap);
+ DeleteObject(hbitmap);
+
+ winetest_pop_context();
}
- SelectObject(hdcBitmap, hOldBitmap);
- DeleteObject(hBitmap);
- DeleteDC(hdcBitmap);
- DeleteDC(hdcDisplay);
-#undef BMP_DIM
+ ReleaseDC(0, hdc);
}
static void test_emf_DCBrush(void)
@@ -5159,13 +6102,13 @@ START_TEST(metafile)
test_ExtTextOutScale();
test_SaveDC();
test_emf_AlphaBlend();
- test_emf_BitBlt();
test_emf_DCBrush();
test_emf_ExtTextOut_on_path();
test_emf_clipping();
test_emf_polybezier();
test_emf_paths();
test_emf_PolyPolyline();
+ test_emf_StretchBlt();
test_emf_GradientFill();
test_emf_WorldTransform();
test_emf_text_extents();
--
2.30.2
2
1
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/gdi32/mfdrv/dc.c | 12 ++++++
dlls/gdi32/mfdrv/init.c | 2 +-
dlls/gdi32/mfdrv/metafiledrv.h | 1 +
dlls/gdi32/tests/metafile.c | 79 ++++++++++++++++++++++++++++++++++
4 files changed, 93 insertions(+), 1 deletion(-)
diff --git a/dlls/gdi32/mfdrv/dc.c b/dlls/gdi32/mfdrv/dc.c
index 61417bfd462..1133102371a 100644
--- a/dlls/gdi32/mfdrv/dc.c
+++ b/dlls/gdi32/mfdrv/dc.c
@@ -85,6 +85,18 @@ INT CDECL MFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y )
return MFDRV_MetaParam2( dev, META_OFFSETCLIPRGN, x, y );
}
+DWORD CDECL MFDRV_SetLayout( PHYSDEV dev, DWORD layout )
+{
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetLayout );
+
+ if (!MFDRV_MetaParam2( dev, META_SETLAYOUT, HIWORD(layout), LOWORD(layout) ))
+ return GDI_ERROR;
+
+ next->funcs->pSetLayout( next, layout );
+ /* Always return LAYOUT_RTL according to tests */
+ return LAYOUT_RTL;
+}
+
INT CDECL MFDRV_SetMapMode( PHYSDEV dev, INT mode )
{
return MFDRV_MetaParam1( dev, META_SETMAPMODE, mode );
diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c
index 2a215b70902..fe7aae631d7 100644
--- a/dlls/gdi32/mfdrv/init.c
+++ b/dlls/gdi32/mfdrv/init.c
@@ -201,7 +201,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
MFDRV_SetDIBitsToDevice, /* pSetDIBitsToDevice */
NULL, /* pSetDeviceClipping */
NULL, /* pSetDeviceGammaRamp */
- NULL, /* pSetLayout */
+ MFDRV_SetLayout, /* pSetLayout */
MFDRV_SetMapMode, /* pSetMapMode */
MFDRV_SetMapperFlags, /* pSetMapperFlags */
MFDRV_SetPixel, /* pSetPixel */
diff --git a/dlls/gdi32/mfdrv/metafiledrv.h b/dlls/gdi32/mfdrv/metafiledrv.h
index 7d3d1c41da5..429b95b3f40 100644
--- a/dlls/gdi32/mfdrv/metafiledrv.h
+++ b/dlls/gdi32/mfdrv/metafiledrv.h
@@ -113,6 +113,7 @@ extern COLORREF CDECL MFDRV_SetBkColor( PHYSDEV dev, COLORREF color ) DECLSPEC_H
extern INT CDECL MFDRV_SetBkMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN;
extern COLORREF CDECL MFDRV_SetDCBrushColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern COLORREF CDECL MFDRV_SetDCPenColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
+extern DWORD CDECL MFDRV_SetLayout( PHYSDEV dev, DWORD layout ) DECLSPEC_HIDDEN;
extern INT CDECL MFDRV_SetMapMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN;
extern DWORD CDECL MFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags ) DECLSPEC_HIDDEN;
extern COLORREF CDECL MFDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN;
diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c
index ab823dd443d..83a10264589 100644
--- a/dlls/gdi32/tests/metafile.c
+++ b/dlls/gdi32/tests/metafile.c
@@ -5072,6 +5072,84 @@ static void test_emf_text_extents(void)
ReleaseDC(0, dc);
}
+static const unsigned char MF_SETLAYOUT_BITS[] =
+{
+/* Winedump output. Note that there is no META_SELECTOBJECT records after META_SETLAYOUT.
+ *
+ * METAHEADER 00000012
+ * type 1 header_size 0x12 version 0x300 size 0x54 object_count 0 max_record_size 0xa parameter_count 0
+ * 0001 0009 0300 002a 0000 0000 0005 0000
+ * 0000
+ * META_SETLAYOUT 0000000a
+ * 0000 0000
+ * META_SETLAYOUT 0000000a
+ * 0001 0000
+ * META_SETLAYOUT 0000000a
+ * 0008 0000
+ * META_SETLAYOUT 0000000a
+ * 0000 8000
+ * META_SETLAYOUT 0000000a
+ * 0009 0000
+ * META_SETLAYOUT 0000000a
+ * 0001 8000
+ * META_EOF 00000006
+ */
+ 0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x2a, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x49, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
+ 0x49, 0x01, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00,
+ 0x00, 0x00, 0x49, 0x01, 0x08, 0x00, 0x00, 0x00,
+ 0x05, 0x00, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00,
+ 0x00, 0x80, 0x05, 0x00, 0x00, 0x00, 0x49, 0x01,
+ 0x09, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
+ 0x49, 0x01, 0x01, 0x00, 0x00, 0x80, 0x03, 0x00,
+ 0x00, 0x00, 0x00, 0x00
+};
+
+static void test_mf_SetLayout(void)
+{
+ static const DWORD tests[] =
+ {
+ LAYOUT_LTR,
+ LAYOUT_RTL,
+ LAYOUT_BITMAPORIENTATIONPRESERVED,
+ NOMIRRORBITMAP,
+ LAYOUT_RTL | LAYOUT_BITMAPORIENTATIONPRESERVED,
+ LAYOUT_RTL | NOMIRRORBITMAP,
+ };
+ DWORD layout;
+ HMETAFILE mf;
+ int ret, i;
+ HDC mf_dc;
+
+ mf_dc = CreateMetaFileW(NULL);
+ ok(!!mf_dc, "CreateMetaFileW failed, error %d\n", GetLastError());
+
+ for (i = 0; i < ARRAY_SIZE(tests); ++i)
+ {
+ winetest_push_context("Test %d", i);
+ layout = SetLayout(mf_dc, tests[i]);
+ ok(layout == LAYOUT_RTL, "Expected %#x, got %#x\n", tests[i], layout);
+ layout = GetLayout(mf_dc);
+ todo_wine ok(layout == GDI_ERROR, "Expected %#x, got %#x\n", GDI_ERROR, layout);
+ winetest_pop_context();
+ }
+
+ mf = CloseMetaFile(mf_dc);
+ ok(!!mf, "CloseMetaFile failed, error %d\n", GetLastError());
+
+ ret = compare_mf_bits(mf, MF_SETLAYOUT_BITS, sizeof(MF_SETLAYOUT_BITS), "mf_SetLayout");
+ ok(!ret, "Bits mismatch\n");
+ if (ret)
+ {
+ dump_mf_bits(mf, "mf_SetLayout");
+ EnumMetaFile(0, mf, mf_enum_proc, 0);
+ }
+
+ DeleteMetaFile(mf);
+}
+
START_TEST(metafile)
{
init_function_pointers();
@@ -5103,6 +5181,7 @@ START_TEST(metafile)
test_mf_ExtTextOut_on_path();
test_mf_clipping();
test_mf_GetPath();
+ test_mf_SetLayout();
/* For metafile conversions */
test_mf_conversions();
--
2.30.2
2
1
24 May '21
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49315
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/kernelbase/path.c | 2 +-
dlls/shlwapi/tests/path.c | 25 +++++++++++++++++++++++++
2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/dlls/kernelbase/path.c b/dlls/kernelbase/path.c
index 14e892bcc42..9387705e963 100644
--- a/dlls/kernelbase/path.c
+++ b/dlls/kernelbase/path.c
@@ -1389,7 +1389,7 @@ BOOL WINAPI PathCanonicalizeW(WCHAR *buffer, const WCHAR *path)
{
src += 2; /* Skip .\ */
}
- else if (src[1] == '.' && (dst == buffer || dst[-1] == '\\'))
+ else if (src[1] == '.' && dst != buffer && dst[-1] == '\\')
{
/* \.. backs up a directory, over the root if it has no \ following X:.
* .. is ignored if it would remove a UNC server name or initial \\
diff --git a/dlls/shlwapi/tests/path.c b/dlls/shlwapi/tests/path.c
index e9f08a902b0..dbe1f36fbfd 100644
--- a/dlls/shlwapi/tests/path.c
+++ b/dlls/shlwapi/tests/path.c
@@ -714,6 +714,15 @@ static void test_PathCombineA(void)
ok(!lstrcmpA(str, "C:\\"), "Expected C:\\, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
+ /* try relative paths */
+ /* try forward slashes */
+ SetLastError(0xdeadbeef);
+ lstrcpyA(dest, "control");
+ str = PathCombineA(dest, "../../../one/two/", "*");
+ ok(str == dest, "Expected str == dest, got %p\n", str);
+ ok(!lstrcmpA(str, "../../../one/two/\\*"), "Expected ../../../one/two/\\*, got %s\n", str);
+ ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
+
memset(too_long, 'a', LONG_LEN);
too_long[LONG_LEN - 1] = '\0';
@@ -1039,6 +1048,22 @@ static void test_PathCanonicalizeA(void)
!lstrcmpA(dest, "C:\\one/"), /* Vista */
"Expected \"C:\\one/.\" or \"C:\\one/\", got \"%s\"\n", dest);
+ /* try relative forward slashes */
+ lstrcpyA(dest, "test");
+ SetLastError(0xdeadbeef);
+ res = PathCanonicalizeA(dest, "../../one/two/");
+ ok(res, "Expected success\n");
+ ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
+ ok(!lstrcmpA(dest, "../../one/two/"), "Expected ../../one/two/, got %s\n", dest);
+
+ /* try relative forward slashes */
+ lstrcpyA(dest, "test");
+ SetLastError(0xdeadbeef);
+ res = PathCanonicalizeA(dest, "../../one/two/\\*");
+ ok(res, "Expected success\n");
+ ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
+ ok(!lstrcmpA(dest, "../../one/two/\\*"), "Expected ../../one/two/\\*, got %s\n", dest);
+
/* try forward slashes with change dirs
* NOTE: if there is a forward slash in between two backslashes,
* everything in between the two backslashes is considered on dir
--
2.31.0
1
0
24 May '21
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
https://www.geoffchappell.com/studies/windows/km/ntoskrnl/api/ex/sysinfo/pr…
---
dlls/ntdll/unix/system.c | 29 +++++++++++++++++++++++++++++
include/winternl.h | 2 +-
2 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c
index 491cdb37b8f..784fb6212a5 100644
--- a/dlls/ntdll/unix/system.c
+++ b/dlls/ntdll/unix/system.c
@@ -173,6 +173,31 @@ struct smbios_boot_info
SYSTEM_CPU_INFORMATION cpu_info = { 0 };
+static int get_possible_cpus(void)
+{
+ int ret = NtCurrentTeb()->Peb->NumberOfProcessors;
+#ifdef linux
+ FILE *f = fopen("/sys/devices/system/cpu/possible", "r");
+ char line[32];
+ char *value;
+ if (f)
+ {
+ if (fgets(line, sizeof(line), f))
+ {
+ value = strchr(line, '-');
+ if (value)
+ {
+ *value = 0;
+ value++;
+ ret = atoi(value) - atoi(line) + 1;
+ }
+ }
+ fclose(f);
+ }
+#endif
+ return ret;
+}
+
/*******************************************************************************
* Architecture specific feature detection for CPUs
*
@@ -246,6 +271,8 @@ static void get_cpuinfo( SYSTEM_CPU_INFORMATION *info )
info->Architecture = PROCESSOR_ARCHITECTURE_AMD64;
#endif
+ info->MaximumCpus = get_possible_cpus();
+
/* We're at least a 386 */
info->FeatureSet = CPU_FEATURE_VME | CPU_FEATURE_X86 | CPU_FEATURE_PGE;
info->Level = 3;
@@ -400,6 +427,7 @@ static inline void get_cpuinfo( SYSTEM_CPU_INFORMATION *info )
FIXME("CPU Feature detection not implemented.\n");
#endif
info->Architecture = PROCESSOR_ARCHITECTURE_ARM;
+ info->MaximumCpus = get_possible_cpus();
}
#elif defined(__aarch64__)
@@ -448,6 +476,7 @@ static void get_cpuinfo( SYSTEM_CPU_INFORMATION *info )
#endif
info->Level = max(info->Level, 8);
info->Architecture = PROCESSOR_ARCHITECTURE_ARM64;
+ info->MaximumCpus = get_possible_cpus();
}
#endif /* End architecture specific feature detection for CPUs */
diff --git a/include/winternl.h b/include/winternl.h
index dd2bdbbebbe..1104865a053 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -2132,7 +2132,7 @@ typedef struct _SYSTEM_CPU_INFORMATION {
WORD Architecture;
WORD Level;
WORD Revision; /* combination of CPU model and stepping */
- WORD Reserved; /* always zero */
+ WORD MaximumCpus; /* number of CPUs if as many as possible are hot-added */
DWORD FeatureSet; /* see bit flags below */
} SYSTEM_CPU_INFORMATION, *PSYSTEM_CPU_INFORMATION;
--
2.31.1
2
3