From: Riccardo Bortolato Subject: [v9 11/11] ddraw: Replace wined3d_surface_unmap() with wined3d_resource_unmap() in d3d_texture2_Load(). Message-Id: <1447961687-4042-11-git-send-email-rikyz619@gmail.com> Date: Thu, 19 Nov 2015 20:34:47 +0100 In-Reply-To: <1447961687-4042-1-git-send-email-rikyz619@gmail.com> References: <1447961687-4042-1-git-send-email-rikyz619@gmail.com> Also removed wined3d_surface_unmap() from wined3d public api. Signed-off-by: Riccardo Bortolato --- dlls/ddraw/surface.c | 9 ++++++--- dlls/wined3d/surface.c | 2 +- dlls/wined3d/wined3d.spec | 1 - dlls/wined3d/wined3d_private.h | 1 + include/wine/wined3d.h | 1 - 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 6a224e4..ee81000 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -5169,7 +5169,8 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu if (FAILED(hr)) { ERR("Failed to lock destination surface, hr %#x.\n", hr); - wined3d_surface_unmap(src_surface->wined3d_surface); + wined3d_resource_unmap(wined3d_texture_get_resource(src_surface->wined3d_texture), + src_surface->sub_resource_idx); wined3d_mutex_unlock(); return D3DERR_TEXTURE_LOAD_FAILED; } @@ -5179,8 +5180,10 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu else memcpy(dst_map_desc.data, src_map_desc.data, src_map_desc.row_pitch * src_desc->dwHeight); - wined3d_surface_unmap(src_surface->wined3d_surface); - wined3d_surface_unmap(dst_surface->wined3d_surface); + wined3d_resource_unmap(wined3d_texture_get_resource(src_surface->wined3d_texture), + src_surface->sub_resource_idx); + wined3d_resource_unmap(wined3d_texture_get_resource(dst_surface->wined3d_texture), + dst_surface->sub_resource_idx); } if (src_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_MIPMAP) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 5d36451..c929df6 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -2467,7 +2467,7 @@ struct wined3d_surface * CDECL wined3d_surface_from_resource(struct wined3d_reso return surface_from_resource(resource); } -HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) +HRESULT wined3d_surface_unmap(struct wined3d_surface *surface) { TRACE("surface %p.\n", surface); diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 856edbb..4c33894 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -234,7 +234,6 @@ @ cdecl wined3d_surface_releasedc(ptr ptr) @ cdecl wined3d_surface_restore(ptr) @ cdecl wined3d_surface_set_overlay_position(ptr long long) -@ cdecl wined3d_surface_unmap(ptr) @ cdecl wined3d_surface_update_overlay(ptr ptr ptr ptr long ptr) @ cdecl wined3d_surface_update_overlay_z_order(ptr long ptr) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 8752e64..e26ec5d 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2485,6 +2485,7 @@ void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN; HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) DECLSPEC_HIDDEN; void surface_prepare_map_memory(struct wined3d_surface *surface) DECLSPEC_HIDDEN; +HRESULT wined3d_surface_unmap(struct wined3d_surface *surface) DECLSPEC_HIDDEN; void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point, BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 5b44e13..3dd1d4c 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2490,7 +2490,6 @@ void __cdecl wined3d_surface_preload(struct wined3d_surface *surface); HRESULT __cdecl wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc); HRESULT __cdecl wined3d_surface_restore(struct wined3d_surface *surface); HRESULT __cdecl wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y); -HRESULT __cdecl wined3d_surface_unmap(struct wined3d_surface *surface); HRESULT __cdecl wined3d_surface_update_overlay(struct wined3d_surface *surface, const RECT *src_rect, struct wined3d_surface *dst_surface, const RECT *dst_rect, DWORD flags, const WINEDDOVERLAYFX *fx); HRESULT __cdecl wined3d_surface_update_overlay_z_order(struct wined3d_surface *surface, -- 1.9.1