Commit c634bd20 authored by Ziqing Hui's avatar Ziqing Hui Committed by Alexandre Julliard

d2d1: Implement SetUnitMode().

parent eeed1bb5
...@@ -2149,7 +2149,17 @@ static D2D1_PRIMITIVE_BLEND STDMETHODCALLTYPE d2d_device_context_GetPrimitiveBle ...@@ -2149,7 +2149,17 @@ static D2D1_PRIMITIVE_BLEND STDMETHODCALLTYPE d2d_device_context_GetPrimitiveBle
static void STDMETHODCALLTYPE d2d_device_context_SetUnitMode(ID2D1DeviceContext *iface, D2D1_UNIT_MODE unit_mode) static void STDMETHODCALLTYPE d2d_device_context_SetUnitMode(ID2D1DeviceContext *iface, D2D1_UNIT_MODE unit_mode)
{ {
FIXME("iface %p, unit_mode %#x stub!\n", iface, unit_mode); struct d2d_device_context *context = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, unit_mode %#x.\n", iface, unit_mode);
if (unit_mode != D2D1_UNIT_MODE_DIPS && unit_mode != D2D1_UNIT_MODE_PIXELS)
{
WARN("Unknown unit mode %#x.\n", unit_mode);
return;
}
context->drawing_state.unitMode = unit_mode;
} }
static D2D1_UNIT_MODE STDMETHODCALLTYPE d2d_device_context_GetUnitMode(ID2D1DeviceContext *iface) static D2D1_UNIT_MODE STDMETHODCALLTYPE d2d_device_context_GetUnitMode(ID2D1DeviceContext *iface)
......
...@@ -9606,11 +9606,11 @@ static void test_unit_mode(BOOL d3d11) ...@@ -9606,11 +9606,11 @@ static void test_unit_mode(BOOL d3d11)
ID2D1DeviceContext_SetUnitMode(context, D2D1_UNIT_MODE_PIXELS); ID2D1DeviceContext_SetUnitMode(context, D2D1_UNIT_MODE_PIXELS);
unit_mode = ID2D1DeviceContext_GetUnitMode(context); unit_mode = ID2D1DeviceContext_GetUnitMode(context);
todo_wine ok(unit_mode == D2D1_UNIT_MODE_PIXELS, "Got unexpected unit mode %#x.\n", unit_mode); ok(unit_mode == D2D1_UNIT_MODE_PIXELS, "Got unexpected unit mode %#x.\n", unit_mode);
ID2D1DeviceContext_SetUnitMode(context, 0xdeadbeef); ID2D1DeviceContext_SetUnitMode(context, 0xdeadbeef);
unit_mode = ID2D1DeviceContext_GetUnitMode(context); unit_mode = ID2D1DeviceContext_GetUnitMode(context);
todo_wine ok(unit_mode == D2D1_UNIT_MODE_PIXELS, "Got unexpected unit mode %#x.\n", unit_mode); ok(unit_mode == D2D1_UNIT_MODE_PIXELS, "Got unexpected unit mode %#x.\n", unit_mode);
ID2D1DeviceContext_Release(context); ID2D1DeviceContext_Release(context);
release_test_context(&ctx); release_test_context(&ctx);
...@@ -10874,7 +10874,6 @@ static void test_image_bounds(BOOL d3d11) ...@@ -10874,7 +10874,6 @@ static void test_image_bounds(BOOL d3d11)
ok(unit_mode == D2D1_UNIT_MODE_DIPS, "Got unexpected unit mode %#x.\n", unit_mode); ok(unit_mode == D2D1_UNIT_MODE_DIPS, "Got unexpected unit mode %#x.\n", unit_mode);
ID2D1DeviceContext_SetUnitMode(context, D2D1_UNIT_MODE_PIXELS); ID2D1DeviceContext_SetUnitMode(context, D2D1_UNIT_MODE_PIXELS);
ID2D1DeviceContext_GetImageLocalBounds(context, (ID2D1Image *)bitmap, &bounds); ID2D1DeviceContext_GetImageLocalBounds(context, (ID2D1Image *)bitmap, &bounds);
todo_wine_if(!compare_float(test->dpi_x, 96.0f, 0) || !compare_float(test->dpi_y, 96.0f, 0))
ok(compare_rect(&bounds, 0.0f, 0.0f, test->pixel_size.width, test->pixel_size.height, 0), ok(compare_rect(&bounds, 0.0f, 0.0f, test->pixel_size.width, test->pixel_size.height, 0),
"Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", "Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n",
bounds.left, bounds.top, bounds.right, bounds.bottom, 0.0f, 0.0f, bounds.left, bounds.top, bounds.right, bounds.bottom, 0.0f, 0.0f,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment