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()).