From: "Zhipeng Zhao" Subject: [PATCH] d2d1: Add semi-implementation for ID2D1DeviceContext_DrawImage. Message-Id: <2fd961a.6c4f.1758c9a41d3.Coremail.near2see@163.com> Date: Tue, 3 Nov 2020 13:35:21 +0800 (CST) From 0d19768431d14db66a149e9045eeff6d5efc6a99 Mon Sep 17 00:00:00 2001 From: Zhipeng Zhao Date: Tue, 3 Nov 2020 13:31:12 +0800 Subject: [PATCH] d2d1: Add semi-implementation for ID2D1DeviceContext_DrawImage. Signed-off-by: Zhipeng Zhao --- dlls/d2d1/device.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c index 3c8431ce8f4..4a435914255 100644 --- a/dlls/d2d1/device.c +++ b/dlls/d2d1/device.c @@ -2214,6 +2214,22 @@ static void STDMETHODCALLTYPE d2d_device_context_DrawImage(ID2D1DeviceContext *i const D2D1_POINT_2F *target_offset, const D2D1_RECT_F *image_rect, D2D1_INTERPOLATION_MODE interpolation_mode, D2D1_COMPOSITE_MODE composite_mode) { + ID2D1Bitmap* bitmap = NULL; + if (SUCCEEDED(ID2D1Image_QueryInterface(image, &IID_ID2D1Bitmap, (void **)&bitmap))) + { + struct d2d_device_context *context = impl_from_ID2D1DeviceContext(iface); + D2D1_RECT_F dst_rect; + if (target_offset) + { + D2D1_SIZE_F size; + size = ID2D1Bitmap_GetSize(bitmap); + dst_rect.left = target_offset->x; + dst_rect.top = target_offset->y; + dst_rect.right = target_offset->x + size.width; + dst_rect.bottom = target_offset->y + size.height; + } + return d2d_device_context_draw_bitmap(context, bitmap, target_offset ? &dst_rect : NULL, 1.0f, interpolation_mode, NULL, NULL); + } FIXME("iface %p, image %p, target_offset %s, image_rect %s, interpolation_mode %#x, composite_mode %#x stub!\n", iface, image, debug_d2d_point_2f(target_offset), debug_d2d_rect_f(image_rect), interpolation_mode, composite_mode); -- 2.20.1