Signed-off-by: Ziqing Hui zhui@codeweavers.com --- dlls/d2d1/device.c | 19 ++++++++++++++++++- dlls/d2d1/tests/d2d1.c | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c index ea38ca41c8c..f304ec63015 100644 --- a/dlls/d2d1/device.c +++ b/dlls/d2d1/device.c @@ -1978,7 +1978,24 @@ static BOOL STDMETHODCALLTYPE d2d_device_context_IsBufferPrecisionSupported(ID2D static void STDMETHODCALLTYPE d2d_device_context_GetImageLocalBounds(ID2D1DeviceContext *iface, ID2D1Image *image, D2D1_RECT_F *local_bounds) { - FIXME("iface %p, image %p, local_bounds %p stub!\n", iface, image, local_bounds); + ID2D1Bitmap *bitmap; + D2D_SIZE_F size; + + TRACE("iface %p, image %p, local_bounds %p.\n", iface, image, local_bounds); + + if (SUCCEEDED(ID2D1Image_QueryInterface(image, &IID_ID2D1Bitmap, (void **)&bitmap))) + { + size = ID2D1Bitmap_GetSize(bitmap); + local_bounds->left = 0.0f; + local_bounds->top = 0.0f; + local_bounds->right = size.width; + local_bounds->bottom = size.height; + ID2D1Bitmap_Release(bitmap); + } + else + { + FIXME("Unable to get local bounds of image %p.\n", image); + } }
static HRESULT STDMETHODCALLTYPE d2d_device_context_GetImageWorldBounds(ID2D1DeviceContext *iface, diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 5b72d79de0e..220e84bf8f8 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -10822,7 +10822,7 @@ static void test_image_bounds(BOOL d3d11) set_rect(&bounds, 0.0f, 0.0f, 0.0f, 0.0f); size = ID2D1Bitmap_GetSize(bitmap); ID2D1DeviceContext_GetImageLocalBounds(context, (ID2D1Image *)bitmap, &bounds); - todo_wine ok(compare_rect(&bounds, 0.0f, 0.0f, size.width, size.height, 0), + ok(compare_rect(&bounds, 0.0f, 0.0f, size.width, size.height, 0), "Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", bounds.left, bounds.top, bounds.right, bounds.bottom, expected_bounds.left, expected_bounds.top, expected_bounds.right, expected_bounds.bottom);