[PATCH 5/5] dxgi: Implement dxgi_swapchain_GetFullscreenDesc().
Józef Kucia
jkucia at codeweavers.com
Mon Jan 22 07:11:55 CST 2018
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
dlls/dxgi/swapchain.c | 25 +++++++++++++++++++++++--
dlls/dxgi/tests/device.c | 7 +++++++
2 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c
index fe7e5cc4bc88..8e7dccbf9618 100644
--- a/dlls/dxgi/swapchain.c
+++ b/dlls/dxgi/swapchain.c
@@ -465,9 +465,30 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetDesc1(IDXGISwapChain1 *iface,
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetFullscreenDesc(IDXGISwapChain1 *iface,
DXGI_SWAP_CHAIN_FULLSCREEN_DESC *desc)
{
- FIXME("iface %p, desc %p stub!\n", iface, desc);
+ struct dxgi_swapchain *swapchain = impl_from_IDXGISwapChain1(iface);
+ struct wined3d_swapchain_desc wined3d_desc;
- return E_NOTIMPL;
+ TRACE("iface %p, desc %p.\n", iface, desc);
+
+ if (!desc)
+ {
+ WARN("Invalid pointer.\n");
+ return E_INVALIDARG;
+ }
+
+ wined3d_mutex_lock();
+ wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &wined3d_desc);
+ wined3d_mutex_unlock();
+
+ FIXME("Ignoring ScanlineOrdering and Scaling.\n");
+
+ desc->RefreshRate.Numerator = wined3d_desc.refresh_rate;
+ desc->RefreshRate.Denominator = 1;
+ desc->ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED;
+ desc->Scaling = DXGI_MODE_SCALING_UNSPECIFIED;
+ desc->Windowed = wined3d_desc.windowed;
+
+ return S_OK;
}
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetHwnd(IDXGISwapChain1 *iface, HWND *hwnd)
diff --git a/dlls/dxgi/tests/device.c b/dlls/dxgi/tests/device.c
index ea10ff5ef863..899a06383ae0 100644
--- a/dlls/dxgi/tests/device.c
+++ b/dlls/dxgi/tests/device.c
@@ -868,6 +868,7 @@ static void test_create_swapchain(void)
struct swapchain_fullscreen_state initial_state, expected_state;
unsigned int i, expected_width, expected_height;
DXGI_SWAP_CHAIN_DESC creation_desc, result_desc;
+ DXGI_SWAP_CHAIN_FULLSCREEN_DESC fullscreen_desc;
DXGI_SWAP_CHAIN_DESC1 swapchain_desc;
IDXGIDevice *device, *bgra_device;
ULONG refcount, expected_refcount;
@@ -978,6 +979,12 @@ static void test_create_swapchain(void)
"Got unexpected scaling %#x.\n", swapchain_desc.Scaling);
ok(swapchain_desc.AlphaMode == DXGI_ALPHA_MODE_IGNORE,
"Got unexpected alpha mode %#x.\n", swapchain_desc.AlphaMode);
+ hr = IDXGISwapChain1_GetFullscreenDesc(swapchain1, NULL);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ hr = IDXGISwapChain1_GetFullscreenDesc(swapchain1, &fullscreen_desc);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(fullscreen_desc.Windowed == creation_desc.Windowed,
+ "Got unexpected windowed %#x.\n", fullscreen_desc.Windowed);
hr = IDXGISwapChain1_GetHwnd(swapchain1, &window);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
ok(window == creation_desc.OutputWindow, "Got unexpected window %p.\n", window);
--
2.13.6
More information about the wine-devel
mailing list