From 9875ad2cc301c28d88b42bf85ac4c6df93bbb4c7 Mon Sep 17 00:00:00 2001 From: Riccardo Bortolato Date: Fri, 16 Oct 2015 13:59:16 +0200 Subject: [PATCH] d3d9: Call wined3d_swapchain_get_front_buffer_data instead of wined3d_device_get_front_buffer_data in d3d9_device_GetFrontBuffer. Removed the now unused wined3d_device_get_front_buffer_data from wined3d. Signed-off-by: Riccardo Bortolato Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/d3d9/device.c | 6 ++++-- dlls/wined3d/device.c | 13 ------------- dlls/wined3d/wined3d.spec | 1 - include/wine/wined3d.h | 2 -- 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 9ff32a76cb5..507b3ddb626 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -1281,12 +1281,14 @@ static HRESULT WINAPI d3d9_device_GetFrontBufferData(IDirect3DDevice9Ex *iface, { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); struct d3d9_surface *dst_impl = unsafe_impl_from_IDirect3DSurface9(dst_surface); - HRESULT hr; + HRESULT hr = D3DERR_INVALIDCALL; TRACE("iface %p, swapchain %u, dst_surface %p.\n", iface, swapchain, dst_surface); wined3d_mutex_lock(); - hr = wined3d_device_get_front_buffer_data(device->wined3d_device, swapchain, dst_impl->wined3d_surface); + if (swapchain < device->implicit_swapchain_count) + hr = wined3d_swapchain_get_front_buffer_data(device->implicit_swapchains[swapchain]->wined3d_swapchain, + dst_impl->wined3d_surface); wined3d_mutex_unlock(); return hr; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 3a55e0429e6..35a9de48283 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3632,19 +3632,6 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, return WINED3D_OK; } -HRESULT CDECL wined3d_device_get_front_buffer_data(const struct wined3d_device *device, - UINT swapchain_idx, struct wined3d_surface *dst_surface) -{ - struct wined3d_swapchain *swapchain; - - TRACE("device %p, swapchain_idx %u, dst_surface %p.\n", device, swapchain_idx, dst_surface); - - if (!(swapchain = wined3d_device_get_swapchain(device, swapchain_idx))) - return WINED3DERR_INVALIDCALL; - - return wined3d_swapchain_get_front_buffer_data(swapchain, dst_surface); -} - HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes) { const struct wined3d_state *state = &device->state; diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 541f5496790..1b39e9d65b5 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -56,7 +56,6 @@ @ cdecl wined3d_device_get_depth_stencil_view(ptr) @ cdecl wined3d_device_get_device_caps(ptr ptr) @ cdecl wined3d_device_get_display_mode(ptr long ptr ptr) -@ cdecl wined3d_device_get_front_buffer_data(ptr long ptr) @ cdecl wined3d_device_get_gamma_ramp(ptr long ptr) @ cdecl wined3d_device_get_geometry_shader(ptr) @ cdecl wined3d_device_get_gs_cb(ptr long) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 19a4e4f822d..7d407bbd7f9 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2159,8 +2159,6 @@ struct wined3d_rendertarget_view * __cdecl wined3d_device_get_depth_stencil_view HRESULT __cdecl wined3d_device_get_device_caps(const struct wined3d_device *device, WINED3DCAPS *caps); HRESULT __cdecl wined3d_device_get_display_mode(const struct wined3d_device *device, UINT swapchain_idx, struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation); -HRESULT __cdecl wined3d_device_get_front_buffer_data(const struct wined3d_device *device, - UINT swapchain_idx, struct wined3d_surface *dst_surface); void __cdecl wined3d_device_get_gamma_ramp(const struct wined3d_device *device, UINT swapchain_idx, struct wined3d_gamma_ramp *ramp); struct wined3d_shader * __cdecl wined3d_device_get_geometry_shader(const struct wined3d_device *device);