wined3d: wined3d_swapchain_get_desc() never fails.

This commit is contained in:
Henri Verbeet 2012-10-04 13:53:28 +02:00 committed by Alexandre Julliard
parent 5fcc1f8f70
commit adddf10cd8
5 changed files with 7 additions and 24 deletions

View File

@ -210,16 +210,15 @@ static HRESULT WINAPI d3d9_swapchain_GetPresentParameters(IDirect3DSwapChain9 *i
{
struct d3d9_swapchain *swapchain = impl_from_IDirect3DSwapChain9(iface);
struct wined3d_swapchain_desc desc;
HRESULT hr;
TRACE("iface %p, parameters %p.\n", iface, parameters);
wined3d_mutex_lock();
hr = wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &desc);
wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &desc);
wined3d_mutex_unlock();
present_parameters_from_wined3d_swapchain_desc(parameters, &desc);
return hr;
return D3D_OK;
}

View File

@ -2900,13 +2900,7 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
{
struct wined3d_swapchain_desc swapchain_desc;
hr = wined3d_swapchain_get_desc(ddraw->wined3d_swapchain, &swapchain_desc);
if (FAILED(hr))
{
ERR("Failed to get present parameters.\n");
return hr;
}
wined3d_swapchain_get_desc(ddraw->wined3d_swapchain, &swapchain_desc);
swapchain_desc.backbuffer_width = mode.width;
swapchain_desc.backbuffer_height = mode.height;
swapchain_desc.backbuffer_format = mode.format_id;

View File

@ -192,7 +192,6 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetDesc(IDXGISwapChain *iface, D
{
struct dxgi_swapchain *swapchain = impl_from_IDXGISwapChain(iface);
struct wined3d_swapchain_desc wined3d_desc;
HRESULT hr;
FIXME("iface %p, desc %p partial stub!\n", iface, desc);
@ -200,14 +199,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetDesc(IDXGISwapChain *iface, D
return E_INVALIDARG;
EnterCriticalSection(&dxgi_cs);
hr = wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &wined3d_desc);
if (FAILED(hr))
{
LeaveCriticalSection(&dxgi_cs);
return hr;
}
wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &wined3d_desc);
LeaveCriticalSection(&dxgi_cs);
FIXME("Ignoring ScanlineOrdering, Scaling, SwapEffect and Flags\n");
@ -227,7 +219,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetDesc(IDXGISwapChain *iface, D
desc->SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
desc->Flags = 0;
return hr;
return S_OK;
}
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_ResizeBuffers(IDXGISwapChain *iface,

View File

@ -244,14 +244,12 @@ struct wined3d_device * CDECL wined3d_swapchain_get_device(const struct wined3d_
return swapchain->device;
}
HRESULT CDECL wined3d_swapchain_get_desc(const struct wined3d_swapchain *swapchain,
void CDECL wined3d_swapchain_get_desc(const struct wined3d_swapchain *swapchain,
struct wined3d_swapchain_desc *desc)
{
TRACE("swapchain %p, desc %p.\n", swapchain, desc);
*desc = swapchain->desc;
return WINED3D_OK;
}
HRESULT CDECL wined3d_swapchain_set_gamma_ramp(const struct wined3d_swapchain *swapchain,

View File

@ -2369,7 +2369,7 @@ HRESULT __cdecl wined3d_swapchain_get_front_buffer_data(const struct wined3d_swa
HRESULT __cdecl wined3d_swapchain_get_gamma_ramp(const struct wined3d_swapchain *swapchain,
struct wined3d_gamma_ramp *ramp);
void * __cdecl wined3d_swapchain_get_parent(const struct wined3d_swapchain *swapchain);
HRESULT __cdecl wined3d_swapchain_get_desc(const struct wined3d_swapchain *swapchain,
void __cdecl wined3d_swapchain_get_desc(const struct wined3d_swapchain *swapchain,
struct wined3d_swapchain_desc *desc);
HRESULT __cdecl wined3d_swapchain_get_raster_status(const struct wined3d_swapchain *swapchain,
struct wined3d_raster_status *raster_status);