[PATCH 3/5] ddraw: Use wined3d_texture_release_dc() in ddraw_surface7_ReleaseDC().

Henri Verbeet hverbeet at codeweavers.com
Mon Feb 1 11:42:10 CST 2016


Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
 dlls/ddraw/surface.c           | 2 +-
 dlls/wined3d/surface.c         | 2 +-
 dlls/wined3d/wined3d.spec      | 1 -
 dlls/wined3d/wined3d_private.h | 1 +
 include/wine/wined3d.h         | 1 -
 5 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 7b4f1ab..25aa9b8 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -2211,7 +2211,7 @@ static HRESULT WINAPI ddraw_surface7_ReleaseDC(IDirectDrawSurface7 *iface, HDC h
     TRACE("iface %p, dc %p.\n", iface, hdc);
 
     wined3d_mutex_lock();
-    hr = wined3d_surface_releasedc(surface->wined3d_surface, hdc);
+    hr = wined3d_texture_release_dc(surface->wined3d_texture, surface->sub_resource_idx, hdc);
     if (SUCCEEDED(hr) && (surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE))
         hr = ddraw_surface_update_frontbuffer(surface, NULL, FALSE);
     wined3d_mutex_unlock();
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 6fad052..57ab90c 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2629,7 +2629,7 @@ HRESULT wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
     return WINED3D_OK;
 }
 
-HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
+HRESULT wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
 {
     TRACE("surface %p, dc %p.\n", surface, dc);
 
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index 22f8f56..2698d17 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -227,7 +227,6 @@
 @ cdecl wined3d_surface_get_pitch(ptr)
 @ cdecl wined3d_surface_get_resource(ptr)
 @ cdecl wined3d_surface_map(ptr ptr ptr long)
-@ cdecl wined3d_surface_releasedc(ptr 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)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 81e808e..5474c7f 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2521,6 +2521,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface,
 void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN;
 void wined3d_surface_prepare(struct wined3d_surface *surface, struct wined3d_context *context,
         DWORD location) DECLSPEC_HIDDEN;
+HRESULT wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) DECLSPEC_HIDDEN;
 void surface_set_compatible_renderbuffer(struct wined3d_surface *surface,
         const struct wined3d_surface *rt) DECLSPEC_HIDDEN;
 void surface_set_texture_target(struct wined3d_surface *surface, GLenum target, GLint level) DECLSPEC_HIDDEN;
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index e589037..0b134cd 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2478,7 +2478,6 @@ DWORD __cdecl wined3d_surface_get_pitch(const struct wined3d_surface *surface);
 struct wined3d_resource * __cdecl wined3d_surface_get_resource(struct wined3d_surface *surface);
 HRESULT __cdecl wined3d_surface_map(struct wined3d_surface *surface,
         struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags);
-HRESULT __cdecl wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc);
 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,
-- 
2.1.4




More information about the wine-patches mailing list