From: Chip Davis Subject: [PATCH 2/2] d2d1: Introduce a function to convert D2D1.0 interpolation modes to D2D1.1. Message-Id: <20200406225159.42386-2-cdavis@codeweavers.com> Date: Mon, 6 Apr 2020 17:51:59 -0500 In-Reply-To: <20200406225159.42386-1-cdavis@codeweavers.com> References: <20200406225159.42386-1-cdavis@codeweavers.com> Signed-off-by: Chip Davis --- dlls/d2d1/brush.c | 2 +- dlls/d2d1/d2d1_private.h | 5 +++++ dlls/d2d1/device.c | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/d2d1/brush.c b/dlls/d2d1/brush.c index 675fa52e72b..1f455897f63 100644 --- a/dlls/d2d1/brush.c +++ b/dlls/d2d1/brush.c @@ -962,7 +962,7 @@ static void STDMETHODCALLTYPE d2d_bitmap_brush_SetInterpolationMode(ID2D1BitmapB return; } - brush->u.bitmap.interpolation_mode = mode; + brush->u.bitmap.interpolation_mode = d2d1_1_interp_mode_from_d2d1(mode); if (brush->u.bitmap.sampler_state) { ID3D10SamplerState_Release(brush->u.bitmap.sampler_state); diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h index a2546a5b1c9..4eb7e33142d 100644 --- a/dlls/d2d1/d2d1_private.h +++ b/dlls/d2d1/d2d1_private.h @@ -634,6 +634,11 @@ static inline void d2d_rect_expand(D2D1_RECT_F *dst, const D2D1_POINT_2F *point) dst->bottom = point->y; } +static inline D2D1_INTERPOLATION_MODE d2d1_1_interp_mode_from_d2d1(D2D1_BITMAP_INTERPOLATION_MODE mode) +{ + return (D2D1_INTERPOLATION_MODE)mode; +} + static inline const char *debug_d2d_point_2f(const D2D1_POINT_2F *point) { if (!point) diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c index 146f7009da0..acecb2058a5 100644 --- a/dlls/d2d1/device.c +++ b/dlls/d2d1/device.c @@ -1143,7 +1143,8 @@ static void STDMETHODCALLTYPE d2d_device_context_DrawBitmap(ID2D1DeviceContext * return; } - d2d_device_context_draw_bitmap(context, bitmap, dst_rect, opacity, interpolation_mode, src_rect, NULL); + d2d_device_context_draw_bitmap(context, bitmap, dst_rect, opacity, d2d1_1_interp_mode_from_d2d1(interpolation_mode), + src_rect, NULL); } static void STDMETHODCALLTYPE d2d_device_context_DrawText(ID2D1DeviceContext *iface, -- 2.24.0