For React Native.
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/d2d1/tests/d2d1.c | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 625ad53292f..a76f37ce57b 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -15439,6 +15439,51 @@ static void test_effect_blob_property(BOOL d3d11) release_test_context(&ctx); }
+static void test_get_dxgi_device(BOOL d3d11) +{ + IDXGIDevice *dxgi_device = NULL; + struct d2d1_test_context ctx; + ID2D1Device2 *device2; + ID2D1Device *device; + HRESULT hr; + + if (!init_test_context(&ctx, d3d11)) + return; + + if (!ctx.factory1) + { + win_skip("ID2D1Factory1 is not supported.\n"); + release_test_context(&ctx); + return; + } + + hr = ID2D1Factory1_CreateDevice(ctx.factory1, ctx.device, &device); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = ID2D1Device_QueryInterface(device, &IID_ID2D1Device2, (void **)&device2); + if (FAILED(hr)) + { + win_skip("ID2D1Device2 is not supported.\n"); + ID2D1Device_Release(device); + release_test_context(&ctx); + return; + } + 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); + release_test_context(&ctx); +} + START_TEST(d2d1) { HMODULE d2d1_dll = GetModuleHandleA("d2d1.dll"); @@ -15536,6 +15581,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 | 8 ++++++-- dlls/d2d1/tests/d2d1.c | 8 ++------ 2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c index 75da15c99a5..2f40e2fe2c5 100644 --- a/dlls/d2d1/device.c +++ b/dlls/d2d1/device.c @@ -4428,9 +4428,13 @@ 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); + + IDXGIDevice_AddRef(device->dxgi_device); + *dxgi_device = device->dxgi_device; + return S_OK; }
static HRESULT STDMETHODCALLTYPE d2d_device_ID2D1Device3_CreateDeviceContext(ID2D1Device6 *iface, diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index a76f37ce57b..82bab03f372 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) 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); release_test_context(&ctx);
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=150214
Your paranoid android.
=== debian11b (build log) ===
Task: WineTest did not produce the wow64 report
Does React Native require DirectComposition too (or that's too new of an API)?
Nikolay Sivov (@nsivov) commented about dlls/d2d1/tests/d2d1.c:
- ID2D1Device2 *device2;
- ID2D1Device *device;
- HRESULT hr;
- if (!init_test_context(&ctx, d3d11))
return;
- if (!ctx.factory1)
- {
win_skip("ID2D1Factory1 is not supported.\n");
release_test_context(&ctx);
return;
- }
- hr = ID2D1Factory1_CreateDevice(ctx.factory1, ctx.device, &device);
- ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
Yes, the case with user-provided dxgi device is trivial. I recall that it wasn't possible to get underlying device that you didn't provide yourself, indirectly or directly. What this means is that we need tests for CreateDxgiSurfaceRenderTarget() - you should get a device surface is associated with, but e.g. CreateHwndRenderTarget() should not give access to it. (I think it's possible to do render_taget->QI(IID_device_context) -> GetDevice() -> QI(IID_device2) -> GetDxgiDevice()).
On Wed Dec 4 13:43:12 2024 +0000, Nikolay Sivov wrote:
Yes, the case with user-provided dxgi device is trivial. I recall that it wasn't possible to get underlying device that you didn't provide yourself, indirectly or directly. What this means is that we need tests for CreateDxgiSurfaceRenderTarget() - you should get a device surface is associated with, but e.g. CreateHwndRenderTarget() should not give access to it. (I think it's possible to do render_taget->QI(IID_device_context) -> GetDevice() -> QI(IID_device2) -> GetDxgiDevice()).
I see. I will add more tests.
On Wed Dec 4 14:46:27 2024 +0000, Aida Jonikienė wrote:
Does React Native require DirectComposition too (or that's too new of an API)?
Yes. It requires DirectComposition. See https://gitlab.winehq.org/zhiyi/wine/-/commits/bug-23698-react-native if you're interested.