wined3d: Remove no longer needed output parameter in wined3d_swapchain_state_resize_target().
Current output is stored as part of the swapchain state now. Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b80ec595e9
commit
c84b2f97c1
|
@ -159,13 +159,10 @@ HRESULT dxgi_get_output_from_window(IDXGIFactory *factory, HWND window, IDXGIOut
|
|||
return DXGI_ERROR_NOT_FOUND;
|
||||
}
|
||||
|
||||
static HRESULT dxgi_swapchain_resize_target(IDXGISwapChain1 *swapchain,
|
||||
struct wined3d_swapchain_state *state, const DXGI_MODE_DESC *target_mode_desc)
|
||||
static HRESULT dxgi_swapchain_resize_target(struct wined3d_swapchain_state *state,
|
||||
const DXGI_MODE_DESC *target_mode_desc)
|
||||
{
|
||||
struct wined3d_display_mode mode;
|
||||
struct dxgi_output *dxgi_output;
|
||||
IDXGIOutput *output;
|
||||
HRESULT hr;
|
||||
|
||||
if (!target_mode_desc)
|
||||
{
|
||||
|
@ -173,10 +170,6 @@ static HRESULT dxgi_swapchain_resize_target(IDXGISwapChain1 *swapchain,
|
|||
return DXGI_ERROR_INVALID_CALL;
|
||||
}
|
||||
|
||||
if (FAILED(hr = IDXGISwapChain1_GetContainingOutput(swapchain, &output)))
|
||||
return hr;
|
||||
dxgi_output = unsafe_impl_from_IDXGIOutput(output);
|
||||
|
||||
TRACE("Mode: %s.\n", debug_dxgi_mode(target_mode_desc));
|
||||
|
||||
if (target_mode_desc->Scaling)
|
||||
|
@ -184,9 +177,7 @@ static HRESULT dxgi_swapchain_resize_target(IDXGISwapChain1 *swapchain,
|
|||
|
||||
wined3d_display_mode_from_dxgi(&mode, target_mode_desc);
|
||||
|
||||
hr = wined3d_swapchain_state_resize_target(state, dxgi_output->wined3d_output, &mode);
|
||||
IDXGIOutput_Release(output);
|
||||
return hr;
|
||||
return wined3d_swapchain_state_resize_target(state, &mode);
|
||||
}
|
||||
|
||||
static HWND d3d11_swapchain_get_hwnd(struct d3d11_swapchain *swapchain)
|
||||
|
@ -571,7 +562,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_ResizeTarget(IDXGISwapChain1 *i
|
|||
|
||||
state = wined3d_swapchain_get_state(swapchain->wined3d_swapchain);
|
||||
|
||||
return dxgi_swapchain_resize_target(iface, state, target_mode_desc);
|
||||
return dxgi_swapchain_resize_target(state, target_mode_desc);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetContainingOutput(IDXGISwapChain1 *iface, IDXGIOutput **output)
|
||||
|
@ -2399,7 +2390,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_ResizeTarget(IDXGISwapChain3 *i
|
|||
|
||||
TRACE("iface %p, target_mode_desc %p.\n", iface, target_mode_desc);
|
||||
|
||||
return dxgi_swapchain_resize_target((IDXGISwapChain1 *)iface, swapchain->state, target_mode_desc);
|
||||
return dxgi_swapchain_resize_target(swapchain->state, target_mode_desc);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetContainingOutput(IDXGISwapChain3 *iface,
|
||||
|
|
|
@ -1459,7 +1459,7 @@ static HRESULT wined3d_swapchain_state_set_display_mode(struct wined3d_swapchain
|
|||
}
|
||||
|
||||
HRESULT CDECL wined3d_swapchain_state_resize_target(struct wined3d_swapchain_state *state,
|
||||
struct wined3d_output *output, const struct wined3d_display_mode *mode)
|
||||
const struct wined3d_display_mode *mode)
|
||||
{
|
||||
struct wined3d_display_mode actual_mode;
|
||||
struct wined3d_output_desc output_desc;
|
||||
|
@ -1468,7 +1468,7 @@ HRESULT CDECL wined3d_swapchain_state_resize_target(struct wined3d_swapchain_sta
|
|||
HWND window;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("state %p, output %p, mode %p.\n", state, output, mode);
|
||||
TRACE("state %p, mode %p.\n", state, mode);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
|
||||
|
@ -1492,7 +1492,8 @@ HRESULT CDECL wined3d_swapchain_state_resize_target(struct wined3d_swapchain_sta
|
|||
if (state->desc.flags & WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH)
|
||||
{
|
||||
actual_mode = *mode;
|
||||
if (FAILED(hr = wined3d_swapchain_state_set_display_mode(state, output, &actual_mode)))
|
||||
if (FAILED(hr = wined3d_swapchain_state_set_display_mode(state, state->desc.output,
|
||||
&actual_mode)))
|
||||
{
|
||||
ERR("Failed to set display mode, hr %#x.\n", hr);
|
||||
wined3d_mutex_unlock();
|
||||
|
@ -1500,7 +1501,7 @@ HRESULT CDECL wined3d_swapchain_state_resize_target(struct wined3d_swapchain_sta
|
|||
}
|
||||
}
|
||||
|
||||
if (FAILED(hr = wined3d_output_get_desc(output, &output_desc)))
|
||||
if (FAILED(hr = wined3d_output_get_desc(state->desc.output, &output_desc)))
|
||||
{
|
||||
ERR("Failed to get output description, hr %#x.\n", hr);
|
||||
wined3d_mutex_unlock();
|
||||
|
|
|
@ -283,7 +283,7 @@
|
|||
|
||||
@ cdecl wined3d_swapchain_state_create(ptr ptr ptr)
|
||||
@ cdecl wined3d_swapchain_state_destroy(ptr)
|
||||
@ cdecl wined3d_swapchain_state_resize_target(ptr ptr ptr)
|
||||
@ cdecl wined3d_swapchain_state_resize_target(ptr ptr)
|
||||
@ cdecl wined3d_swapchain_state_set_fullscreen(ptr ptr ptr)
|
||||
|
||||
@ cdecl wined3d_texture_add_dirty_region(ptr long ptr)
|
||||
|
|
|
@ -2772,7 +2772,7 @@ HRESULT __cdecl wined3d_swapchain_state_create(const struct wined3d_swapchain_de
|
|||
HWND window, struct wined3d_swapchain_state **state);
|
||||
void __cdecl wined3d_swapchain_state_destroy(struct wined3d_swapchain_state *state);
|
||||
HRESULT __cdecl wined3d_swapchain_state_resize_target(struct wined3d_swapchain_state *state,
|
||||
struct wined3d_output *output, const struct wined3d_display_mode *mode);
|
||||
const struct wined3d_display_mode *mode);
|
||||
HRESULT __cdecl wined3d_swapchain_state_set_fullscreen(struct wined3d_swapchain_state *state,
|
||||
const struct wined3d_swapchain_desc *desc, const struct wined3d_display_mode *mode);
|
||||
|
||||
|
|
Loading…
Reference in New Issue