wined3d: Get rid of wined3d_surface_update_overlay_z_order().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2016-02-08 18:32:02 +01:00 committed by Alexandre Julliard
parent 02008a6f2e
commit f0053d06c4
5 changed files with 9 additions and 31 deletions

View File

@ -162,7 +162,6 @@ struct ddraw_surface
/* Connections to other Objects */
struct ddraw *ddraw;
struct wined3d_surface *wined3d_surface;
struct wined3d_texture *wined3d_texture;
unsigned int sub_resource_idx;
struct wined3d_rendertarget_view *wined3d_rtv;

View File

@ -1216,7 +1216,6 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Flip(IDirectDrawSurface7
DDSCAPS2 caps = {DDSCAPS_FLIP, 0, 0, {0}};
struct wined3d_texture *texture;
IDirectDrawSurface7 *current;
struct wined3d_surface *tmp;
HRESULT hr;
TRACE("iface %p, src %p, flags %#x.\n", iface, src, flags);
@ -1237,7 +1236,6 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Flip(IDirectDrawSurface7
}
tmp_rtv = ddraw_surface_get_rendertarget_view(dst_impl);
tmp = dst_impl->wined3d_surface;
if (dst_impl->sub_resource_idx)
ERR("Invalid sub-resource index %u on surface %p.\n", dst_impl->sub_resource_idx, dst_impl);
texture = dst_impl->wined3d_texture;
@ -1269,7 +1267,6 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Flip(IDirectDrawSurface7
wined3d_rendertarget_view_set_parent(src_rtv, dst_impl);
dst_impl->wined3d_rtv = src_rtv;
wined3d_resource_set_parent(wined3d_texture_get_sub_resource(src_impl->wined3d_texture, 0), dst_impl);
dst_impl->wined3d_surface = src_impl->wined3d_surface;
prev_ddraw_texture = wined3d_texture_get_parent(src_impl->wined3d_texture);
wined3d_resource_set_parent(wined3d_texture_get_resource(src_impl->wined3d_texture), ddraw_texture);
if (src_impl->sub_resource_idx)
@ -1301,7 +1298,6 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Flip(IDirectDrawSurface7
wined3d_rendertarget_view_set_parent(src_rtv, dst_impl);
dst_impl->wined3d_rtv = src_rtv;
wined3d_resource_set_parent(wined3d_texture_get_sub_resource(src_impl->wined3d_texture, 0), dst_impl);
dst_impl->wined3d_surface = src_impl->wined3d_surface;
prev_ddraw_texture = wined3d_texture_get_parent(src_impl->wined3d_texture);
wined3d_resource_set_parent(wined3d_texture_get_resource(src_impl->wined3d_texture), ddraw_texture);
ddraw_texture = prev_ddraw_texture;
@ -1319,7 +1315,6 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Flip(IDirectDrawSurface7
wined3d_rendertarget_view_set_parent(tmp_rtv, src_impl);
src_impl->wined3d_rtv = tmp_rtv;
wined3d_resource_set_parent(wined3d_texture_get_sub_resource(texture, 0), src_impl);
src_impl->wined3d_surface = tmp;
wined3d_resource_set_parent(wined3d_texture_get_resource(texture), ddraw_texture);
src_impl->wined3d_texture = texture;
@ -3843,20 +3838,22 @@ static HRESULT WINAPI ddraw_surface1_UpdateOverlayDisplay(IDirectDrawSurface *if
*
*****************************************************************************/
static HRESULT WINAPI ddraw_surface7_UpdateOverlayZOrder(IDirectDrawSurface7 *iface,
DWORD Flags, IDirectDrawSurface7 *DDSRef)
DWORD flags, IDirectDrawSurface7 *reference)
{
struct ddraw_surface *surface = impl_from_IDirectDrawSurface7(iface);
struct ddraw_surface *reference_impl = unsafe_impl_from_IDirectDrawSurface7(DDSRef);
HRESULT hr;
TRACE("iface %p, flags %#x, reference %p.\n", iface, Flags, DDSRef);
FIXME("iface %p, flags %#x, reference %p stub!\n", iface, flags, reference);
wined3d_mutex_lock();
hr = wined3d_surface_update_overlay_z_order(surface->wined3d_surface,
Flags, reference_impl ? reference_impl->wined3d_surface : NULL);
if (!(surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_OVERLAY))
{
WARN("Not an overlay surface.\n");
wined3d_mutex_unlock();
return DDERR_NOTAOVERLAYSURFACE;
}
wined3d_mutex_unlock();
return hr;
return DD_OK;
}
static HRESULT WINAPI ddraw_surface4_UpdateOverlayZOrder(IDirectDrawSurface4 *iface,
@ -6302,7 +6299,6 @@ void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw,
}
desc->lpSurface = NULL;
surface->wined3d_surface = wined3d_surface;
wined3d_texture_incref(surface->wined3d_texture = wined3d_texture);
surface->sub_resource_idx = sub_resource_idx;
*parent_ops = &ddraw_surface_wined3d_parent_ops;

View File

@ -1909,20 +1909,6 @@ DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface)
return pitch;
}
HRESULT CDECL wined3d_surface_update_overlay_z_order(struct wined3d_surface *surface,
DWORD flags, struct wined3d_surface *ref)
{
FIXME("surface %p, flags %#x, ref %p stub!\n", surface, flags, ref);
if (!(surface->resource.usage & WINED3DUSAGE_OVERLAY))
{
TRACE("Not an overlay surface.\n");
return WINEDDERR_NOTAOVERLAYSURFACE;
}
return WINED3D_OK;
}
HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
const struct wined3d_gl_info *gl_info, void *mem, unsigned int pitch)
{

View File

@ -224,7 +224,6 @@
@ cdecl wined3d_surface_get_parent(ptr)
@ cdecl wined3d_surface_get_pitch(ptr)
@ cdecl wined3d_surface_update_overlay_z_order(ptr long ptr)
@ cdecl wined3d_swapchain_create(ptr ptr ptr ptr ptr)
@ cdecl wined3d_swapchain_decref(ptr)

View File

@ -2477,8 +2477,6 @@ ULONG __cdecl wined3d_stateblock_incref(struct wined3d_stateblock *stateblock);
void * __cdecl wined3d_surface_get_parent(const struct wined3d_surface *surface);
DWORD __cdecl wined3d_surface_get_pitch(const struct wined3d_surface *surface);
HRESULT __cdecl wined3d_surface_update_overlay_z_order(struct wined3d_surface *surface,
DWORD flags, struct wined3d_surface *ref);
HRESULT __cdecl wined3d_swapchain_create(struct wined3d_device *device, struct wined3d_swapchain_desc *desc,
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_swapchain **swapchain);