[resend 5/5] wined3d: remove wined3d_surface_{inc,dec}ref

Riccardo Bortolato rikyz619 at gmail.com
Wed Nov 4 12:51:08 CST 2015


Now unused in client libraries, replaced its remaining calls inside wined3d with wined3d_texture_{inc,dec}ref

Signed-off-by: Riccardo Bortolato <rikyz619 at gmail.com>
---
 dlls/wined3d/cs.c         |  2 +-
 dlls/wined3d/device.c     |  8 ++++----
 dlls/wined3d/surface.c    | 26 ++++++++++----------------
 dlls/wined3d/swapchain.c  |  2 +-
 dlls/wined3d/wined3d.spec |  2 --
 include/wine/wined3d.h    |  2 --
 6 files changed, 16 insertions(+), 26 deletions(-)

diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 3c4ea8c..316ccb8 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -430,7 +430,7 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
             surface_modify_ds_location(prev_surface, WINED3D_LOCATION_DISCARDED, prev->width, prev->height);
             if (prev_surface == device->onscreen_depth_stencil)
             {
-                wined3d_surface_decref(device->onscreen_depth_stencil);
+                wined3d_texture_decref(device->onscreen_depth_stencil->container);
                 device->onscreen_depth_stencil = NULL;
             }
         }
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 7395963..1a0b89b 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -208,10 +208,10 @@ void device_switch_onscreen_ds(struct wined3d_device *device,
         surface_modify_ds_location(device->onscreen_depth_stencil, WINED3D_LOCATION_TEXTURE_RGB,
                 device->onscreen_depth_stencil->ds_current_size.cx,
                 device->onscreen_depth_stencil->ds_current_size.cy);
-        wined3d_surface_decref(device->onscreen_depth_stencil);
+        wined3d_texture_decref(device->onscreen_depth_stencil->container);
     }
     device->onscreen_depth_stencil = depth_stencil;
-    wined3d_surface_incref(device->onscreen_depth_stencil);
+    wined3d_texture_incref(device->onscreen_depth_stencil->container);
 }
 
 static BOOL is_full_clear(const struct wined3d_surface *target, const RECT *draw_rect, const RECT *clear_rect)
@@ -1102,7 +1102,7 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
     {
         surface = device->onscreen_depth_stencil;
         device->onscreen_depth_stencil = NULL;
-        wined3d_surface_decref(surface);
+        wined3d_texture_decref(surface->container);
     }
 
     if (device->fb.depth_stencil)
@@ -4518,7 +4518,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
 
     if (device->onscreen_depth_stencil)
     {
-        wined3d_surface_decref(device->onscreen_depth_stencil);
+        wined3d_texture_decref(device->onscreen_depth_stencil->container);
         device->onscreen_depth_stencil = NULL;
     }
 
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index c3ddc84..76f1ba1 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1117,12 +1117,20 @@ static void surface_remove_pbo(struct wined3d_surface *surface, const struct win
 
 static ULONG surface_resource_incref(struct wined3d_resource *resource)
 {
-    return wined3d_surface_incref(surface_from_resource(resource));
+    struct wined3d_surface *surface = surface_from_resource(resource);
+
+    TRACE("surface %p, container %p.\n", surface, surface->container);
+
+    return wined3d_texture_incref(surface->container);
 }
 
 static ULONG surface_resource_decref(struct wined3d_resource *resource)
 {
-    return wined3d_surface_decref(surface_from_resource(resource));
+    struct wined3d_surface *surface = surface_from_resource(resource);
+
+    TRACE("surface %p, container %p.\n", surface, surface->container);
+
+    return wined3d_texture_decref(surface->container);
 }
 
 static void surface_unload(struct wined3d_resource *resource)
@@ -1875,20 +1883,6 @@ static inline unsigned short float_32_to_16(const float *in)
     return ret;
 }
 
-ULONG CDECL wined3d_surface_incref(struct wined3d_surface *surface)
-{
-    TRACE("surface %p, container %p.\n", surface, surface->container);
-
-    return wined3d_texture_incref(surface->container);
-}
-
-ULONG CDECL wined3d_surface_decref(struct wined3d_surface *surface)
-{
-    TRACE("surface %p, container %p.\n", surface, surface->container);
-
-    return wined3d_texture_decref(surface->container);
-}
-
 void CDECL wined3d_surface_preload(struct wined3d_surface *surface)
 {
     TRACE("surface %p.\n", surface);
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index e965bda..e45fe17 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -583,7 +583,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
                     fb->depth_stencil->width, fb->depth_stencil->height);
             if (ds == swapchain->device->onscreen_depth_stencil)
             {
-                wined3d_surface_decref(swapchain->device->onscreen_depth_stencil);
+                wined3d_texture_decref(swapchain->device->onscreen_depth_stencil->container);
                 swapchain->device->onscreen_depth_stencil = NULL;
             }
         }
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index 7067e08..3864229 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -223,14 +223,12 @@
 @ cdecl wined3d_stateblock_incref(ptr)
 
 @ cdecl wined3d_surface_blt(ptr ptr ptr ptr long ptr long)
-@ cdecl wined3d_surface_decref(ptr)
 @ cdecl wined3d_surface_from_resource(ptr)
 @ cdecl wined3d_surface_get_overlay_position(ptr ptr ptr)
 @ cdecl wined3d_surface_get_parent(ptr)
 @ cdecl wined3d_surface_get_pitch(ptr)
 @ cdecl wined3d_surface_get_resource(ptr)
 @ cdecl wined3d_surface_getdc(ptr ptr)
-@ cdecl wined3d_surface_incref(ptr)
 @ cdecl wined3d_surface_is_lost(ptr)
 @ cdecl wined3d_surface_map(ptr ptr ptr long)
 @ cdecl wined3d_surface_preload(ptr)
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 9c9258a..59facbd 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2479,14 +2479,12 @@ ULONG __cdecl wined3d_stateblock_incref(struct wined3d_stateblock *stateblock);
 HRESULT __cdecl wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect,
         struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags,
         const WINEDDBLTFX *blt_fx, enum wined3d_texture_filter_type filter);
-ULONG __cdecl wined3d_surface_decref(struct wined3d_surface *surface);
 struct wined3d_surface * __cdecl wined3d_surface_from_resource(struct wined3d_resource *resource);
 HRESULT __cdecl wined3d_surface_get_overlay_position(const struct wined3d_surface *surface, LONG *x, LONG *y);
 void * __cdecl wined3d_surface_get_parent(const struct wined3d_surface *surface);
 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_getdc(struct wined3d_surface *surface, HDC *dc);
-ULONG __cdecl wined3d_surface_incref(struct wined3d_surface *surface);
 HRESULT __cdecl wined3d_surface_is_lost(const 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);
-- 
1.9.1




More information about the wine-patches mailing list