-- v2: d2d1: Don't cast D2D1_THREADING_MODE to D2D1_FACTORY_TYPE in D2D1CreateDevice. d2d1: Pass interpolation mode as D2D1_INTERPOLATION_MODE to d2d_device_context_draw_bitmap. d2d1/tests: Use D2D1_INTERPOLATION_MODE constants in DrawImage calls.
From: Jacek Caban jacek@codeweavers.com
--- dlls/d2d1/tests/d2d1.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 024886706c3..58f905ca1dc 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -2266,41 +2266,41 @@ static void test_bitmap_brush(BOOL d3d11) /* Crash on Windows 7+ */ if (0) { - ID2D1DeviceContext_DrawImage(context, NULL, NULL, NULL, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, + ID2D1DeviceContext_DrawImage(context, NULL, NULL, NULL, D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR, D2D1_COMPOSITE_MODE_SOURCE_OVER); }
- ID2D1DeviceContext_DrawImage(context, image, NULL, NULL, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, + ID2D1DeviceContext_DrawImage(context, image, NULL, NULL, D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR, D2D1_COMPOSITE_MODE_SOURCE_OVER);
set_rect(&src_rect, 0.0f, 0.0f, image_size.width, image_size.height);
- ID2D1DeviceContext_DrawImage(context, image, NULL, &src_rect, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, + ID2D1DeviceContext_DrawImage(context, image, NULL, &src_rect, D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR, D2D1_COMPOSITE_MODE_SOURCE_OVER);
offset.x = -1; offset.y = -1; - ID2D1DeviceContext_DrawImage(context, image, &offset, NULL, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, + ID2D1DeviceContext_DrawImage(context, image, &offset, NULL, D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR, D2D1_COMPOSITE_MODE_SOURCE_OVER);
offset.x = image_size.width * 2; offset.y = image_size.height; - ID2D1DeviceContext_DrawImage(context, image, &offset, NULL, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, + ID2D1DeviceContext_DrawImage(context, image, &offset, NULL, D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR, D2D1_COMPOSITE_MODE_SOURCE_OVER);
offset.x = image_size.width * 3; set_rect(&src_rect, image_size.width / 2, image_size.height / 2, image_size.width, image_size.height); - ID2D1DeviceContext_DrawImage(context, image, &offset, &src_rect, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, + ID2D1DeviceContext_DrawImage(context, image, &offset, &src_rect, D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR, D2D1_COMPOSITE_MODE_SOURCE_OVER);
offset.x = image_size.width * 4; set_rect(&src_rect, 0.0f, 0.0f, image_size.width * 2, image_size.height * 2); - ID2D1DeviceContext_DrawImage(context, image, &offset, &src_rect, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, + ID2D1DeviceContext_DrawImage(context, image, &offset, &src_rect, D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR, D2D1_COMPOSITE_MODE_SOURCE_OVER);
offset.x = image_size.width * 5; set_rect(&src_rect, image_size.width, image_size.height, 0.0f, 0.0f); - ID2D1DeviceContext_DrawImage(context, image, &offset, &src_rect, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, + ID2D1DeviceContext_DrawImage(context, image, &offset, &src_rect, D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR, D2D1_COMPOSITE_MODE_SOURCE_OVER);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL); @@ -2312,7 +2312,7 @@ static void test_bitmap_brush(BOOL d3d11)
offset.x = image_size.width * 6; set_rect(&src_rect, 1.0f, 0.0f, 1.0f, image_size.height); - ID2D1DeviceContext_DrawImage(context, image, &offset, &src_rect, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, + ID2D1DeviceContext_DrawImage(context, image, &offset, &src_rect, D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR, D2D1_COMPOSITE_MODE_SOURCE_OVER);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
From: Jacek Caban jacek@codeweavers.com
--- dlls/d2d1/device.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c index a8993e79d4d..e5548878ee9 100644 --- a/dlls/d2d1/device.c +++ b/dlls/d2d1/device.c @@ -2544,8 +2544,7 @@ static void STDMETHODCALLTYPE d2d_device_context_DrawImage(ID2D1DeviceContext1 *
if (SUCCEEDED(ID2D1Image_QueryInterface(image, &IID_ID2D1Bitmap, (void **)&bitmap))) { - d2d_device_context_draw_bitmap(context, bitmap, NULL, 1.0f, d2d1_1_interp_mode_from_d2d1(interpolation_mode), - image_rect, target_offset, NULL); + d2d_device_context_draw_bitmap(context, bitmap, NULL, 1.0f, interpolation_mode, image_rect, target_offset, NULL);
ID2D1Bitmap_Release(bitmap); return;
From: Jacek Caban jacek@codeweavers.com
--- dlls/d2d1/factory.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/dlls/d2d1/factory.c b/dlls/d2d1/factory.c index fff9895e930..3b2b1f5e4ec 100644 --- a/dlls/d2d1/factory.c +++ b/dlls/d2d1/factory.c @@ -1308,6 +1308,7 @@ HRESULT WINAPI D2D1CreateDevice(IDXGIDevice *dxgi_device, { D2D1_CREATION_PROPERTIES default_properties = {0}; D2D1_FACTORY_OPTIONS factory_options; + D2D1_FACTORY_TYPE factory_type; ID3D11Device *d3d_device; ID2D1Factory1 *factory; HRESULT hr; @@ -1325,9 +1326,20 @@ HRESULT WINAPI D2D1CreateDevice(IDXGIDevice *dxgi_device, properties = &default_properties; }
+ switch (properties->threadingMode) + { + case D2D1_THREADING_MODE_SINGLE_THREADED: + factory_type = D2D1_FACTORY_TYPE_SINGLE_THREADED; + break; + case D2D1_THREADING_MODE_MULTI_THREADED: + factory_type = D2D1_FACTORY_TYPE_MULTI_THREADED; + break; + default: + return E_INVALIDARG; + } + factory_options.debugLevel = properties->debugLevel; - if (FAILED(hr = D2D1CreateFactory(properties->threadingMode, - &IID_ID2D1Factory1, &factory_options, (void **)&factory))) + if (FAILED(hr = D2D1CreateFactory(factory_type, &IID_ID2D1Factory1, &factory_options, (void **)&factory))) return hr;
hr = ID2D1Factory1_CreateDevice(factory, dxgi_device, device);
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=138912
Your paranoid android.
=== debian11b (64 bit WoW report) ===
user32: input.c:1291: Test failed: Unexpected vkCode 0xa4, expected 0xe7.
This merge request was approved by Nikolay Sivov.