Henri Verbeet : wined3d: Forward volume refcounts to the container.

Alexandre Julliard julliard at winehq.org
Mon Apr 18 11:10:51 CDT 2011


Module: wine
Branch: master
Commit: 38800d8e9af1ea2e96358530f68bd48634672878
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=38800d8e9af1ea2e96358530f68bd48634672878

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Fri Apr 15 18:33:38 2011 +0200

wined3d: Forward volume refcounts to the container.

---

 dlls/wined3d/volume.c |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 251265b..66d7d6d 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -128,7 +128,15 @@ static void volume_unload(struct wined3d_resource *resource)
 
 ULONG CDECL wined3d_volume_incref(struct wined3d_volume *volume)
 {
-    ULONG refcount = InterlockedIncrement(&volume->resource.ref);
+    ULONG refcount;
+
+    if (volume->container)
+    {
+        TRACE("Forwarding to container %p.\n", volume->container);
+        return wined3d_texture_incref(volume->container);
+    }
+
+    refcount = InterlockedIncrement(&volume->resource.ref);
 
     TRACE("%p increasing refcount to %u.\n", volume, refcount);
 
@@ -138,7 +146,15 @@ ULONG CDECL wined3d_volume_incref(struct wined3d_volume *volume)
 /* Do not call while under the GL lock. */
 ULONG CDECL wined3d_volume_decref(struct wined3d_volume *volume)
 {
-    ULONG refcount = InterlockedDecrement(&volume->resource.ref);
+    ULONG refcount;
+
+    if (volume->container)
+    {
+        TRACE("Forwarding to container %p.\n", volume->container);
+        return wined3d_texture_decref(volume->container);
+    }
+
+    refcount = InterlockedDecrement(&volume->resource.ref);
 
     TRACE("%p decreasing refcount to %u.\n", volume, refcount);
 




More information about the wine-cvs mailing list