Commit 53f795af authored by Riccardo Bortolato's avatar Riccardo Bortolato Committed by Alexandre Julliard

wined3d: Make wined3d_swapchain_get_front_buffer_data work with wined3d_texture…

wined3d: Make wined3d_swapchain_get_front_buffer_data work with wined3d_texture and sub_resource_idx. Signed-off-by: 's avatarRiccardo Bortolato <rikyz619@gmail.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 9875ad2c
......@@ -1158,7 +1158,8 @@ static HRESULT WINAPI d3d8_device_GetFrontBuffer(IDirect3DDevice8 *iface, IDirec
}
wined3d_mutex_lock();
hr = wined3d_swapchain_get_front_buffer_data(device->implicit_swapchain->wined3d_swapchain, dst_impl->wined3d_surface);
hr = wined3d_swapchain_get_front_buffer_data(device->implicit_swapchain->wined3d_swapchain,
dst_impl->wined3d_texture, dst_impl->sub_resource_idx);
wined3d_mutex_unlock();
return hr;
......
......@@ -1288,7 +1288,7 @@ static HRESULT WINAPI d3d9_device_GetFrontBufferData(IDirect3DDevice9Ex *iface,
wined3d_mutex_lock();
if (swapchain < device->implicit_swapchain_count)
hr = wined3d_swapchain_get_front_buffer_data(device->implicit_swapchains[swapchain]->wined3d_swapchain,
dst_impl->wined3d_surface);
dst_impl->wined3d_texture, dst_impl->sub_resource_idx);
wined3d_mutex_unlock();
return hr;
......
......@@ -142,7 +142,7 @@ static HRESULT WINAPI d3d9_swapchain_GetFrontBufferData(IDirect3DSwapChain9Ex *i
TRACE("iface %p, surface %p.\n", iface, surface);
wined3d_mutex_lock();
hr = wined3d_swapchain_get_front_buffer_data(swapchain->wined3d_swapchain, dst->wined3d_surface);
hr = wined3d_swapchain_get_front_buffer_data(swapchain->wined3d_swapchain, dst->wined3d_texture, dst->sub_resource_idx);
wined3d_mutex_unlock();
return hr;
......
......@@ -156,13 +156,19 @@ HRESULT CDECL wined3d_swapchain_present(struct wined3d_swapchain *swapchain,
}
HRESULT CDECL wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapchain *swapchain,
struct wined3d_surface *dst_surface)
struct wined3d_texture *dst_texture, unsigned int sub_resource_idx)
{
struct wined3d_surface *src_surface;
struct wined3d_surface *src_surface, *dst_surface;
struct wined3d_resource *sub_resource;
RECT src_rect, dst_rect;
TRACE("swapchain %p, dst_surface %p.\n", swapchain, dst_surface);
TRACE("swapchain %p, dst_texture %p, sub_resource_idx %u.\n", swapchain, dst_texture, sub_resource_idx);
if (!(sub_resource = wined3d_texture_get_sub_resource(dst_texture, sub_resource_idx)) ||
sub_resource->type != WINED3D_RTYPE_SURFACE)
return WINED3DERR_INVALIDCALL;
dst_surface = surface_from_resource(sub_resource);
src_surface = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0));
SetRect(&src_rect, 0, 0, src_surface->resource.width, src_surface->resource.height);
dst_rect = src_rect;
......
......@@ -244,7 +244,7 @@
@ cdecl wined3d_swapchain_get_back_buffer(ptr long long)
@ cdecl wined3d_swapchain_get_device(ptr)
@ cdecl wined3d_swapchain_get_display_mode(ptr ptr ptr)
@ cdecl wined3d_swapchain_get_front_buffer_data(ptr ptr)
@ cdecl wined3d_swapchain_get_front_buffer_data(ptr ptr long)
@ cdecl wined3d_swapchain_get_gamma_ramp(ptr ptr)
@ cdecl wined3d_swapchain_get_parent(ptr)
@ cdecl wined3d_swapchain_get_desc(ptr ptr)
......
......@@ -2505,7 +2505,7 @@ struct wined3d_device * __cdecl wined3d_swapchain_get_device(const struct wined3
HRESULT __cdecl wined3d_swapchain_get_display_mode(const struct wined3d_swapchain *swapchain,
struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation);
HRESULT __cdecl wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapchain *swapchain,
struct wined3d_surface *dst_surface);
struct wined3d_texture *dst_texture, unsigned int sub_resource_idx);
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment