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
June 2021
- 82 participants
- 607 discussions
[PATCH 4/6] d3d11: Implement d3d11_device_context_ClearUnorderedAccessViewFloat().
by Henri Verbeet 07 Jun '21
by Henri Verbeet 07 Jun '21
07 Jun '21
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/d3d11/device.c | 11 ++++++++++-
dlls/d3d11/tests/d3d11.c | 26 +++++++++++---------------
dlls/wined3d/adapter_gl.c | 6 +++---
dlls/wined3d/adapter_vk.c | 6 +++---
dlls/wined3d/cs.c | 8 +++++---
dlls/wined3d/device.c | 16 +++++++++++++++-
dlls/wined3d/directx.c | 4 ++--
dlls/wined3d/view.c | 18 ++++++++++++------
dlls/wined3d/wined3d.spec | 1 +
dlls/wined3d/wined3d_private.h | 14 +++++++-------
include/wine/wined3d.h | 2 ++
11 files changed, 71 insertions(+), 41 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 7994da70591..d3e49879676 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -1447,8 +1447,17 @@ static void STDMETHODCALLTYPE d3d11_device_context_ClearUnorderedAccessViewUint(
static void STDMETHODCALLTYPE d3d11_device_context_ClearUnorderedAccessViewFloat(ID3D11DeviceContext1 *iface,
ID3D11UnorderedAccessView *unordered_access_view, const float values[4])
{
- FIXME("iface %p, unordered_access_view %p, values %s stub!\n",
+ struct d3d11_device_context *context = impl_from_ID3D11DeviceContext1(iface);
+ struct d3d11_unordered_access_view *view;
+
+ TRACE("iface %p, unordered_access_view %p, values %s.\n",
iface, unordered_access_view, debug_float4(values));
+
+ view = unsafe_impl_from_ID3D11UnorderedAccessView(unordered_access_view);
+ wined3d_mutex_lock();
+ wined3d_device_context_clear_uav_float(context->wined3d_context,
+ view->wined3d_view, (const struct wined3d_vec4 *)values);
+ wined3d_mutex_unlock();
}
static void STDMETHODCALLTYPE d3d11_device_context_ClearDepthStencilView(ID3D11DeviceContext1 *iface,
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index f729a38b4c2..ae48e9748c9 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -16451,22 +16451,19 @@ static void test_clear_image_unordered_access_view(void)
unsigned int expected;
BOOL is_float;
unsigned int clamped;
- BOOL is_todo;
}
tests[] =
{
/* Test clearing a specific mip level. */
{DXGI_FORMAT_R32_FLOAT, 2, 1, 0, 0, 1, {1, 0, 0, 0}, 0x00000001},
{DXGI_FORMAT_R32_FLOAT, 2, 1, 1, 0, 1, {1, 0, 0, 0}, 0x00000001},
- {DXGI_FORMAT_R32_FLOAT, 2, 1, 0, 0, 1, {0x3f000000, 0, 0, 0}, 0x3f000000, TRUE, 0, TRUE},
- {DXGI_FORMAT_R32_FLOAT, 2, 1, 1, 0, 1, {0x3f000000, 0, 0, 0}, 0x3f000000, TRUE, 0, TRUE},
+ {DXGI_FORMAT_R32_FLOAT, 2, 1, 0, 0, 1, {0x3f000000, 0, 0, 0}, 0x3f000000, TRUE},
+ {DXGI_FORMAT_R32_FLOAT, 2, 1, 1, 0, 1, {0x3f000000, 0, 0, 0}, 0x3f000000, TRUE},
/* Test clearing specific array layers. */
{DXGI_FORMAT_R32_FLOAT, 1, IMAGE_SIZE, 0, 0, IMAGE_SIZE, {1, 0, 0, 0}, 0x00000001},
{DXGI_FORMAT_R32_FLOAT, 1, IMAGE_SIZE, 0, 3, 2, {1, 0, 0, 0}, 0x00000001},
- {DXGI_FORMAT_R32_FLOAT, 1, IMAGE_SIZE, 0, 0, IMAGE_SIZE,
- {0x3f000000, 0, 0, 0}, 0x3f000000, TRUE, 0, TRUE},
- {DXGI_FORMAT_R32_FLOAT, 1, IMAGE_SIZE, 0, 3, 2,
- {0x3f000000, 0, 0, 0}, 0x3f000000, TRUE, 0, TRUE},
+ {DXGI_FORMAT_R32_FLOAT, 1, IMAGE_SIZE, 0, 0, IMAGE_SIZE, {0x3f000000, 0, 0, 0}, 0x3f000000, TRUE},
+ {DXGI_FORMAT_R32_FLOAT, 1, IMAGE_SIZE, 0, 3, 2, {0x3f000000, 0, 0, 0}, 0x3f000000, TRUE},
/* Test uint clears with formats. */
{DXGI_FORMAT_R16G16_UINT, 1, 1, 0, 0, 1, {1, 2, 3, 4}, 0x00020001},
{DXGI_FORMAT_R16G16_UINT, 1, 1, 0, 0, 1, {0x12345, 0, 0, 0}, 0x00002345, FALSE, 0x0000ffff},
@@ -16478,16 +16475,16 @@ static void test_clear_image_unordered_access_view(void)
{DXGI_FORMAT_R11G11B10_FLOAT, 1, 1, 0, 0, 1, {1, 2, 3, 4}, 0x00c01001},
/* Test float clears with formats. */
{DXGI_FORMAT_R16G16_UNORM, 1, 1, 0, 0, 1,
- {0x3f000000 /* 0.5f */, 0x3f800000 /* 1.0f */, 0, 0}, 0xffff8000, TRUE, 0, TRUE},
+ {0x3f000000 /* 0.5f */, 0x3f800000 /* 1.0f */, 0, 0}, 0xffff8000, TRUE},
{DXGI_FORMAT_R16G16_FLOAT, 1, 1, 0, 0, 1,
- {0x3f000000 /* 0.5f */, 0x3f800000 /* 1.0f */, 0, 0}, 0x3c003800, TRUE, 0, TRUE},
+ {0x3f000000 /* 0.5f */, 0x3f800000 /* 1.0f */, 0, 0}, 0x3c003800, TRUE},
{DXGI_FORMAT_R8G8B8A8_UNORM, 1, 1, 0, 0, 1,
- {0x3f000000 /* 0.5f */, 0x3f800000 /* 1.0f */, 0, 0}, 0x0000ff80, TRUE, 0, TRUE},
+ {0x3f000000 /* 0.5f */, 0x3f800000 /* 1.0f */, 0, 0}, 0x0000ff80, TRUE},
{DXGI_FORMAT_R8G8B8A8_UNORM, 1, 1, 0, 0, 1,
- {0, 0, 0x3f000000 /* 0.5f */, 0x3f800000 /* 1.0f */}, 0xff800000, TRUE, 0, TRUE},
+ {0, 0, 0x3f000000 /* 0.5f */, 0x3f800000 /* 1.0f */}, 0xff800000, TRUE},
{DXGI_FORMAT_R11G11B10_FLOAT, 1, 1, 0, 0, 1,
{0x3f000000 /* 1.0f */, 0 /* 0.0f */, 0xbf800000 /* -1.0f */, 0x3f000000 /* 1.0f */},
- 0x00000380, TRUE, 0, TRUE},
+ 0x00000380, TRUE},
};
static const struct
@@ -16624,9 +16621,8 @@ static void test_clear_image_unordered_access_view(void)
|| broken(is_inside && !tests[i].is_float && is_small_float_format && !actual_colour)))
break;
}
- todo_wine_if(tests[i].is_todo && expected_colour)
- ok(success, "At layer %u, (%u,%u,%u), expected 0x%08x, got 0x%08x.\n",
- layer, x, y, z, expected_colour, actual_colour);
+ ok(success, "At layer %u, (%u,%u,%u), expected 0x%08x, got 0x%08x.\n",
+ layer, x, y, z, expected_colour, actual_colour);
release_resource_readback(&rb);
}
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c
index f6ef04a5fbb..b014790af51 100644
--- a/dlls/wined3d/adapter_gl.c
+++ b/dlls/wined3d/adapter_gl.c
@@ -5015,12 +5015,12 @@ static void adapter_gl_flush_context(struct wined3d_context *context)
}
static void adapter_gl_clear_uav(struct wined3d_context *context,
- struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value)
+ struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value, bool fp)
{
TRACE("context %p, view %p, clear_value %s.\n", context, view, debug_uvec4(clear_value));
- wined3d_unordered_access_view_gl_clear_uint(wined3d_unordered_access_view_gl(view),
- clear_value, wined3d_context_gl(context));
+ wined3d_unordered_access_view_gl_clear(wined3d_unordered_access_view_gl(view),
+ clear_value, wined3d_context_gl(context), fp);
}
static void adapter_gl_generate_mipmap(struct wined3d_context *context, struct wined3d_shader_resource_view *view)
diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c
index 99d7547b834..9f36ee39080 100644
--- a/dlls/wined3d/adapter_vk.c
+++ b/dlls/wined3d/adapter_vk.c
@@ -1744,12 +1744,12 @@ static void adapter_vk_dispatch_compute(struct wined3d_device *device,
}
static void adapter_vk_clear_uav(struct wined3d_context *context,
- struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value)
+ struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value, bool fp)
{
TRACE("context %p, view %p, clear_value %s.\n", context, view, debug_uvec4(clear_value));
- wined3d_unordered_access_view_vk_clear_uint(wined3d_unordered_access_view_vk(view),
- clear_value, wined3d_context_vk(context));
+ wined3d_unordered_access_view_vk_clear(wined3d_unordered_access_view_vk(view),
+ clear_value, wined3d_context_vk(context), fp);
}
static void adapter_vk_generate_mipmap(struct wined3d_context *context, struct wined3d_shader_resource_view *view)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 50a08334dab..544b76534d0 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -504,6 +504,7 @@ struct wined3d_cs_clear_unordered_access_view
enum wined3d_cs_op opcode;
struct wined3d_unordered_access_view *view;
struct wined3d_uvec4 clear_value;
+ bool fp;
};
struct wined3d_cs_copy_uav_counter
@@ -2721,14 +2722,14 @@ static void wined3d_cs_exec_clear_unordered_access_view(struct wined3d_cs *cs, c
struct wined3d_context *context;
context = context_acquire(cs->c.device, NULL, 0);
- cs->c.device->adapter->adapter_ops->adapter_clear_uav(context, view, &op->clear_value);
+ cs->c.device->adapter->adapter_ops->adapter_clear_uav(context, view, &op->clear_value, op->fp);
context_release(context);
wined3d_resource_release(view->resource);
}
-void wined3d_device_context_emit_clear_uav_uint(struct wined3d_device_context *context,
- struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value)
+void wined3d_device_context_emit_clear_uav(struct wined3d_device_context *context,
+ struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value, bool fp)
{
struct wined3d_cs_clear_unordered_access_view *op;
@@ -2736,6 +2737,7 @@ void wined3d_device_context_emit_clear_uav_uint(struct wined3d_device_context *c
op->opcode = WINED3D_CS_OP_CLEAR_UNORDERED_ACCESS_VIEW;
op->view = view;
op->clear_value = *clear_value;
+ op->fp = fp;
wined3d_device_context_acquire_resource(context, view->resource);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 5092d8129b9..a11f137729f 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4799,12 +4799,26 @@ HRESULT CDECL wined3d_device_context_clear_rendertarget_view(struct wined3d_devi
return WINED3D_OK;
}
+void CDECL wined3d_device_context_clear_uav_float(struct wined3d_device_context *context,
+ struct wined3d_unordered_access_view *view, const struct wined3d_vec4 *clear_value)
+{
+ TRACE("context %p, view %p, clear_value %s.\n", context, view, debug_vec4(clear_value));
+
+ if (!(view->format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & (WINED3DFMT_FLAG_FLOAT | WINED3DFMT_FLAG_NORMALISED)))
+ {
+ WARN("Not supported for view format %s.\n", debug_d3dformat(view->format->id));
+ return;
+ }
+
+ wined3d_device_context_emit_clear_uav(context, view, (const struct wined3d_uvec4 *)clear_value, true);
+}
+
void CDECL wined3d_device_context_clear_uav_uint(struct wined3d_device_context *context,
struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value)
{
TRACE("context %p, view %p, clear_value %s.\n", context, view, debug_uvec4(clear_value));
- wined3d_device_context_emit_clear_uav_uint(context, view, clear_value);
+ wined3d_device_context_emit_clear_uav(context, view, clear_value, false);
}
static unsigned int sanitise_map_flags(const struct wined3d_resource *resource, unsigned int flags)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index be43d2ffb86..0e8a396a598 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -3046,9 +3046,9 @@ static void adapter_no3d_dispatch_compute(struct wined3d_device *device,
}
static void adapter_no3d_clear_uav(struct wined3d_context *context,
- struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value)
+ struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value, bool fp)
{
- ERR("context %p, view %p, clear_value %s.\n", context, view, debug_uvec4(clear_value));
+ ERR("context %p, view %p, clear_value %s, fp %#x.\n", context, view, debug_uvec4(clear_value), fp);
}
static const struct wined3d_adapter_ops wined3d_adapter_no3d_ops =
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
index 2d2622e1191..cda16b690f8 100644
--- a/dlls/wined3d/view.c
+++ b/dlls/wined3d/view.c
@@ -1446,8 +1446,8 @@ void wined3d_unordered_access_view_invalidate_location(struct wined3d_unordered_
wined3d_view_invalidate_location(view->resource, &view->desc, location);
}
-void wined3d_unordered_access_view_gl_clear_uint(struct wined3d_unordered_access_view_gl *view_gl,
- const struct wined3d_uvec4 *clear_value, struct wined3d_context_gl *context_gl)
+void wined3d_unordered_access_view_gl_clear(struct wined3d_unordered_access_view_gl *view_gl,
+ const struct wined3d_uvec4 *clear_value, struct wined3d_context_gl *context_gl, bool fp)
{
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
const struct wined3d_format_gl *format_gl;
@@ -1478,7 +1478,7 @@ void wined3d_unordered_access_view_gl_clear_uint(struct wined3d_unordered_access
base_layer = view_gl->v.desc.u.texture.layer_idx;
base_level = view_gl->v.desc.u.texture.level_idx;
- if (format_gl->f.byte_count <= 4)
+ if (format_gl->f.byte_count <= 4 && !fp)
{
gl_format = format_gl->format;
gl_type = format_gl->type;
@@ -1552,6 +1552,12 @@ void wined3d_unordered_access_view_gl_clear_uint(struct wined3d_unordered_access
return;
}
+ if (fp)
+ {
+ FIXME("Floating-point buffer clears not implemented.\n");
+ return;
+ }
+
buffer_gl = wined3d_buffer_gl(buffer_from_resource(resource));
wined3d_buffer_load_location(&buffer_gl->b, &context_gl->c, WINED3D_LOCATION_BUFFER);
wined3d_unordered_access_view_invalidate_location(&view_gl->v, ~WINED3D_LOCATION_BUFFER);
@@ -1700,8 +1706,8 @@ HRESULT wined3d_unordered_access_view_gl_init(struct wined3d_unordered_access_vi
return hr;
}
-void wined3d_unordered_access_view_vk_clear_uint(struct wined3d_unordered_access_view_vk *view_vk,
- const struct wined3d_uvec4 *clear_value, struct wined3d_context_vk *context_vk)
+void wined3d_unordered_access_view_vk_clear(struct wined3d_unordered_access_view_vk *view_vk,
+ const struct wined3d_uvec4 *clear_value, struct wined3d_context_vk *context_vk, bool fp)
{
const struct wined3d_vk_info *vk_info;
const struct wined3d_format *format;
@@ -1712,7 +1718,7 @@ void wined3d_unordered_access_view_vk_clear_uint(struct wined3d_unordered_access
VkAccessFlags access_mask;
unsigned int offset, size;
- TRACE("view_vk %p, clear_value %s, context_vk %p.\n", view_vk, debug_uvec4(clear_value), context_vk);
+ TRACE("view_vk %p, clear_value %s, context_vk %p, fp %#x.\n", view_vk, debug_uvec4(clear_value), context_vk, fp);
resource = view_vk->v.resource;
if (resource->type != WINED3D_RTYPE_BUFFER)
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index 7b0737386b7..11351b60a7f 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -87,6 +87,7 @@
@ cdecl wined3d_device_context_blt(ptr ptr long ptr ptr long ptr long ptr long)
@ cdecl wined3d_device_context_clear_rendertarget_view(ptr ptr ptr long ptr float long)
+@ cdecl wined3d_device_context_clear_uav_float(ptr ptr ptr)
@ cdecl wined3d_device_context_clear_uav_uint(ptr ptr ptr)
@ cdecl wined3d_device_context_copy_resource(ptr ptr ptr)
@ cdecl wined3d_device_context_copy_sub_resource_region(ptr ptr long long long long ptr long ptr long)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index d08c523bd9f..4e3be01ed5a 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3355,7 +3355,7 @@ struct wined3d_adapter_ops
void (*adapter_dispatch_compute)(struct wined3d_device *device, const struct wined3d_state *state,
const struct wined3d_dispatch_parameters *parameters);
void (*adapter_clear_uav)(struct wined3d_context *context,
- struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value);
+ struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value, bool fp);
void (*adapter_generate_mipmap)(struct wined3d_context *context, struct wined3d_shader_resource_view *view);
};
@@ -4735,8 +4735,8 @@ void wined3d_cs_emit_add_dirty_texture_region(struct wined3d_cs *cs,
struct wined3d_texture *texture, unsigned int layer) DECLSPEC_HIDDEN;
void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects,
DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN;
-void wined3d_device_context_emit_clear_uav_uint(struct wined3d_device_context *context,
- struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value) DECLSPEC_HIDDEN;
+void wined3d_device_context_emit_clear_uav(struct wined3d_device_context *context,
+ struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value, bool fp) DECLSPEC_HIDDEN;
void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain, const RECT *src_rect,
const RECT *dst_rect, HWND dst_window_override, unsigned int swap_interval, DWORD flags) DECLSPEC_HIDDEN;
@@ -5168,8 +5168,8 @@ static inline struct wined3d_unordered_access_view_gl *wined3d_unordered_access_
return CONTAINING_RECORD(view, struct wined3d_unordered_access_view_gl, v);
}
-void wined3d_unordered_access_view_gl_clear_uint(struct wined3d_unordered_access_view_gl *view_gl,
- const struct wined3d_uvec4 *clear_value, struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN;
+void wined3d_unordered_access_view_gl_clear(struct wined3d_unordered_access_view_gl *view_gl,
+ const struct wined3d_uvec4 *clear_value, struct wined3d_context_gl *context_gl, bool fp) DECLSPEC_HIDDEN;
HRESULT wined3d_unordered_access_view_gl_init(struct wined3d_unordered_access_view_gl *view_gl,
const struct wined3d_view_desc *desc, struct wined3d_resource *resource,
void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
@@ -5197,8 +5197,8 @@ static inline void wined3d_unordered_access_view_vk_barrier(struct wined3d_unord
wined3d_resource_vk_barrier(uav_vk->v.resource, context_vk, bind_mask);
}
-void wined3d_unordered_access_view_vk_clear_uint(struct wined3d_unordered_access_view_vk *view_vk,
- const struct wined3d_uvec4 *clear_value, struct wined3d_context_vk *context_vk) DECLSPEC_HIDDEN;
+void wined3d_unordered_access_view_vk_clear(struct wined3d_unordered_access_view_vk *view_vk,
+ const struct wined3d_uvec4 *clear_value, struct wined3d_context_vk *context_vk, bool fp) DECLSPEC_HIDDEN;
HRESULT wined3d_unordered_access_view_vk_init(struct wined3d_unordered_access_view_vk *view_vk,
const struct wined3d_view_desc *desc, struct wined3d_resource *resource,
void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 7133280a724..53ae13b7df5 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2422,6 +2422,8 @@ HRESULT __cdecl wined3d_device_context_blt(struct wined3d_device_context *contex
HRESULT __cdecl wined3d_device_context_clear_rendertarget_view(struct wined3d_device_context *context,
struct wined3d_rendertarget_view *view, const RECT *rect, unsigned int flags,
const struct wined3d_color *color, float depth, unsigned int stencil);
+void __cdecl wined3d_device_context_clear_uav_float(struct wined3d_device_context *context,
+ struct wined3d_unordered_access_view *view, const struct wined3d_vec4 *clear_value);
void __cdecl wined3d_device_context_clear_uav_uint(struct wined3d_device_context *context,
struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value);
void __cdecl wined3d_device_context_copy_resource(struct wined3d_device_context *context,
--
2.20.1
2
1
[PATCH 3/6] wined3d: Implement OpenGL image UAV clears using ARB_clear_texture.
by Henri Verbeet 07 Jun '21
by Henri Verbeet 07 Jun '21
07 Jun '21
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/d3d11/tests/d3d11.c | 24 ++++-----
dlls/wined3d/utils.c | 12 +++++
dlls/wined3d/view.c | 95 ++++++++++++++++++++++++++++++----
dlls/wined3d/wined3d_private.h | 1 +
4 files changed, 110 insertions(+), 22 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 217b4870e53..f729a38b4c2 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -16456,26 +16456,26 @@ static void test_clear_image_unordered_access_view(void)
tests[] =
{
/* Test clearing a specific mip level. */
- {DXGI_FORMAT_R32_FLOAT, 2, 1, 0, 0, 1, {1, 0, 0, 0}, 0x00000001, FALSE, 0, TRUE},
- {DXGI_FORMAT_R32_FLOAT, 2, 1, 1, 0, 1, {1, 0, 0, 0}, 0x00000001, FALSE, 0, TRUE},
+ {DXGI_FORMAT_R32_FLOAT, 2, 1, 0, 0, 1, {1, 0, 0, 0}, 0x00000001},
+ {DXGI_FORMAT_R32_FLOAT, 2, 1, 1, 0, 1, {1, 0, 0, 0}, 0x00000001},
{DXGI_FORMAT_R32_FLOAT, 2, 1, 0, 0, 1, {0x3f000000, 0, 0, 0}, 0x3f000000, TRUE, 0, TRUE},
{DXGI_FORMAT_R32_FLOAT, 2, 1, 1, 0, 1, {0x3f000000, 0, 0, 0}, 0x3f000000, TRUE, 0, TRUE},
/* Test clearing specific array layers. */
- {DXGI_FORMAT_R32_FLOAT, 1, IMAGE_SIZE, 0, 0, IMAGE_SIZE, {1, 0, 0, 0}, 0x00000001, FALSE, 0, TRUE},
- {DXGI_FORMAT_R32_FLOAT, 1, IMAGE_SIZE, 0, 3, 2, {1, 0, 0, 0}, 0x00000001, FALSE, 0, TRUE},
+ {DXGI_FORMAT_R32_FLOAT, 1, IMAGE_SIZE, 0, 0, IMAGE_SIZE, {1, 0, 0, 0}, 0x00000001},
+ {DXGI_FORMAT_R32_FLOAT, 1, IMAGE_SIZE, 0, 3, 2, {1, 0, 0, 0}, 0x00000001},
{DXGI_FORMAT_R32_FLOAT, 1, IMAGE_SIZE, 0, 0, IMAGE_SIZE,
{0x3f000000, 0, 0, 0}, 0x3f000000, TRUE, 0, TRUE},
{DXGI_FORMAT_R32_FLOAT, 1, IMAGE_SIZE, 0, 3, 2,
{0x3f000000, 0, 0, 0}, 0x3f000000, TRUE, 0, TRUE},
/* Test uint clears with formats. */
- {DXGI_FORMAT_R16G16_UINT, 1, 1, 0, 0, 1, {1, 2, 3, 4}, 0x00020001, FALSE, 0, TRUE},
- {DXGI_FORMAT_R16G16_UINT, 1, 1, 0, 0, 1, {0x12345, 0, 0, 0}, 0x00002345, FALSE, 0x0000ffff, TRUE},
- {DXGI_FORMAT_R16G16_UNORM, 1, 1, 0, 0, 1, {1, 2, 3, 4}, 0x00020001, FALSE, 0, TRUE},
- {DXGI_FORMAT_R16G16_FLOAT, 1, 1, 0, 0, 1, {1, 2, 3, 4}, 0x00020001, FALSE, 0, TRUE},
- {DXGI_FORMAT_R8G8B8A8_UINT, 1, 1, 0, 0, 1, {1, 2, 3, 4}, 0x04030201, FALSE, 0, TRUE},
- {DXGI_FORMAT_R8G8B8A8_UINT, 1, 1, 0, 0, 1, {0x123, 0, 0, 0}, 0x00000023, FALSE, 0x000000ff, TRUE},
- {DXGI_FORMAT_R8G8B8A8_UNORM, 1, 1, 0, 0, 1, {1, 2, 3, 4}, 0x04030201, FALSE, 0, TRUE},
- {DXGI_FORMAT_R11G11B10_FLOAT, 1, 1, 0, 0, 1, {1, 2, 3, 4}, 0x00c01001, FALSE, 0, TRUE},
+ {DXGI_FORMAT_R16G16_UINT, 1, 1, 0, 0, 1, {1, 2, 3, 4}, 0x00020001},
+ {DXGI_FORMAT_R16G16_UINT, 1, 1, 0, 0, 1, {0x12345, 0, 0, 0}, 0x00002345, FALSE, 0x0000ffff},
+ {DXGI_FORMAT_R16G16_UNORM, 1, 1, 0, 0, 1, {1, 2, 3, 4}, 0x00020001},
+ {DXGI_FORMAT_R16G16_FLOAT, 1, 1, 0, 0, 1, {1, 2, 3, 4}, 0x00020001},
+ {DXGI_FORMAT_R8G8B8A8_UINT, 1, 1, 0, 0, 1, {1, 2, 3, 4}, 0x04030201},
+ {DXGI_FORMAT_R8G8B8A8_UINT, 1, 1, 0, 0, 1, {0x123, 0, 0, 0}, 0x00000023, FALSE, 0x000000ff},
+ {DXGI_FORMAT_R8G8B8A8_UNORM, 1, 1, 0, 0, 1, {1, 2, 3, 4}, 0x04030201},
+ {DXGI_FORMAT_R11G11B10_FLOAT, 1, 1, 0, 0, 1, {1, 2, 3, 4}, 0x00c01001},
/* Test float clears with formats. */
{DXGI_FORMAT_R16G16_UNORM, 1, 1, 0, 0, 1,
{0x3f000000 /* 0.5f */, 0x3f800000 /* 1.0f */, 0, 0}, 0xffff8000, TRUE, 0, TRUE},
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 8eacc52ee2c..6e388e66862 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -5803,6 +5803,18 @@ BOOL wined3d_get_primary_adapter_luid(LUID *luid)
return TRUE;
}
+uint32_t wined3d_format_pack(const struct wined3d_format *format, const struct wined3d_uvec4 *value)
+{
+ uint32_t p = 0;
+
+ p |= (value->x & wined3d_mask_from_size(format->red_size)) << format->red_offset;
+ p |= (value->y & wined3d_mask_from_size(format->green_size)) << format->green_offset;
+ p |= (value->z & wined3d_mask_from_size(format->blue_size)) << format->blue_offset;
+ p |= (value->w & wined3d_mask_from_size(format->alpha_size)) << format->alpha_offset;
+
+ return p;
+}
+
/* Note: It's the caller's responsibility to ensure values can be expressed
* in the requested format. UNORM formats for example can only express values
* in the range 0.0f -> 1.0f. */
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
index 03abaf57102..2d2622e1191 100644
--- a/dlls/wined3d/view.c
+++ b/dlls/wined3d/view.c
@@ -1450,7 +1450,7 @@ void wined3d_unordered_access_view_gl_clear_uint(struct wined3d_unordered_access
const struct wined3d_uvec4 *clear_value, struct wined3d_context_gl *context_gl)
{
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
- const struct wined3d_format_gl *format;
+ const struct wined3d_format_gl *format_gl;
struct wined3d_buffer_gl *buffer_gl;
struct wined3d_resource *resource;
unsigned int offset, size;
@@ -1458,7 +1458,82 @@ void wined3d_unordered_access_view_gl_clear_uint(struct wined3d_unordered_access
resource = view_gl->v.resource;
if (resource->type != WINED3D_RTYPE_BUFFER)
{
- FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(resource->type));
+ unsigned int layer_count, level_count, base_level, base_layer;
+ unsigned int sub_resource_idx, width, height, depth, i, j;
+ struct wined3d_texture_gl *texture_gl;
+ const void *data = clear_value;
+ GLenum gl_format, gl_type;
+ uint32_t packed;
+
+ if (!gl_info->supported[ARB_CLEAR_TEXTURE])
+ {
+ FIXME("OpenGL implementation does not support ARB_clear_texture.\n");
+ return;
+ }
+
+ format_gl = wined3d_format_gl(resource->format);
+ texture_gl = wined3d_texture_gl(texture_from_resource(resource));
+ layer_count = view_gl->v.desc.u.texture.layer_count;
+ level_count = view_gl->v.desc.u.texture.level_count;
+ base_layer = view_gl->v.desc.u.texture.layer_idx;
+ base_level = view_gl->v.desc.u.texture.level_idx;
+
+ if (format_gl->f.byte_count <= 4)
+ {
+ gl_format = format_gl->format;
+ gl_type = format_gl->type;
+ packed = wined3d_format_pack(&format_gl->f, clear_value);
+ data = &packed;
+ }
+ else if (resource->format_flags & WINED3DFMT_FLAG_INTEGER)
+ {
+ gl_format = GL_RGBA_INTEGER;
+ gl_type = GL_UNSIGNED_INT;
+ }
+ else
+ {
+ gl_format = GL_RGBA;
+ gl_type = GL_FLOAT;
+ }
+
+ for (i = 0; i < layer_count; ++i)
+ {
+ for (j = 0; j < level_count; ++j)
+ {
+ sub_resource_idx = (base_layer + i) * texture_gl->t.level_count + base_level + j;
+ wined3d_texture_prepare_location(&texture_gl->t, sub_resource_idx,
+ &context_gl->c, WINED3D_LOCATION_TEXTURE_RGB);
+
+ width = wined3d_texture_get_level_width(&texture_gl->t, base_level + j);
+ height = wined3d_texture_get_level_height(&texture_gl->t, base_level + j);
+ depth = wined3d_texture_get_level_depth(&texture_gl->t, base_level + j);
+
+ switch (texture_gl->target)
+ {
+ case GL_TEXTURE_1D_ARRAY:
+ GL_EXTCALL(glClearTexSubImage(texture_gl->texture_rgb.name, base_level + j,
+ 0, base_layer + i, 0, width, 1, 1, gl_format, gl_type, data));
+ break;
+
+ case GL_TEXTURE_2D_ARRAY:
+ case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
+ case GL_TEXTURE_CUBE_MAP:
+ case GL_TEXTURE_CUBE_MAP_ARRAY:
+ GL_EXTCALL(glClearTexSubImage(texture_gl->texture_rgb.name, base_level + j,
+ 0, 0, base_layer + i, width, height, 1, gl_format, gl_type, data));
+ break;
+
+ default:
+ GL_EXTCALL(glClearTexSubImage(texture_gl->texture_rgb.name, base_level + j,
+ 0, 0, 0, width, height, depth, gl_format, gl_type, data));
+ break;
+ }
+
+ wined3d_texture_validate_location(&texture_gl->t, sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB);
+ wined3d_texture_invalidate_location(&texture_gl->t, sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB);
+ }
+ }
+
return;
}
@@ -1468,12 +1543,12 @@ void wined3d_unordered_access_view_gl_clear_uint(struct wined3d_unordered_access
return;
}
- format = wined3d_format_gl(view_gl->v.format);
- if (format->f.id != WINED3DFMT_R32_UINT && format->f.id != WINED3DFMT_R32_SINT
- && format->f.id != WINED3DFMT_R32G32B32A32_UINT
- && format->f.id != WINED3DFMT_R32G32B32A32_SINT)
+ format_gl = wined3d_format_gl(view_gl->v.format);
+ if (format_gl->f.id != WINED3DFMT_R32_UINT && format_gl->f.id != WINED3DFMT_R32_SINT
+ && format_gl->f.id != WINED3DFMT_R32G32B32A32_UINT
+ && format_gl->f.id != WINED3DFMT_R32G32B32A32_SINT)
{
- FIXME("Not implemented for format %s.\n", debug_d3dformat(format->f.id));
+ FIXME("Not implemented for format %s.\n", debug_d3dformat(format_gl->f.id));
return;
}
@@ -1481,10 +1556,10 @@ void wined3d_unordered_access_view_gl_clear_uint(struct wined3d_unordered_access
wined3d_buffer_load_location(&buffer_gl->b, &context_gl->c, WINED3D_LOCATION_BUFFER);
wined3d_unordered_access_view_invalidate_location(&view_gl->v, ~WINED3D_LOCATION_BUFFER);
- get_buffer_view_range(&buffer_gl->b, &view_gl->v.desc, &format->f, &offset, &size);
+ get_buffer_view_range(&buffer_gl->b, &view_gl->v.desc, &format_gl->f, &offset, &size);
wined3d_context_gl_bind_bo(context_gl, buffer_gl->bo.binding, buffer_gl->bo.id);
- GL_EXTCALL(glClearBufferSubData(buffer_gl->bo.binding, format->internal,
- offset, size, format->format, format->type, clear_value));
+ GL_EXTCALL(glClearBufferSubData(buffer_gl->bo.binding, format_gl->internal,
+ offset, size, format_gl->format, format_gl->type, clear_value));
wined3d_context_gl_reference_bo(context_gl, &buffer_gl->bo);
checkGLcall("clear unordered access view");
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 6d41f02e842..d08c523bd9f 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -5818,6 +5818,7 @@ BOOL wined3d_format_is_depth_view(enum wined3d_format_id resource_format_id,
enum wined3d_format_id view_format_id) DECLSPEC_HIDDEN;
const struct wined3d_color_key_conversion * wined3d_format_get_color_key_conversion(
const struct wined3d_texture *texture, BOOL need_alpha_ck) DECLSPEC_HIDDEN;
+uint32_t wined3d_format_pack(const struct wined3d_format *format, const struct wined3d_uvec4 *value) DECLSPEC_HIDDEN;
BOOL wined3d_formats_are_srgb_variants(enum wined3d_format_id format1,
enum wined3d_format_id format2) DECLSPEC_HIDDEN;
--
2.20.1
2
1
Ported from the similar Direct3D 12 test in vkd3d.
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/d3d11/tests/d3d11.c | 329 +++++++++++++++++++++++++++++++++++++++
1 file changed, 329 insertions(+)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index fc0da439173..217b4870e53 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -102,6 +102,22 @@ struct device_desc
UINT flags;
};
+struct resource_desc
+{
+ D3D11_RESOURCE_DIMENSION dimension;
+ unsigned int width;
+ unsigned int height;
+ unsigned int depth_or_array_size;
+ unsigned int level_count;
+ DXGI_FORMAT format;
+ DXGI_SAMPLE_DESC sample_desc;
+ D3D11_USAGE usage;
+ unsigned int bind_flags;
+ unsigned int cpu_access_flags;
+ unsigned int misc_flags;
+ unsigned int structure_byte_stride;
+};
+
struct swapchain_desc
{
BOOL windowed;
@@ -771,6 +787,66 @@ static ID3D11Buffer *create_buffer_(unsigned int line, ID3D11Device *device,
return buffer;
}
+static HRESULT create_resource(ID3D11Device *device, const struct resource_desc *desc,
+ const D3D11_SUBRESOURCE_DATA *data, ID3D11Resource **resource)
+{
+ D3D11_TEXTURE1D_DESC texture1d_desc;
+ D3D11_TEXTURE2D_DESC texture2d_desc;
+ D3D11_TEXTURE3D_DESC texture3d_desc;
+ D3D11_BUFFER_DESC buffer_desc;
+
+ switch (desc->dimension)
+ {
+ case D3D11_RESOURCE_DIMENSION_BUFFER:
+ buffer_desc.ByteWidth = desc->width;
+ buffer_desc.Usage = desc->usage;
+ buffer_desc.BindFlags = desc->bind_flags;
+ buffer_desc.CPUAccessFlags = desc->cpu_access_flags;
+ buffer_desc.MiscFlags = desc->misc_flags;
+ buffer_desc.StructureByteStride = desc->structure_byte_stride;
+ return ID3D11Device_CreateBuffer(device, &buffer_desc, data, (ID3D11Buffer **)resource);
+
+ case D3D11_RESOURCE_DIMENSION_TEXTURE1D:
+ texture1d_desc.Width = desc->width;
+ texture1d_desc.MipLevels = desc->level_count;
+ texture1d_desc.ArraySize = desc->depth_or_array_size;
+ texture1d_desc.Format = desc->format;
+ texture1d_desc.Usage = desc->usage;
+ texture1d_desc.BindFlags = desc->bind_flags;
+ texture1d_desc.CPUAccessFlags = desc->cpu_access_flags;
+ texture1d_desc.MiscFlags = desc->misc_flags;
+ return ID3D11Device_CreateTexture1D(device, &texture1d_desc, data, (ID3D11Texture1D **)resource);
+
+ case D3D11_RESOURCE_DIMENSION_TEXTURE2D:
+ texture2d_desc.Width = desc->width;
+ texture2d_desc.Height = desc->height;
+ texture2d_desc.MipLevels = desc->level_count;
+ texture2d_desc.ArraySize = desc->depth_or_array_size;
+ texture2d_desc.Format = desc->format;
+ texture2d_desc.SampleDesc = desc->sample_desc;
+ texture2d_desc.Usage = desc->usage;
+ texture2d_desc.BindFlags = desc->bind_flags;
+ texture2d_desc.CPUAccessFlags = desc->cpu_access_flags;
+ texture2d_desc.MiscFlags = desc->misc_flags;
+ return ID3D11Device_CreateTexture2D(device, &texture2d_desc, data, (ID3D11Texture2D **)resource);
+
+ case D3D11_RESOURCE_DIMENSION_TEXTURE3D:
+ texture3d_desc.Width = desc->width;
+ texture3d_desc.Height = desc->height;
+ texture3d_desc.Depth = desc->depth_or_array_size;
+ texture3d_desc.MipLevels = desc->level_count;
+ texture3d_desc.Format = desc->format;
+ texture3d_desc.Usage = desc->usage;
+ texture3d_desc.BindFlags = desc->bind_flags;
+ texture3d_desc.CPUAccessFlags = desc->cpu_access_flags;
+ texture3d_desc.MiscFlags = desc->misc_flags;
+ return ID3D11Device_CreateTexture3D(device, &texture3d_desc, data, (ID3D11Texture3D **)resource);
+
+ default:
+ return E_INVALIDARG;
+ }
+}
+
struct resource_readback
{
ID3D11Resource *resource;
@@ -936,6 +1012,36 @@ static void get_texture3d_readback(ID3D11Texture3D *texture, unsigned int sub_re
ID3D11Device_Release(device);
}
+static void get_resource_readback(ID3D11Resource *resource,
+ unsigned int sub_resource_idx, struct resource_readback *rb)
+{
+ D3D11_RESOURCE_DIMENSION d;
+
+ ID3D11Resource_GetType(resource, &d);
+ switch (d)
+ {
+ case D3D11_RESOURCE_DIMENSION_BUFFER:
+ get_buffer_readback((ID3D11Buffer *)resource, rb);
+ return;
+
+ case D3D11_RESOURCE_DIMENSION_TEXTURE1D:
+ get_texture1d_readback((ID3D11Texture1D *)resource, sub_resource_idx, rb);
+ return;
+
+ case D3D11_RESOURCE_DIMENSION_TEXTURE2D:
+ get_texture_readback((ID3D11Texture2D *)resource, sub_resource_idx, rb);
+ return;
+
+ case D3D11_RESOURCE_DIMENSION_TEXTURE3D:
+ get_texture3d_readback((ID3D11Texture3D *)resource, sub_resource_idx, rb);
+ return;
+
+ default:
+ memset(rb, 0, sizeof(*rb));
+ return;
+ }
+}
+
static void *get_readback_data(struct resource_readback *rb,
unsigned int x, unsigned int y, unsigned int z, unsigned byte_width)
{
@@ -16314,6 +16420,228 @@ static void test_clear_buffer_unordered_access_view(void)
ok(!refcount, "Device has %u references left.\n", refcount);
}
+static void test_clear_image_unordered_access_view(void)
+{
+ unsigned int expected_colour, actual_colour;
+ D3D11_UNORDERED_ACCESS_VIEW_DESC uav_desc;
+ unsigned int i, j, d, p, x, y, z, layer;
+ struct d3d11_test_context test_context;
+ unsigned int image_size, image_depth;
+ struct resource_desc resource_desc;
+ ID3D11UnorderedAccessView *uav[2];
+ ID3D11DeviceContext *context;
+ struct resource_readback rb;
+ BOOL is_small_float_format;
+ ID3D11Resource *resource;
+ BOOL is_inside, success;
+ ID3D11Device *device;
+ UINT clear_value[4];
+ HRESULT hr;
+
+#define IMAGE_SIZE 16
+ static const struct
+ {
+ DXGI_FORMAT format;
+ unsigned int image_mips;
+ unsigned int image_layers;
+ unsigned int mip_level;
+ unsigned int first_layer;
+ unsigned int layer_count;
+ unsigned int values[4];
+ unsigned int expected;
+ BOOL is_float;
+ unsigned int clamped;
+ BOOL is_todo;
+ }
+ tests[] =
+ {
+ /* Test clearing a specific mip level. */
+ {DXGI_FORMAT_R32_FLOAT, 2, 1, 0, 0, 1, {1, 0, 0, 0}, 0x00000001, FALSE, 0, TRUE},
+ {DXGI_FORMAT_R32_FLOAT, 2, 1, 1, 0, 1, {1, 0, 0, 0}, 0x00000001, FALSE, 0, TRUE},
+ {DXGI_FORMAT_R32_FLOAT, 2, 1, 0, 0, 1, {0x3f000000, 0, 0, 0}, 0x3f000000, TRUE, 0, TRUE},
+ {DXGI_FORMAT_R32_FLOAT, 2, 1, 1, 0, 1, {0x3f000000, 0, 0, 0}, 0x3f000000, TRUE, 0, TRUE},
+ /* Test clearing specific array layers. */
+ {DXGI_FORMAT_R32_FLOAT, 1, IMAGE_SIZE, 0, 0, IMAGE_SIZE, {1, 0, 0, 0}, 0x00000001, FALSE, 0, TRUE},
+ {DXGI_FORMAT_R32_FLOAT, 1, IMAGE_SIZE, 0, 3, 2, {1, 0, 0, 0}, 0x00000001, FALSE, 0, TRUE},
+ {DXGI_FORMAT_R32_FLOAT, 1, IMAGE_SIZE, 0, 0, IMAGE_SIZE,
+ {0x3f000000, 0, 0, 0}, 0x3f000000, TRUE, 0, TRUE},
+ {DXGI_FORMAT_R32_FLOAT, 1, IMAGE_SIZE, 0, 3, 2,
+ {0x3f000000, 0, 0, 0}, 0x3f000000, TRUE, 0, TRUE},
+ /* Test uint clears with formats. */
+ {DXGI_FORMAT_R16G16_UINT, 1, 1, 0, 0, 1, {1, 2, 3, 4}, 0x00020001, FALSE, 0, TRUE},
+ {DXGI_FORMAT_R16G16_UINT, 1, 1, 0, 0, 1, {0x12345, 0, 0, 0}, 0x00002345, FALSE, 0x0000ffff, TRUE},
+ {DXGI_FORMAT_R16G16_UNORM, 1, 1, 0, 0, 1, {1, 2, 3, 4}, 0x00020001, FALSE, 0, TRUE},
+ {DXGI_FORMAT_R16G16_FLOAT, 1, 1, 0, 0, 1, {1, 2, 3, 4}, 0x00020001, FALSE, 0, TRUE},
+ {DXGI_FORMAT_R8G8B8A8_UINT, 1, 1, 0, 0, 1, {1, 2, 3, 4}, 0x04030201, FALSE, 0, TRUE},
+ {DXGI_FORMAT_R8G8B8A8_UINT, 1, 1, 0, 0, 1, {0x123, 0, 0, 0}, 0x00000023, FALSE, 0x000000ff, TRUE},
+ {DXGI_FORMAT_R8G8B8A8_UNORM, 1, 1, 0, 0, 1, {1, 2, 3, 4}, 0x04030201, FALSE, 0, TRUE},
+ {DXGI_FORMAT_R11G11B10_FLOAT, 1, 1, 0, 0, 1, {1, 2, 3, 4}, 0x00c01001, FALSE, 0, TRUE},
+ /* Test float clears with formats. */
+ {DXGI_FORMAT_R16G16_UNORM, 1, 1, 0, 0, 1,
+ {0x3f000000 /* 0.5f */, 0x3f800000 /* 1.0f */, 0, 0}, 0xffff8000, TRUE, 0, TRUE},
+ {DXGI_FORMAT_R16G16_FLOAT, 1, 1, 0, 0, 1,
+ {0x3f000000 /* 0.5f */, 0x3f800000 /* 1.0f */, 0, 0}, 0x3c003800, TRUE, 0, TRUE},
+ {DXGI_FORMAT_R8G8B8A8_UNORM, 1, 1, 0, 0, 1,
+ {0x3f000000 /* 0.5f */, 0x3f800000 /* 1.0f */, 0, 0}, 0x0000ff80, TRUE, 0, TRUE},
+ {DXGI_FORMAT_R8G8B8A8_UNORM, 1, 1, 0, 0, 1,
+ {0, 0, 0x3f000000 /* 0.5f */, 0x3f800000 /* 1.0f */}, 0xff800000, TRUE, 0, TRUE},
+ {DXGI_FORMAT_R11G11B10_FLOAT, 1, 1, 0, 0, 1,
+ {0x3f000000 /* 1.0f */, 0 /* 0.0f */, 0xbf800000 /* -1.0f */, 0x3f000000 /* 1.0f */},
+ 0x00000380, TRUE, 0, TRUE},
+ };
+
+ static const struct
+ {
+ D3D11_RESOURCE_DIMENSION resource_dim;
+ D3D11_UAV_DIMENSION view_dim;
+ BOOL is_layered;
+ }
+ uav_dimensions[] =
+ {
+ {D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3D11_UAV_DIMENSION_TEXTURE2D, FALSE},
+ {D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3D11_UAV_DIMENSION_TEXTURE2DARRAY, TRUE },
+ /* Expected behaviour with partial layer coverage is unclear. */
+ {D3D11_RESOURCE_DIMENSION_TEXTURE3D, D3D11_UAV_DIMENSION_TEXTURE3D, FALSE},
+ };
+
+ if (!init_test_context(&test_context, NULL))
+ return;
+ device = test_context.device;
+ context = test_context.immediate_context;
+
+ memset(&resource_desc, 0, sizeof(resource_desc));
+ resource_desc.width = IMAGE_SIZE;
+ resource_desc.height = IMAGE_SIZE;
+ resource_desc.sample_desc.Count = 1;
+ resource_desc.usage = D3D11_USAGE_DEFAULT;
+ resource_desc.bind_flags = D3D11_BIND_UNORDERED_ACCESS;
+
+ for (d = 0; d < ARRAY_SIZE(uav_dimensions); ++d)
+ {
+ for (i = 0; i < ARRAY_SIZE(tests); ++i)
+ {
+ winetest_push_context("Dim %u, Test %u", d, i);
+
+ if (tests[i].image_layers > 1 && !uav_dimensions[d].is_layered)
+ {
+ winetest_pop_context();
+ continue;
+ }
+
+ resource_desc.dimension = uav_dimensions[d].resource_dim;
+ resource_desc.depth_or_array_size = tests[i].image_layers;
+ resource_desc.level_count = tests[i].image_mips;
+ resource_desc.format = tests[i].format;
+ if (FAILED(hr = create_resource(device, &resource_desc, NULL, &resource)))
+ {
+ skip("Failed to create resource, hr %#x.\n", hr);
+ winetest_pop_context();
+ continue;
+ }
+
+ uav_desc.Format = tests[i].format;
+ uav_desc.ViewDimension = uav_dimensions[d].view_dim;
+
+ for (j = 0; j < 2; ++j)
+ {
+ unsigned int first_layer = j ? 0 : tests[i].first_layer;
+ unsigned int layer_count = j ? tests[i].image_layers : tests[i].layer_count;
+
+ switch (uav_desc.ViewDimension)
+ {
+ case D3D11_UAV_DIMENSION_TEXTURE2D:
+ uav_desc.Texture2D.MipSlice = tests[i].mip_level;
+ break;
+
+ case D3D11_UAV_DIMENSION_TEXTURE2DARRAY:
+ uav_desc.Texture2DArray.MipSlice = tests[i].mip_level;
+ uav_desc.Texture2DArray.FirstArraySlice = first_layer;
+ uav_desc.Texture2DArray.ArraySize = layer_count;
+ break;
+
+ case D3D11_UAV_DIMENSION_TEXTURE3D:
+ uav_desc.Texture3D.MipSlice = tests[i].mip_level;
+ uav_desc.Texture3D.FirstWSlice = first_layer;
+ uav_desc.Texture3D.WSize = layer_count;
+ break;
+
+ default:
+ ok(0, "Unhandled uav dimension %#x.\n", uav_dimensions[d].view_dim);
+ break;
+ }
+
+ hr = ID3D11Device_CreateUnorderedAccessView(device, resource, &uav_desc, &uav[j]);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ }
+
+ for (j = 0; j < 4; ++j)
+ {
+ clear_value[j] = tests[i].expected ? 0u : ~0u;
+ }
+
+ ID3D11DeviceContext_ClearUnorderedAccessViewUint(context, uav[1], clear_value);
+ if (tests[i].is_float)
+ ID3D11DeviceContext_ClearUnorderedAccessViewFloat(context, uav[0], (const float *)tests[i].values);
+ else
+ ID3D11DeviceContext_ClearUnorderedAccessViewUint(context, uav[0], tests[i].values);
+
+ image_depth = uav_dimensions[d].resource_dim == D3D11_RESOURCE_DIMENSION_TEXTURE3D
+ ? max(tests[i].image_layers >> tests[i].mip_level, 1u) : 1;
+ image_size = max(IMAGE_SIZE >> tests[i].mip_level, 1u);
+
+ is_small_float_format = tests[i].format == DXGI_FORMAT_R16G16_UNORM
+ || tests[i].format == DXGI_FORMAT_R16G16_FLOAT
+ || tests[i].format == DXGI_FORMAT_R11G11B10_FLOAT
+ || tests[i].format == DXGI_FORMAT_R8G8B8A8_UNORM;
+ for (layer = 0; layer < tests[i].image_layers / image_depth; ++layer)
+ {
+ get_resource_readback(resource, tests[i].mip_level + (layer * tests[i].image_mips), &rb);
+
+ success = TRUE;
+ expected_colour = actual_colour = x = y = z = 0;
+ for (p = 0; p < image_depth * image_size * image_size; ++p)
+ {
+ x = p % image_size;
+ y = (p / image_size) % image_size;
+ z = p / (image_size * image_size);
+
+ if (uav_dimensions[d].resource_dim == D3D11_RESOURCE_DIMENSION_TEXTURE3D)
+ is_inside = z >= tests[i].first_layer
+ && z < tests[i].first_layer + tests[i].layer_count;
+ else
+ is_inside = layer >= tests[i].first_layer
+ && layer < tests[i].first_layer + tests[i].layer_count;
+
+ expected_colour = is_inside ? tests[i].expected : clear_value[0];
+ actual_colour = get_readback_u32(&rb, x, y, z);
+ if (!(success = compare_color(actual_colour, expected_colour, tests[i].is_float ? 1 : 0)
+ /* Some drivers/GPUs clamp clear values that can't
+ * be represented by the format. (Windows 7
+ * testbot, AMD PALM) */
+ || broken(is_inside && tests[i].clamped && actual_colour == tests[i].clamped)
+ /* Some drivers/GPUs mishandle integer clears of
+ * small float/normalised formats. (AMD PALM) */
+ || broken(is_inside && !tests[i].is_float && is_small_float_format && !actual_colour)))
+ break;
+ }
+ todo_wine_if(tests[i].is_todo && expected_colour)
+ ok(success, "At layer %u, (%u,%u,%u), expected 0x%08x, got 0x%08x.\n",
+ layer, x, y, z, expected_colour, actual_colour);
+
+ release_resource_readback(&rb);
+ }
+
+ ID3D11UnorderedAccessView_Release(uav[1]);
+ ID3D11UnorderedAccessView_Release(uav[0]);
+ ID3D11Resource_Release(resource);
+ winetest_pop_context();
+ }
+ }
+
+ release_test_context(&test_context);
+#undef IMAGE_SIZE
+}
+
static void test_initial_depth_stencil_state(void)
{
static const struct vec4 green = {0.0f, 1.0f, 0.0f, 1.0f};
@@ -33043,6 +33371,7 @@ START_TEST(d3d11)
queue_test(test_clear_render_target_view_3d);
queue_test(test_clear_depth_stencil_view);
queue_test(test_clear_buffer_unordered_access_view);
+ queue_test(test_clear_image_unordered_access_view);
queue_test(test_initial_depth_stencil_state);
queue_test(test_draw_depth_only);
queue_test(test_draw_uav_only);
--
2.20.1
2
1
Some games may not receive the DSBPN_OFFSETSTOP event and get stuck if CloseHandle is called immediately after IDirectSoundBuffer::Stop.
To solve this problem, IDirectSoundBuffer::Stop will immediately notify the DSBPN_OFFSETSTOP event.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=41292
Signed-off-by: Hiroki Awata <castaneai(a)by.black>
---
v3: removed dead code
---
dlls/dsound/buffer.c | 7 ++-----
dlls/dsound/mixer.c | 6 +-----
2 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/dlls/dsound/buffer.c b/dlls/dsound/buffer.c
index fafa6fc6015..dc3b54906ce 100644
--- a/dlls/dsound/buffer.c
+++ b/dlls/dsound/buffer.c
@@ -296,8 +296,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Play(IDirectSoundBuffer8 *iface, DW
if (This->state == STATE_STOPPED) {
This->leadin = TRUE;
This->state = STATE_STARTING;
- } else if (This->state == STATE_STOPPING)
- This->state = STATE_PLAYING;
+ }
for (i = 0; i < This->num_filters; i++) {
IMediaObject_Discontinuity(This->filters[i].obj, 0);
@@ -317,9 +316,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Stop(IDirectSoundBuffer8 *iface)
AcquireSRWLockExclusive(&This->lock);
- if (This->state == STATE_PLAYING)
- This->state = STATE_STOPPING;
- else if (This->state == STATE_STARTING)
+ if (This->state == STATE_PLAYING || This->state == STATE_STARTING)
{
This->state = STATE_STOPPED;
DSOUND_CheckEvent(This, 0, 0);
diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c
index a6402b09eff..124d1e4fba1 100644
--- a/dlls/dsound/mixer.c
+++ b/dlls/dsound/mixer.c
@@ -593,11 +593,7 @@ static void DSOUND_MixToPrimary(const DirectSoundDevice *device, float *mix_buff
if (dsb->buflen && dsb->state) {
TRACE("Checking %p, frames=%d\n", dsb, frames);
AcquireSRWLockShared(&dsb->lock);
- /* if buffer is stopping it is stopped now */
- if (dsb->state == STATE_STOPPING) {
- dsb->state = STATE_STOPPED;
- DSOUND_CheckEvent(dsb, 0, 0);
- } else if (dsb->state != STATE_STOPPED) {
+ if (dsb->state != STATE_STOPPED) {
/* if the buffer was starting, it must be playing now */
if (dsb->state == STATE_STARTING)
--
2.27.0
2
1
[PATCH 6/6] wined3d: Use the texture level count to calculate sub-resource indices for Vulkan mip-map generation.
by Henri Verbeet 07 Jun '21
by Henri Verbeet 07 Jun '21
07 Jun '21
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/view.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
index f9ba8430d08..91d26c05fae 100644
--- a/dlls/wined3d/view.c
+++ b/dlls/wined3d/view.c
@@ -1266,7 +1266,7 @@ void wined3d_shader_resource_view_gl_generate_mipmap(struct wined3d_shader_resou
void wined3d_shader_resource_view_vk_generate_mipmap(struct wined3d_shader_resource_view_vk *srv_vk,
struct wined3d_context_vk *context_vk)
{
- unsigned int i, j, layer_count, level_count, base_level, base_layer;
+ unsigned int i, j, layer_count, level_count, base_level, base_layer, sub_resource_idx;
const struct wined3d_vk_info *vk_info = context_vk->vk_info;
VkImageSubresourceRange vk_src_range, vk_dst_range;
struct wined3d_texture_vk *texture_vk;
@@ -1283,8 +1283,9 @@ void wined3d_shader_resource_view_vk_generate_mipmap(struct wined3d_shader_resou
texture_vk = wined3d_texture_vk(texture_from_resource(srv_vk->v.resource));
for (i = 0; i < layer_count; ++i)
{
- if (!wined3d_texture_load_location(&texture_vk->t,
- (base_layer + i) * level_count + base_level, &context_vk->c, WINED3D_LOCATION_TEXTURE_RGB))
+ sub_resource_idx = (base_layer + i) * texture_vk->t.level_count + base_level;
+ if (!wined3d_texture_load_location(&texture_vk->t, sub_resource_idx,
+ &context_vk->c, WINED3D_LOCATION_TEXTURE_RGB))
ERR("Failed to load source layer %u.\n", base_layer + i);
}
@@ -1393,10 +1394,9 @@ void wined3d_shader_resource_view_vk_generate_mipmap(struct wined3d_shader_resou
{
for (j = 1; j < level_count; ++j)
{
- wined3d_texture_validate_location(&texture_vk->t,
- (base_layer + i) * level_count + base_level + j, WINED3D_LOCATION_TEXTURE_RGB);
- wined3d_texture_invalidate_location(&texture_vk->t,
- (base_layer + i) * level_count + base_level + j, ~WINED3D_LOCATION_TEXTURE_RGB);
+ sub_resource_idx = (base_layer + i) * texture_vk->t.level_count + base_level + j;
+ wined3d_texture_validate_location(&texture_vk->t, sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB);
+ wined3d_texture_invalidate_location(&texture_vk->t, sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB);
}
}
--
2.20.1
1
0
[PATCH 5/6] wined3d: Use the texture level count to calculate sub-resource indices for OpenGL mip-map generation.
by Henri Verbeet 07 Jun '21
by Henri Verbeet 07 Jun '21
07 Jun '21
Instead of the view's level count, which may be different.
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/view.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
index cda16b690f8..f9ba8430d08 100644
--- a/dlls/wined3d/view.c
+++ b/dlls/wined3d/view.c
@@ -1197,7 +1197,7 @@ static void shader_resource_view_gl_bind_and_dirtify(struct wined3d_shader_resou
void wined3d_shader_resource_view_gl_generate_mipmap(struct wined3d_shader_resource_view_gl *view_gl,
struct wined3d_context_gl *context_gl)
{
- unsigned int i, j, layer_count, level_count, base_level, base_layer;
+ unsigned int i, j, layer_count, level_count, base_level, base_layer, sub_resource_idx;
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
struct wined3d_texture_gl *texture_gl;
struct gl_texture *gl_tex;
@@ -1216,8 +1216,8 @@ void wined3d_shader_resource_view_gl_generate_mipmap(struct wined3d_shader_resou
location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB;
for (i = 0; i < layer_count; ++i)
{
- if (!wined3d_texture_load_location(&texture_gl->t,
- (base_layer + i) * level_count + base_level, &context_gl->c, location))
+ sub_resource_idx = (base_layer + i) * texture_gl->t.level_count + base_level;
+ if (!wined3d_texture_load_location(&texture_gl->t, sub_resource_idx, &context_gl->c, location))
ERR("Failed to load source layer %u.\n", base_layer + i);
}
@@ -1249,10 +1249,9 @@ void wined3d_shader_resource_view_gl_generate_mipmap(struct wined3d_shader_resou
{
for (j = 1; j < level_count; ++j)
{
- wined3d_texture_validate_location(&texture_gl->t,
- (base_layer + i) * level_count + base_level + j, location);
- wined3d_texture_invalidate_location(&texture_gl->t,
- (base_layer + i) * level_count + base_level + j, ~location);
+ sub_resource_idx = (base_layer + i) * texture_gl->t.level_count + base_level + j;
+ wined3d_texture_validate_location(&texture_gl->t, sub_resource_idx, location);
+ wined3d_texture_invalidate_location(&texture_gl->t, sub_resource_idx, ~location);
}
}
--
2.20.1
1
0
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/surface.c | 8 ++++----
dlls/wined3d/utils.c | 10 +++++-----
dlls/wined3d/wined3d_private.h | 5 +++++
3 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index c5d7a7d9d55..8a4ca4f5781 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -36,11 +36,11 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_perf);
static const DWORD surface_simple_locations = WINED3D_LOCATION_SYSMEM | WINED3D_LOCATION_BUFFER;
/* Works correctly only for <= 4 bpp formats. */
-static void get_color_masks(const struct wined3d_format *format, DWORD *masks)
+static void get_color_masks(const struct wined3d_format *format, uint32_t *masks)
{
- masks[0] = ((1u << format->red_size) - 1) << format->red_offset;
- masks[1] = ((1u << format->green_size) - 1) << format->green_offset;
- masks[2] = ((1u << format->blue_size) - 1) << format->blue_offset;
+ masks[0] = wined3d_mask_from_size(format->red_size) << format->red_offset;
+ masks[1] = wined3d_mask_from_size(format->green_size) << format->green_offset;
+ masks[2] = wined3d_mask_from_size(format->blue_size) << format->blue_offset;
}
/* See also float_16_to_32() in wined3d_private.h */
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index b39fb46cadc..8eacc52ee2c 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -5902,7 +5902,7 @@ DWORD wined3d_format_convert_from_float(const struct wined3d_format *format, con
static float color_to_float(DWORD color, DWORD size, DWORD offset)
{
- DWORD mask = size < 32 ? (1u << size) - 1 : ~0u;
+ uint32_t mask = wined3d_mask_from_size(size);
if (!size)
return 1.0f;
@@ -5938,10 +5938,10 @@ void wined3d_format_get_float_color_key(const struct wined3d_format *format,
case WINED3DFMT_R8G8B8X8_UNORM:
case WINED3DFMT_R16G16_UNORM:
case WINED3DFMT_B10G10R10A2_UNORM:
- slop.r = 0.5f / ((1u << format->red_size) - 1);
- slop.g = 0.5f / ((1u << format->green_size) - 1);
- slop.b = 0.5f / ((1u << format->blue_size) - 1);
- slop.a = 0.5f / ((1u << format->alpha_size) - 1);
+ slop.r = 0.5f / wined3d_mask_from_size(format->red_size);
+ slop.g = 0.5f / wined3d_mask_from_size(format->green_size);
+ slop.b = 0.5f / wined3d_mask_from_size(format->blue_size);
+ slop.a = 0.5f / wined3d_mask_from_size(format->alpha_size);
float_colors[0].r = color_to_float(key->color_space_low_value, format->red_size, format->red_offset)
- slop.r;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index b0f8ea1bf93..6d41f02e842 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -5959,6 +5959,11 @@ static inline BOOL is_rasterization_disabled(const struct wined3d_shader *geomet
&& geometry_shader->u.gs.so_desc->rasterizer_stream_idx == WINED3D_NO_RASTERIZER_STREAM;
}
+static inline uint32_t wined3d_mask_from_size(unsigned int size)
+{
+ return size < 32 ? (1u << size) - 1 : ~0u;
+}
+
static inline DWORD wined3d_extract_bits(const DWORD *bitstream,
unsigned int offset, unsigned int count)
{
--
2.20.1
1
0
[PATCH 1/2] d2d1: Reset bitmap brush sampler state only if parameters have changed.
by Nikolay Sivov 07 Jun '21
by Nikolay Sivov 07 Jun '21
07 Jun '21
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/d2d1/brush.c | 37 +++++++++++++++++++++----------------
1 file changed, 21 insertions(+), 16 deletions(-)
diff --git a/dlls/d2d1/brush.c b/dlls/d2d1/brush.c
index 07d2e26a143..496a399aa6e 100644
--- a/dlls/d2d1/brush.c
+++ b/dlls/d2d1/brush.c
@@ -818,6 +818,15 @@ static inline struct d2d_brush *impl_from_ID2D1BitmapBrush1(ID2D1BitmapBrush1 *i
return CONTAINING_RECORD(iface, struct d2d_brush, ID2D1Brush_iface);
}
+static void d2d_bitmap_brush_reset_sampler_state(struct d2d_brush *brush)
+{
+ if (brush->u.bitmap.sampler_state)
+ {
+ ID3D10SamplerState_Release(brush->u.bitmap.sampler_state);
+ brush->u.bitmap.sampler_state = NULL;
+ }
+}
+
static HRESULT STDMETHODCALLTYPE d2d_bitmap_brush_QueryInterface(ID2D1BitmapBrush1 *iface,
REFIID iid, void **out)
{
@@ -923,11 +932,10 @@ static void STDMETHODCALLTYPE d2d_bitmap_brush_SetExtendModeX(ID2D1BitmapBrush1
TRACE("iface %p, mode %#x.\n", iface, mode);
- brush->u.bitmap.extend_mode_x = mode;
- if (brush->u.bitmap.sampler_state)
+ if (brush->u.bitmap.extend_mode_x != mode)
{
- ID3D10SamplerState_Release(brush->u.bitmap.sampler_state);
- brush->u.bitmap.sampler_state = NULL;
+ brush->u.bitmap.extend_mode_x = mode;
+ d2d_bitmap_brush_reset_sampler_state(brush);
}
}
@@ -937,11 +945,10 @@ static void STDMETHODCALLTYPE d2d_bitmap_brush_SetExtendModeY(ID2D1BitmapBrush1
TRACE("iface %p, mode %#x.\n", iface, mode);
- brush->u.bitmap.extend_mode_y = mode;
- if (brush->u.bitmap.sampler_state)
+ if (brush->u.bitmap.extend_mode_y != mode)
{
- ID3D10SamplerState_Release(brush->u.bitmap.sampler_state);
- brush->u.bitmap.sampler_state = NULL;
+ brush->u.bitmap.extend_mode_y = mode;
+ d2d_bitmap_brush_reset_sampler_state(brush);
}
}
@@ -962,11 +969,10 @@ static void STDMETHODCALLTYPE d2d_bitmap_brush_SetInterpolationMode(ID2D1BitmapB
return;
}
- brush->u.bitmap.interpolation_mode = d2d1_1_interp_mode_from_d2d1(mode);
- if (brush->u.bitmap.sampler_state)
+ if (brush->u.bitmap.interpolation_mode != d2d1_1_interp_mode_from_d2d1(mode))
{
- ID3D10SamplerState_Release(brush->u.bitmap.sampler_state);
- brush->u.bitmap.sampler_state = NULL;
+ brush->u.bitmap.interpolation_mode = d2d1_1_interp_mode_from_d2d1(mode);
+ d2d_bitmap_brush_reset_sampler_state(brush);
}
}
@@ -1050,11 +1056,10 @@ static void STDMETHODCALLTYPE d2d_bitmap_brush_SetInterpolationMode1(ID2D1Bitmap
return;
}
- brush->u.bitmap.interpolation_mode = mode;
- if (brush->u.bitmap.sampler_state)
+ if (brush->u.bitmap.interpolation_mode != mode)
{
- ID3D10SamplerState_Release(brush->u.bitmap.sampler_state);
- brush->u.bitmap.sampler_state = NULL;
+ brush->u.bitmap.interpolation_mode = mode;
+ d2d_bitmap_brush_reset_sampler_state(brush);
}
}
--
2.30.2
2
3
Signed-off-by: Derek Lesho <dlesho(a)codeweavers.com>
---
I decided to put the branching in the copy functions, as it there were too many variables involved in how to copy the secondary planes.
---
dlls/mfplat/buffer.c | 55 +++++++++++++++++++++++++++++++-------
dlls/mfplat/tests/mfplat.c | 42 ++++++++++++++++++++++++++++-
2 files changed, 86 insertions(+), 11 deletions(-)
diff --git a/dlls/mfplat/buffer.c b/dlls/mfplat/buffer.c
index e04cc1a9251..5830b1af4ff 100644
--- a/dlls/mfplat/buffer.c
+++ b/dlls/mfplat/buffer.c
@@ -32,6 +32,34 @@ WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
#define ALIGN_SIZE(size, alignment) (((size) + (alignment)) & ~((alignment)))
+static void copy_multiplane_image(BYTE *dest, LONG dest_stride, const BYTE *src, LONG src_stride, DWORD width, DWORD lines, unsigned int fourcc)
+{
+ MFCopyImage(dest, dest_stride, src, src_stride, width, lines);
+ dest += dest_stride * lines;
+ src += src_stride * lines;
+
+ switch (fourcc)
+ {
+ case MAKEFOURCC('N','V','1','2'):
+ MFCopyImage(dest, dest_stride, src, src_stride, width, lines / 2);
+ break;
+
+ case MAKEFOURCC('I','M','C','1'):
+ case MAKEFOURCC('I','M','C','3'):
+ MFCopyImage(dest, dest_stride, src, src_stride, width / 2, lines);
+ break;
+
+ case MAKEFOURCC('I','M','C','2'):
+ case MAKEFOURCC('I','M','C','4'):
+ MFCopyImage(dest, dest_stride, src, src_stride, width / 2, lines / 2);
+ MFCopyImage(dest + dest_stride / 2, dest_stride, src + src_stride / 2, src_stride, width / 2, lines / 2);
+ break;
+
+ default:
+ break;
+ }
+}
+
struct buffer
{
IMFMediaBuffer IMFMediaBuffer_iface;
@@ -54,6 +82,8 @@ struct buffer
unsigned int height;
int pitch;
+ unsigned int fourcc;
+
unsigned int locks;
} _2d;
struct
@@ -307,8 +337,8 @@ static HRESULT WINAPI memory_1d_2d_buffer_Unlock(IMFMediaBuffer *iface)
if (buffer->_2d.linear_buffer && !--buffer->_2d.locks)
{
- MFCopyImage(buffer->data, buffer->_2d.pitch, buffer->_2d.linear_buffer, buffer->_2d.width,
- buffer->_2d.width, buffer->_2d.height);
+ copy_multiplane_image(buffer->data, buffer->_2d.pitch, buffer->_2d.linear_buffer, buffer->_2d.width,
+ buffer->_2d.width, buffer->_2d.height, buffer->_2d.fourcc);
free(buffer->_2d.linear_buffer);
buffer->_2d.linear_buffer = NULL;
@@ -357,8 +387,8 @@ static HRESULT WINAPI d3d9_surface_buffer_Lock(IMFMediaBuffer *iface, BYTE **dat
hr = IDirect3DSurface9_LockRect(buffer->d3d9_surface.surface, &rect, NULL, 0);
if (SUCCEEDED(hr))
{
- MFCopyImage(buffer->_2d.linear_buffer, buffer->_2d.width, rect.pBits, rect.Pitch,
- buffer->_2d.width, buffer->_2d.height);
+ copy_multiplane_image(buffer->_2d.linear_buffer, buffer->_2d.width, rect.pBits, rect.Pitch,
+ buffer->_2d.width, buffer->_2d.height, buffer->_2d.fourcc);
IDirect3DSurface9_UnlockRect(buffer->d3d9_surface.surface);
}
}
@@ -396,8 +426,8 @@ static HRESULT WINAPI d3d9_surface_buffer_Unlock(IMFMediaBuffer *iface)
if (SUCCEEDED(hr = IDirect3DSurface9_LockRect(buffer->d3d9_surface.surface, &rect, NULL, 0)))
{
- MFCopyImage(rect.pBits, rect.Pitch, buffer->_2d.linear_buffer, buffer->_2d.width,
- buffer->_2d.width, buffer->_2d.height);
+ copy_multiplane_image(rect.pBits, rect.Pitch, buffer->_2d.linear_buffer, buffer->_2d.width,
+ buffer->_2d.width, buffer->_2d.height, buffer->_2d.fourcc);
IDirect3DSurface9_UnlockRect(buffer->d3d9_surface.surface);
}
@@ -936,8 +966,8 @@ static HRESULT WINAPI dxgi_surface_buffer_Lock(IMFMediaBuffer *iface, BYTE **dat
hr = dxgi_surface_buffer_map(buffer);
if (SUCCEEDED(hr))
{
- MFCopyImage(buffer->_2d.linear_buffer, buffer->_2d.width, buffer->dxgi_surface.map_desc.pData,
- buffer->dxgi_surface.map_desc.RowPitch, buffer->_2d.width, buffer->_2d.height);
+ copy_multiplane_image(buffer->_2d.linear_buffer, buffer->_2d.width, buffer->dxgi_surface.map_desc.pData,
+ buffer->dxgi_surface.map_desc.RowPitch, buffer->_2d.width, buffer->_2d.height, buffer->_2d.fourcc);
}
}
}
@@ -970,8 +1000,8 @@ static HRESULT WINAPI dxgi_surface_buffer_Unlock(IMFMediaBuffer *iface)
hr = HRESULT_FROM_WIN32(ERROR_WAS_UNLOCKED);
else if (!--buffer->_2d.locks)
{
- MFCopyImage(buffer->dxgi_surface.map_desc.pData, buffer->dxgi_surface.map_desc.RowPitch,
- buffer->_2d.linear_buffer, buffer->_2d.width, buffer->_2d.width, buffer->_2d.height);
+ copy_multiplane_image(buffer->dxgi_surface.map_desc.pData, buffer->dxgi_surface.map_desc.RowPitch,
+ buffer->_2d.linear_buffer, buffer->_2d.width, buffer->_2d.width, buffer->_2d.height, buffer->_2d.fourcc);
dxgi_surface_buffer_unmap(buffer);
free(buffer->_2d.linear_buffer);
@@ -1334,6 +1364,7 @@ static HRESULT create_2d_buffer(DWORD width, DWORD height, DWORD fourcc, BOOL bo
object->_2d.height = height;
object->_2d.pitch = bottom_up ? -pitch : pitch;
object->_2d.scanline0 = bottom_up ? object->data + pitch * (object->_2d.height - 1) : object->data;
+ object->_2d.fourcc = fourcc;
*buffer = &object->IMFMediaBuffer_iface;
@@ -1373,6 +1404,8 @@ static HRESULT create_d3d9_surface_buffer(IUnknown *surface, BOOL bottom_up, IMF
object->_2d.height = desc.Height;
object->max_length = object->_2d.plane_size;
+ object->_2d.fourcc = desc.Format;
+
*buffer = &object->IMFMediaBuffer_iface;
return S_OK;
@@ -1427,6 +1460,8 @@ static HRESULT create_dxgi_surface_buffer(IUnknown *surface, unsigned int sub_re
object->_2d.height = desc.Height;
object->max_length = object->_2d.plane_size;
+ object->_2d.fourcc = desc.Format;
+
if (FAILED(hr = init_attributes_object(&object->dxgi_surface.attributes, 0)))
{
IMFMediaBuffer_Release(&object->IMFMediaBuffer_iface);
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c
index 65ab72bd57b..d73641652b1 100644
--- a/dlls/mfplat/tests/mfplat.c
+++ b/dlls/mfplat/tests/mfplat.c
@@ -5433,10 +5433,10 @@ static void test_MFCreate2DMediaBuffer(void)
};
unsigned int max_length, length, length2;
BYTE *buffer_start, *data, *data2;
+ int i, j, k, pitch, pitch2, stride;
IMF2DBuffer2 *_2dbuffer2;
IMF2DBuffer *_2dbuffer;
IMFMediaBuffer *buffer;
- int i, pitch, pitch2;
HRESULT hr;
BOOL ret;
@@ -5631,6 +5631,8 @@ static void test_MFCreate2DMediaBuffer(void)
ok(length2 == ptr->contiguous_length, "%d: unexpected linear buffer length %u for %u x %u, format %s.\n",
i, length2, ptr->width, ptr->height, wine_dbgstr_an((char *)&ptr->fourcc, 4));
+ memset(data, 0xff, length2);
+
hr = IMFMediaBuffer_Unlock(buffer);
ok(hr == S_OK, "Failed to unlock buffer, hr %#x.\n", hr);
@@ -5649,6 +5651,44 @@ static void test_MFCreate2DMediaBuffer(void)
ok(data2 == data, "Unexpected data pointer.\n");
ok(pitch == pitch2, "Unexpected pitch.\n");
+ /* primary plane */
+ for(j = 0; j < ptr->height; j++)
+ for (k = 0; k < ptr->width; k++)
+ ok(data[j * pitch + k] == 0xff, "Unexpected byte %02x at test %d row %d column %d.\n", data[j * pitch + k], i, j, k);
+
+ hr = pMFGetStrideForBitmapInfoHeader(ptr->fourcc, ptr->width, &stride);
+ ok(hr == S_OK, "Failed to get stride, hr %#x.\n", hr);
+
+ /* secondary planes */
+ switch (ptr->fourcc)
+ {
+ case MAKEFOURCC('I','M','C','1'):
+ case MAKEFOURCC('I','M','C','3'):
+ for (j = ptr->height; j < length2 / stride; j++)
+ for (k = 0; k < ptr->width / 2; k++)
+ ok(data[j * pitch + k] == 0xff, "Unexpected byte %02x at test %d row %d column %d.\n", data[j * pitch + k], i, j, k);
+ break;
+
+ case MAKEFOURCC('I','M','C','2'):
+ case MAKEFOURCC('I','M','C','4'):
+ for (j = ptr->height; j < length2 / stride; j++)
+ for (k = 0; k < ptr->width / 2; k++)
+ ok(data[j * pitch + k] == 0xff, "Unexpected byte %02x at test %d row %d column %d.\n", data[j * pitch + k], i, j, k);
+ for (j = ptr->height; j < length2 / stride; j++)
+ for (k = pitch / 2; k < pitch / 2 + ptr->width / 2; k++)
+ ok(data[j * pitch + k] == 0xff, "Unexpected byte %02x at test %d row %d column %d.\n", data[j * pitch + k], i, j, k);
+ break;
+
+ case MAKEFOURCC('N','V','1','2'):
+ for (j = ptr->height; j < length2 / stride; j++)
+ for (k = 0; k < ptr->width; k++)
+ ok(data[j * pitch + k] == 0xff, "Unexpected byte %02x at test %d row %d column %d.\n", data[j * pitch + k], i, j, k);
+ break;
+
+ default:
+ ;
+ }
+
hr = IMF2DBuffer_Unlock2D(_2dbuffer);
ok(hr == S_OK, "Failed to unlock buffer, hr %#x.\n", hr);
--
2.31.1
3
3
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/gdi32/tests/metafile.c | 1236 ++++++++++++++++++++++++++++++-----
1 file changed, 1087 insertions(+), 149 deletions(-)
diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c
index 83a10264589..062eb4c8a44 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,1102 @@ static int compare_emf_bits(const HENHMETAFILE mf, const unsigned char *bits,
return 0;
}
+static const unsigned char EMF_STRETCHBLT_1BIT_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,
+ 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_BITBLT_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,
+ 0x24, 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, 0x4c, 0x00, 0x00, 0x00,
+ 0xa4, 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,
+ 0x64, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
+ 0x94, 0x00, 0x00, 0x00, 0x10, 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_BITBLT_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,
+ 0x5c, 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, 0x4c, 0x00, 0x00, 0x00,
+ 0xdc, 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,
+ 0x64, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00,
+ 0xcc, 0x00, 0x00, 0x00, 0x10, 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_BITBLT_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,
+ 0x1c, 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, 0x4c, 0x00, 0x00, 0x00,
+ 0x9c, 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,
+ 0x64, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00, 0x00,
+ 0x8c, 0x04, 0x00, 0x00, 0x10, 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_BITBLT_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,
+ 0x38, 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, 0x4c, 0x00, 0x00, 0x00,
+ 0xb8, 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,
+ 0x64, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
+ 0x98, 0x00, 0x00, 0x00, 0x20, 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_BITBLT_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,
+ 0x3c, 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, 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, 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,
+ 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,
+ 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_BITBLT_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,
+ 0x58, 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, 0x4c, 0x00, 0x00, 0x00,
+ 0xd8, 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,
+ 0x64, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
+ 0x98, 0x00, 0x00, 0x00, 0x40, 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_BITBLT_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,
+ 0x38, 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, 0x4c, 0x00, 0x00, 0x00,
+ 0xb8, 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,
+ 0x64, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
+ 0x98, 0x00, 0x00, 0x00, 0x20, 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_BITBLT_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,
+ 0x58, 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, 0x4c, 0x00, 0x00, 0x00,
+ 0xd8, 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,
+ 0x64, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
+ 0x98, 0x00, 0x00, 0x00, 0x40, 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
+};
/* tests blitting to an EMF */
static void test_emf_BitBlt(void)
{
- HDC hdcDisplay, hdcMetafile, hdcBitmap;
- HBITMAP hBitmap, hOldBitmap;
- HENHMETAFILE hMetafile;
-#define BMP_DIM 4
- BITMAPINFOHEADER bmih =
- {
- sizeof(BITMAPINFOHEADER),
- BMP_DIM,/* biWidth */
- BMP_DIM,/* biHeight */
- 1, /* biPlanes */
- 24, /* biBitCount */
- BI_RGB, /* biCompression */
- 0, /* biXPelsPerMeter */
- 0, /* biYPelsPerMeter */
- 0, /* biClrUsed */
- 0, /* biClrImportant */
- };
+ 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];
+ }
+ 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)},
+ {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)},
+ {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_BITBLT_1BIT_4X4, sizeof(EMF_BITBLT_1BIT_4X4), 1, 1, {{0xff, 0xff, 0xff}}},
+ {4, 4, 4, BI_RGB, EMF_BITBLT_4BIT_4X4, sizeof(EMF_BITBLT_4BIT_4X4), 1, 1, {{0xff, 0xff, 0xff}}},
+ {8, 4, 4, BI_RGB, EMF_BITBLT_8BIT_4X4, sizeof(EMF_BITBLT_8BIT_4X4), 1, 1, {{0xff, 0xff, 0xff}}},
+ {16, 4, 4, BI_RGB, EMF_BITBLT_16BIT_555_4X4, sizeof(EMF_BITBLT_16BIT_555_4X4)},
+ {24, 4, 4, BI_RGB, EMF_BITBLT_24BIT_4X4, sizeof(EMF_BITBLT_24BIT_4X4)},
+ {32, 4, 4, BI_RGB, EMF_BITBLT_32BIT_888_4X4, sizeof(EMF_BITBLT_32BIT_888_4X4)},
+ {16, 4, 4, BI_BITFIELDS, EMF_BITBLT_16BIT_4X4, sizeof(EMF_BITBLT_16BIT_4X4), 0, 3, {{0x00, 0xf8, 0x00}, {0xe0, 0x07, 0x00}, {0x1f, 0x00, 0x00}}},
+ {32, 4, 4, BI_BITFIELDS, EMF_BITBLT_32BIT_4X4, sizeof(EMF_BITBLT_32BIT_4X4), 0, 3, {{0x00, 0x00, 0xff}, {0xe0, 0xff, 0x00}, {0xff, 0x00, 0x00}}},
+ };
+
+ 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);
+
+ for (test_idx = 0; test_idx < ARRAY_SIZE(tests); ++test_idx)
+ {
+ 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());
+ if (tests[test_idx].src_width == bitmap_width && tests[test_idx].src_height == bitmap_height)
+ {
+ ret = BitBlt(hdc_emf, 0, 0, bitmap_width, bitmap_height, hdc_bitmap, 0, 0, SRCCOPY);
+ ok(ret, "BitBlt failed, error %d\n", GetLastError());
+ }
+ else
+ {
+ 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, error %d\n", GetLastError());
+
+ ret = compare_emf_bits(hemf, tests[test_idx].bits, tests[test_idx].bits_count,
+ "test_emf_BitBlt", FALSE);
+ if (ret)
+ {
+ dump_emf_bits(hemf, "test_emf_BitBlt");
+ dump_emf_records(hemf, "test_emf_BitBlt");
+ }
+
+ 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)
--
2.30.2
3
2