wined3d: Make wined3d_swapchain_get_front_buffer_data work with wined3d_texture and sub_resource_idx.

Signed-off-by: Riccardo Bortolato <rikyz619@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Riccardo Bortolato 2015-10-16 13:59:17 +02:00 committed by Alexandre Julliard
parent 9875ad2cc3
commit 53f795af0a
6 changed files with 15 additions and 8 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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)

View File

@ -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);