For React Native.
-- v4: d2d1: Implement d2d_device_GetDxgiDevice().
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/d2d1/tests/d2d1.c | 193 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 193 insertions(+)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 625ad53292f..ab825cc8ae8 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -15439,6 +15439,198 @@ static void test_effect_blob_property(BOOL d3d11) release_test_context(&ctx); }
+static void test_get_dxgi_device(BOOL d3d11) +{ + D2D1_HWND_RENDER_TARGET_PROPERTIES hwnd_rt_desc; + D2D1_RENDER_TARGET_PROPERTIES rt_desc; + D2D1_RENDER_TARGET_PROPERTIES desc; + ID2D1BitmapRenderTarget *bitmap_rt; + IWICImagingFactory *wic_factory; + ID2D1HwndRenderTarget *hwnd_rt; + struct d2d1_test_context ctx; + ID2D1DeviceContext *context; + IDXGIDevice *dxgi_device; + D2D1_SIZE_U pixel_size; + IWICBitmap *wic_bitmap; + ID2D1Device2 *device2; + ID2D1RenderTarget *rt; + ID2D1Device *device; + HRESULT hr; + + if (!init_test_context(&ctx, d3d11)) + return; + + if (!ctx.factory3) + { + win_skip("ID2D1Factory3 is not supported.\n"); + release_test_context(&ctx); + return; + } + + /* Test user-provided DXGI device */ + hr = ID2D1Factory3_CreateDevice(ctx.factory3, ctx.device, &device2); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID2D1Device2_GetDxgiDevice(device2, &dxgi_device); + todo_wine + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + ok(dxgi_device == ctx.device, "Got unexpected IDXGIDevice.\n"); + IDXGIDevice_Release(dxgi_device); + } + + ID2D1Device2_Release(device2); + + /* WIC target */ + rt_desc.type = D2D1_RENDER_TARGET_TYPE_DEFAULT; + rt_desc.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM; + rt_desc.pixelFormat.alphaMode = D2D1_ALPHA_MODE_PREMULTIPLIED; + rt_desc.dpiX = 96.0f; + rt_desc.dpiY = 96.0f; + rt_desc.usage = D2D1_RENDER_TARGET_USAGE_NONE; + rt_desc.minLevel = D2D1_FEATURE_LEVEL_DEFAULT; + + CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, + &IID_IWICImagingFactory, (void **)&wic_factory); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = IWICImagingFactory_CreateBitmap(wic_factory, 16, 16, &GUID_WICPixelFormat32bppPBGRA, + WICBitmapCacheOnDemand, &wic_bitmap); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID2D1Factory1_CreateWicBitmapRenderTarget(ctx.factory1, wic_bitmap, &rt_desc, &rt); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID2D1RenderTarget_QueryInterface(rt, &IID_ID2D1DeviceContext, (void **)&context); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ID2D1DeviceContext_GetDevice(context, &device); + hr = ID2D1Device_QueryInterface(device, &IID_ID2D1Device2, (void **)&device2); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + dxgi_device = (IDXGIDevice *)0xdeadbeef; + hr = ID2D1Device2_GetDxgiDevice(device2, &dxgi_device); + todo_wine + ok(hr == D2DERR_INVALID_CALL, "Got unexpected hr %#lx.\n", hr); + todo_wine + ok(!dxgi_device, "Expected NULL DXGI device.\n"); + + ID2D1Device2_Release(device2); + ID2D1Device_Release(device); + ID2D1DeviceContext_Release(context); + ID2D1RenderTarget_Release(rt); + IWICBitmap_Release(wic_bitmap); + IWICImagingFactory_Release(wic_factory); + CoUninitialize(); + + /* HWND target */ + desc.type = D2D1_RENDER_TARGET_TYPE_DEFAULT; + desc.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM; + desc.pixelFormat.alphaMode = D2D1_ALPHA_MODE_PREMULTIPLIED; + desc.dpiX = 0.0f; + desc.dpiY = 0.0f; + desc.usage = D2D1_RENDER_TARGET_USAGE_NONE; + desc.minLevel = D2D1_FEATURE_LEVEL_DEFAULT; + + hwnd_rt_desc.hwnd = create_window(); + hwnd_rt_desc.pixelSize.width = 64; + hwnd_rt_desc.pixelSize.height = 64; + hwnd_rt_desc.presentOptions = D2D1_PRESENT_OPTIONS_NONE; + + hr = ID2D1Factory_CreateHwndRenderTarget(ctx.factory, &desc, &hwnd_rt_desc, &hwnd_rt); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID2D1HwndRenderTarget_QueryInterface(hwnd_rt, &IID_ID2D1DeviceContext, (void **)&context); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ID2D1DeviceContext_GetDevice(context, &device); + hr = ID2D1Device_QueryInterface(device, &IID_ID2D1Device2, (void **)&device2); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + dxgi_device = (IDXGIDevice *)0xdeadbeef; + hr = ID2D1Device2_GetDxgiDevice(device2, &dxgi_device); + todo_wine + ok(hr == D2DERR_INVALID_CALL, "Got unexpected hr %#lx.\n", hr); + todo_wine + ok(!dxgi_device, "Expected NULL DXGI device.\n"); + + ID2D1Device2_Release(device2); + ID2D1Device_Release(device); + ID2D1DeviceContext_Release(context); + ID2D1HwndRenderTarget_Release(hwnd_rt); + DestroyWindow(hwnd_rt_desc.hwnd); + + /* DXGI surface target */ + ID2D1DeviceContext_GetDevice(ctx.context, &device); + hr = ID2D1Device_QueryInterface(device, &IID_ID2D1Device2, (void **)&device2); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = ID2D1Device2_GetDxgiDevice(device2, &dxgi_device); + todo_wine + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + ok(dxgi_device == ctx.device, "Got unexpected IDXGIDevice.\n"); + IDXGIDevice_Release(dxgi_device); + } + + ID2D1Device2_Release(device2); + ID2D1Device_Release(device); + + /* DXGI compatible bitmap target */ + set_size_u(&pixel_size, 32, 32); + hr = ID2D1RenderTarget_CreateCompatibleRenderTarget(ctx.rt, NULL, &pixel_size, NULL, + D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &bitmap_rt); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + ID2D1BitmapRenderTarget_QueryInterface(bitmap_rt, &IID_ID2D1DeviceContext, (void **)&context); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ID2D1DeviceContext_GetDevice(context, &device); + hr = ID2D1Device_QueryInterface(device, &IID_ID2D1Device2, (void **)&device2); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + dxgi_device = (IDXGIDevice *)0xdeadbeef; + hr = ID2D1Device2_GetDxgiDevice(device2, &dxgi_device); + todo_wine + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + ok(dxgi_device == ctx.device, "Got unexpected IDXGIDevice.\n"); + IDXGIDevice_Release(dxgi_device); + } + + ID2D1Device2_Release(device2); + ID2D1Device_Release(device); + ID2D1DeviceContext_Release(context); + ID2D1BitmapRenderTarget_Release(bitmap_rt); + + /* DC target */ + rt_desc.type = D2D1_RENDER_TARGET_TYPE_DEFAULT; + rt_desc.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM; + rt_desc.pixelFormat.alphaMode = D2D1_ALPHA_MODE_PREMULTIPLIED; + rt_desc.dpiX = 96.0f; + rt_desc.dpiY = 96.0f; + rt_desc.usage = D2D1_RENDER_TARGET_USAGE_NONE; + rt_desc.minLevel = D2D1_FEATURE_LEVEL_DEFAULT; + + hr = ID2D1Factory1_CreateDCRenderTarget(ctx.factory1, &rt_desc, (ID2D1DCRenderTarget **)&rt); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID2D1RenderTarget_QueryInterface(rt, &IID_ID2D1DeviceContext, (void **)&context); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ID2D1DeviceContext_GetDevice(context, &device); + hr = ID2D1Device_QueryInterface(device, &IID_ID2D1Device2, (void **)&device2); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + dxgi_device = (IDXGIDevice *)0xdeadbeef; + hr = ID2D1Device2_GetDxgiDevice(device2, &dxgi_device); + todo_wine + ok(hr == D2DERR_INVALID_CALL, "Got unexpected hr %#lx.\n", hr); + todo_wine + ok(!dxgi_device, "Expected NULL DXGI device.\n"); + + ID2D1Device2_Release(device2); + ID2D1Device_Release(device); + ID2D1DeviceContext_Release(context); + ID2D1RenderTarget_Release(rt); + + release_test_context(&ctx); +} + START_TEST(d2d1) { HMODULE d2d1_dll = GetModuleHandleA("d2d1.dll"); @@ -15536,6 +15728,7 @@ START_TEST(d2d1) queue_test(test_compute_geometry_area); queue_test(test_wic_target_format); queue_test(test_effect_blob_property); + queue_test(test_get_dxgi_device);
run_queued_tests(); }
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/d2d1/device.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c index 75da15c99a5..ce0175966b1 100644 --- a/dlls/d2d1/device.c +++ b/dlls/d2d1/device.c @@ -3458,7 +3458,6 @@ static HRESULT d2d_device_context_init(struct d2d_device_context *render_target, struct d2d_device *device, IUnknown *outer_unknown, const struct d2d_device_context_ops *ops) { D3D11_SUBRESOURCE_DATA buffer_data; - struct d2d_device *device_impl; IDWriteFactory *dwrite_factory; D3D11_RASTERIZER_DESC rs_desc; D3D11_BUFFER_DESC buffer_desc; @@ -3986,8 +3985,7 @@ static HRESULT d2d_device_context_init(struct d2d_device_context *render_target, render_target->outer_unknown = outer_unknown ? outer_unknown : &render_target->IUnknown_iface; render_target->ops = ops;
- device_impl = unsafe_impl_from_ID2D1Device((ID2D1Device1 *)device); - if (FAILED(hr = IDXGIDevice_QueryInterface(device_impl->dxgi_device, + if (FAILED(hr = IDXGIDevice_QueryInterface(device->dxgi_device, &IID_ID3D11Device1, (void **)&render_target->d3d_device))) { WARN("Failed to query ID3D11Device1 interface, hr %#lx.\n", hr);
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/d2d1/d2d1_private.h | 6 +++++- dlls/d2d1/dc_render_target.c | 2 +- dlls/d2d1/device.c | 20 ++++++++++++++++---- dlls/d2d1/factory.c | 34 ++++++++++------------------------ dlls/d2d1/hwnd_render_target.c | 2 +- dlls/d2d1/tests/d2d1.c | 30 ++++++------------------------ dlls/d2d1/wic_render_target.c | 2 +- 7 files changed, 40 insertions(+), 56 deletions(-)
diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h index 58507fd2c0b..d6dad474cf3 100644 --- a/dlls/d2d1/d2d1_private.h +++ b/dlls/d2d1/d2d1_private.h @@ -613,6 +613,7 @@ struct d2d_device LONG refcount; ID2D1Factory1 *factory; IDXGIDevice *dxgi_device; + bool allow_get_dxgi_device;
struct d2d_indexed_objects shaders; }; @@ -706,13 +707,16 @@ static inline struct d2d_factory *unsafe_impl_from_ID2D1Factory(ID2D1Factory *if }
void d2d_effects_init_builtins(struct d2d_factory *factory); +HRESULT d2d_factory_create_device(ID2D1Factory1 *factory, IDXGIDevice *dxgi_device, + bool allow_get_dxgi_device, REFIID iid, void **device); struct d2d_effect_registration * d2d_factory_get_registered_effect(ID2D1Factory *factory, const GUID *effect_id); void d2d_factory_register_effect(struct d2d_factory *factory, struct d2d_effect_registration *effect); HRESULT d2d_effect_property_get_uint32_value(const struct d2d_effect_properties *properties, const struct d2d_effect_property *prop, UINT32 *value); -void d2d_device_init(struct d2d_device *device, struct d2d_factory *factory, IDXGIDevice *dxgi_device); +void d2d_device_init(struct d2d_device *device, ID2D1Factory1 *factory, IDXGIDevice *dxgi_device, + bool allow_get_dxgi_device);
struct d2d_transform { diff --git a/dlls/d2d1/dc_render_target.c b/dlls/d2d1/dc_render_target.c index aa0c715baa5..adda6560deb 100644 --- a/dlls/d2d1/dc_render_target.c +++ b/dlls/d2d1/dc_render_target.c @@ -856,7 +856,7 @@ HRESULT d2d_dc_render_target_init(struct d2d_dc_render_target *render_target, ID return hr; }
- hr = ID2D1Factory1_CreateDevice(factory, dxgi_device, &device); + hr = d2d_factory_create_device(factory, dxgi_device, false, &IID_ID2D1Device, (void **)&device); IDXGIDevice_Release(dxgi_device); if (FAILED(hr)) { diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c index ce0175966b1..e0eb8dd1dd0 100644 --- a/dlls/d2d1/device.c +++ b/dlls/d2d1/device.c @@ -4426,9 +4426,19 @@ static void STDMETHODCALLTYPE d2d_device_FlushDeviceContexts(ID2D1Device6 *iface static HRESULT STDMETHODCALLTYPE d2d_device_GetDxgiDevice(ID2D1Device6 *iface, IDXGIDevice **dxgi_device) { - FIXME("iface %p, dxgi_device %p stub!\n", iface, dxgi_device); + struct d2d_device *device = impl_from_ID2D1Device(iface);
- return E_NOTIMPL; + TRACE("iface %p, dxgi_device %p.\n", iface, dxgi_device); + + if (!device->allow_get_dxgi_device) + { + *dxgi_device = NULL; + return D2DERR_INVALID_CALL; + } + + IDXGIDevice_AddRef(device->dxgi_device); + *dxgi_device = device->dxgi_device; + return S_OK; }
static HRESULT STDMETHODCALLTYPE d2d_device_ID2D1Device3_CreateDeviceContext(ID2D1Device6 *iface, @@ -4517,14 +4527,16 @@ struct d2d_device *unsafe_impl_from_ID2D1Device(ID2D1Device1 *iface) return CONTAINING_RECORD(iface, struct d2d_device, ID2D1Device6_iface); }
-void d2d_device_init(struct d2d_device *device, struct d2d_factory *factory, IDXGIDevice *dxgi_device) +void d2d_device_init(struct d2d_device *device, ID2D1Factory1 *factory, IDXGIDevice *dxgi_device, + bool allow_get_dxgi_device) { device->ID2D1Device6_iface.lpVtbl = &d2d_device_vtbl; device->refcount = 1; - device->factory = (ID2D1Factory1 *)&factory->ID2D1Factory7_iface; + device->factory = factory; ID2D1Factory1_AddRef(device->factory); device->dxgi_device = dxgi_device; IDXGIDevice_AddRef(device->dxgi_device); + device->allow_get_dxgi_device = allow_get_dxgi_device; }
HRESULT d2d_device_add_indexed_object(struct d2d_indexed_objects *objects, diff --git a/dlls/d2d1/factory.c b/dlls/d2d1/factory.c index 954d90efc0e..797a3b2fb1d 100644 --- a/dlls/d2d1/factory.c +++ b/dlls/d2d1/factory.c @@ -513,8 +513,8 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDCRenderTarget(ID2D1Factory7 return S_OK; }
-static HRESULT d2d_factory_create_device(struct d2d_factory *factory, IDXGIDevice *dxgi_device, - REFIID iid, void **device) +HRESULT d2d_factory_create_device(ID2D1Factory1 *factory, IDXGIDevice *dxgi_device, + bool allow_get_dxgi_device, REFIID iid, void **device) { struct d2d_device *object; HRESULT hr; @@ -522,7 +522,7 @@ static HRESULT d2d_factory_create_device(struct d2d_factory *factory, IDXGIDevic if (!(object = calloc(1, sizeof(*object)))) return E_OUTOFMEMORY;
- d2d_device_init(object, factory, dxgi_device); + d2d_device_init(object, factory, dxgi_device, allow_get_dxgi_device);
TRACE("Create device %p.\n", object);
@@ -535,11 +535,9 @@ static HRESULT d2d_factory_create_device(struct d2d_factory *factory, IDXGIDevic static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDevice(ID2D1Factory7 *iface, IDXGIDevice *dxgi_device, ID2D1Device **device) { - struct d2d_factory *factory = impl_from_ID2D1Factory7(iface); - TRACE("iface %p, dxgi_device %p, device %p.\n", iface, dxgi_device, device);
- return d2d_factory_create_device(factory, dxgi_device, &IID_ID2D1Device, (void **)device); + return d2d_factory_create_device((ID2D1Factory1 *)iface, dxgi_device, true, &IID_ID2D1Device, (void **)device); }
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateStrokeStyle1(ID2D1Factory7 *iface, @@ -1189,61 +1187,49 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_GetEffectProperties(ID2D1Factory7 * static HRESULT STDMETHODCALLTYPE d2d_factory_ID2D1Factory2_CreateDevice(ID2D1Factory7 *iface, IDXGIDevice *dxgi_device, ID2D1Device1 **device) { - struct d2d_factory *factory = impl_from_ID2D1Factory7(iface); - TRACE("iface %p, dxgi_device %p, device %p.\n", iface, dxgi_device, device);
- return d2d_factory_create_device(factory, dxgi_device, &IID_ID2D1Device1, (void **)device); + return d2d_factory_create_device((ID2D1Factory1 *)iface, dxgi_device, true, &IID_ID2D1Device1, (void **)device); }
static HRESULT STDMETHODCALLTYPE d2d_factory_ID2D1Factory3_CreateDevice(ID2D1Factory7 *iface, IDXGIDevice *dxgi_device, ID2D1Device2 **device) { - struct d2d_factory *factory = impl_from_ID2D1Factory7(iface); - TRACE("iface %p, dxgi_device %p, device %p.\n", iface, dxgi_device, device);
- return d2d_factory_create_device(factory, dxgi_device, &IID_ID2D1Device2, (void **)device); + return d2d_factory_create_device((ID2D1Factory1 *)iface, dxgi_device, true, &IID_ID2D1Device2, (void **)device); }
static HRESULT STDMETHODCALLTYPE d2d_factory_ID2D1Factory4_CreateDevice(ID2D1Factory7 *iface, IDXGIDevice *dxgi_device, ID2D1Device3 **device) { - struct d2d_factory *factory = impl_from_ID2D1Factory7(iface); - TRACE("iface %p, dxgi_device %p, device %p.\n", iface, dxgi_device, device);
- return d2d_factory_create_device(factory, dxgi_device, &IID_ID2D1Device3, (void **)device); + return d2d_factory_create_device((ID2D1Factory1 *)iface, dxgi_device, true, &IID_ID2D1Device3, (void **)device); }
static HRESULT STDMETHODCALLTYPE d2d_factory_ID2D1Factory5_CreateDevice(ID2D1Factory7 *iface, IDXGIDevice *dxgi_device, ID2D1Device4 **device) { - struct d2d_factory *factory = impl_from_ID2D1Factory7(iface); - TRACE("iface %p, dxgi_device %p, device %p.\n", iface, dxgi_device, device);
- return d2d_factory_create_device(factory, dxgi_device, &IID_ID2D1Device4, (void **)device); + return d2d_factory_create_device((ID2D1Factory1 *)iface, dxgi_device, true, &IID_ID2D1Device4, (void **)device); }
static HRESULT STDMETHODCALLTYPE d2d_factory_ID2D1Factory6_CreateDevice(ID2D1Factory7 *iface, IDXGIDevice *dxgi_device, ID2D1Device5 **device) { - struct d2d_factory *factory = impl_from_ID2D1Factory7(iface); - TRACE("iface %p, dxgi_device %p, device %p.\n", iface, dxgi_device, device);
- return d2d_factory_create_device(factory, dxgi_device, &IID_ID2D1Device5, (void **)device); + return d2d_factory_create_device((ID2D1Factory1 *)iface, dxgi_device, true, &IID_ID2D1Device5, (void **)device); }
static HRESULT STDMETHODCALLTYPE d2d_factory_ID2D1Factory7_CreateDevice(ID2D1Factory7 *iface, IDXGIDevice *dxgi_device, ID2D1Device6 **device) { - struct d2d_factory *factory = impl_from_ID2D1Factory7(iface); - TRACE("iface %p, dxgi_device %p, device %p.\n", iface, dxgi_device, device);
- return d2d_factory_create_device(factory, dxgi_device, &IID_ID2D1Device6, (void **)device); + return d2d_factory_create_device((ID2D1Factory1 *)iface, dxgi_device, true, &IID_ID2D1Device6, (void **)device); }
static const struct ID2D1Factory7Vtbl d2d_factory_vtbl = diff --git a/dlls/d2d1/hwnd_render_target.c b/dlls/d2d1/hwnd_render_target.c index 7f16ff00d4e..dc0dbc61b0e 100644 --- a/dlls/d2d1/hwnd_render_target.c +++ b/dlls/d2d1/hwnd_render_target.c @@ -918,7 +918,7 @@ HRESULT d2d_hwnd_render_target_init(struct d2d_hwnd_render_target *render_target return hr; }
- hr = ID2D1Factory1_CreateDevice(factory, dxgi_device, &device); + hr = d2d_factory_create_device(factory, dxgi_device, false, &IID_ID2D1Device, (void **)&device); IDXGIDevice_Release(dxgi_device); if (FAILED(hr)) { diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index ab825cc8ae8..92979cd493e 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -15471,14 +15471,10 @@ static void test_get_dxgi_device(BOOL d3d11) hr = ID2D1Factory3_CreateDevice(ctx.factory3, ctx.device, &device2); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); hr = ID2D1Device2_GetDxgiDevice(device2, &dxgi_device); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - if (hr == S_OK) - { - ok(dxgi_device == ctx.device, "Got unexpected IDXGIDevice.\n"); - IDXGIDevice_Release(dxgi_device); - } + ok(dxgi_device == ctx.device, "Got unexpected IDXGIDevice.\n");
+ IDXGIDevice_Release(dxgi_device); ID2D1Device2_Release(device2);
/* WIC target */ @@ -15507,9 +15503,7 @@ static void test_get_dxgi_device(BOOL d3d11)
dxgi_device = (IDXGIDevice *)0xdeadbeef; hr = ID2D1Device2_GetDxgiDevice(device2, &dxgi_device); - todo_wine ok(hr == D2DERR_INVALID_CALL, "Got unexpected hr %#lx.\n", hr); - todo_wine ok(!dxgi_device, "Expected NULL DXGI device.\n");
ID2D1Device2_Release(device2); @@ -15544,9 +15538,7 @@ static void test_get_dxgi_device(BOOL d3d11)
dxgi_device = (IDXGIDevice *)0xdeadbeef; hr = ID2D1Device2_GetDxgiDevice(device2, &dxgi_device); - todo_wine ok(hr == D2DERR_INVALID_CALL, "Got unexpected hr %#lx.\n", hr); - todo_wine ok(!dxgi_device, "Expected NULL DXGI device.\n");
ID2D1Device2_Release(device2); @@ -15561,14 +15553,10 @@ static void test_get_dxgi_device(BOOL d3d11) ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID2D1Device2_GetDxgiDevice(device2, &dxgi_device); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - if (hr == S_OK) - { - ok(dxgi_device == ctx.device, "Got unexpected IDXGIDevice.\n"); - IDXGIDevice_Release(dxgi_device); - } + ok(dxgi_device == ctx.device, "Got unexpected IDXGIDevice.\n");
+ IDXGIDevice_Release(dxgi_device); ID2D1Device2_Release(device2); ID2D1Device_Release(device);
@@ -15586,14 +15574,10 @@ static void test_get_dxgi_device(BOOL d3d11)
dxgi_device = (IDXGIDevice *)0xdeadbeef; hr = ID2D1Device2_GetDxgiDevice(device2, &dxgi_device); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - if (hr == S_OK) - { - ok(dxgi_device == ctx.device, "Got unexpected IDXGIDevice.\n"); - IDXGIDevice_Release(dxgi_device); - } + ok(dxgi_device == ctx.device, "Got unexpected IDXGIDevice.\n");
+ IDXGIDevice_Release(dxgi_device); ID2D1Device2_Release(device2); ID2D1Device_Release(device); ID2D1DeviceContext_Release(context); @@ -15618,9 +15602,7 @@ static void test_get_dxgi_device(BOOL d3d11)
dxgi_device = (IDXGIDevice *)0xdeadbeef; hr = ID2D1Device2_GetDxgiDevice(device2, &dxgi_device); - todo_wine ok(hr == D2DERR_INVALID_CALL, "Got unexpected hr %#lx.\n", hr); - todo_wine ok(!dxgi_device, "Expected NULL DXGI device.\n");
ID2D1Device2_Release(device2); diff --git a/dlls/d2d1/wic_render_target.c b/dlls/d2d1/wic_render_target.c index ccbe194d291..970d4ceaec9 100644 --- a/dlls/d2d1/wic_render_target.c +++ b/dlls/d2d1/wic_render_target.c @@ -252,7 +252,7 @@ HRESULT d2d_wic_render_target_init(struct d2d_wic_render_target *render_target, return hr; }
- hr = ID2D1Factory1_CreateDevice(factory, dxgi_device, &device); + hr = d2d_factory_create_device(factory, dxgi_device, false, &IID_ID2D1Device, (void **)&device); IDXGIDevice_Release(dxgi_device); if (FAILED(hr)) {
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=150328
Your paranoid android.
=== debian11b (64 bit WoW report) ===
user32: win.c:4070: Test failed: Expected active window 000000000367013C, got 0000000000000000. win.c:4071: Test failed: Expected focus window 000000000367013C, got 0000000000000000.
This merge request was approved by Nikolay Sivov.