Henri Verbeet : wined3d: Remove IWineD3DSwapChain::Destroy() from the public interface.

Alexandre Julliard julliard at winehq.org
Wed Apr 13 10:49:26 CDT 2011


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Apr 12 18:28:40 2011 +0200

wined3d: Remove IWineD3DSwapChain::Destroy() from the public interface.

---

 dlls/wined3d/swapchain.c |   20 +++++++++-----------
 include/wine/wined3d.idl |    2 --
 2 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 6db92d6..a44407f 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -26,15 +26,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
 WINE_DECLARE_DEBUG_CHANNEL(fps);
 
 /* Do not call while under the GL lock. */
-static void WINAPI IWineD3DBaseSwapChainImpl_Destroy(IWineD3DSwapChain *iface)
+static void swapchain_cleanup(IWineD3DSwapChainImpl *swapchain)
 {
-    IWineD3DSwapChainImpl *swapchain = (IWineD3DSwapChainImpl *)iface;
     WINED3DDISPLAYMODE mode;
     UINT i;
 
-    TRACE("Destroying swapchain %p.\n", iface);
+    TRACE("Destroying swapchain %p.\n", swapchain);
 
-    IWineD3DSwapChain_SetGammaRamp(iface, 0, &swapchain->orig_gamma);
+    IWineD3DSwapChain_SetGammaRamp((IWineD3DSwapChain *)swapchain, 0, &swapchain->orig_gamma);
 
     /* Release the swapchain's draw buffers. Make sure swapchain->back_buffers[0]
      * is the last buffer to be destroyed, FindContext() depends on that. */
@@ -64,6 +63,7 @@ static void WINAPI IWineD3DBaseSwapChainImpl_Destroy(IWineD3DSwapChain *iface)
     {
         context_destroy(swapchain->device, swapchain->context[i]);
     }
+    HeapFree(GetProcessHeap(), 0, swapchain->context);
 
     /* Restore the screen resolution if we rendered in fullscreen.
      * This will restore the screen resolution to what it was before creating
@@ -79,10 +79,6 @@ static void WINAPI IWineD3DBaseSwapChainImpl_Destroy(IWineD3DSwapChain *iface)
         mode.Format = swapchain->orig_fmt;
         IWineD3DDevice_SetDisplayMode((IWineD3DDevice *)swapchain->device, 0, &mode);
     }
-
-    swapchain->parent_ops->wined3d_object_destroyed(swapchain->parent);
-    HeapFree(GetProcessHeap(), 0, swapchain->context);
-    HeapFree(GetProcessHeap(), 0, swapchain);
 }
 
 static HRESULT WINAPI IWineD3DBaseSwapChainImpl_QueryInterface(IWineD3DSwapChain *iface, REFIID riid, void **object)
@@ -123,7 +119,11 @@ static ULONG WINAPI IWineD3DBaseSwapChainImpl_Release(IWineD3DSwapChain *iface)
     TRACE("%p decreasing refcount to %u.\n", swapchain, refcount);
 
     if (!refcount)
-        IWineD3DBaseSwapChainImpl_Destroy(iface);
+    {
+        swapchain_cleanup(swapchain);
+        swapchain->parent_ops->wined3d_object_destroyed(swapchain->parent);
+        HeapFree(GetProcessHeap(), 0, swapchain);
+    }
 
     return refcount;
 }
@@ -658,7 +658,6 @@ static const IWineD3DSwapChainVtbl IWineD3DSwapChain_Vtbl =
     IWineD3DBaseSwapChainImpl_Release,
     /* IWineD3DSwapChain */
     IWineD3DBaseSwapChainImpl_GetParent,
-    IWineD3DBaseSwapChainImpl_Destroy,
     IWineD3DBaseSwapChainImpl_GetDevice,
     IWineD3DSwapChainImpl_Present,
     IWineD3DSwapChainImpl_SetDestWindowOverride,
@@ -847,7 +846,6 @@ static const IWineD3DSwapChainVtbl IWineGDISwapChain_Vtbl =
     IWineD3DBaseSwapChainImpl_Release,
     /* IWineD3DSwapChain */
     IWineD3DBaseSwapChainImpl_GetParent,
-    IWineD3DBaseSwapChainImpl_Destroy,
     IWineD3DBaseSwapChainImpl_GetDevice,
     IWineGDISwapChainImpl_Present,
     IWineGDISwapChainImpl_SetDestWindowOverride,
diff --git a/include/wine/wined3d.idl b/include/wine/wined3d.idl
index 3e375a1..fff763d 100644
--- a/include/wine/wined3d.idl
+++ b/include/wine/wined3d.idl
@@ -2332,8 +2332,6 @@ interface IWineD3DVolume : IWineD3DResource
 ]
 interface IWineD3DSwapChain : IWineD3DBase
 {
-    void Destroy(
-    );
     HRESULT GetDevice(
         [out] IWineD3DDevice **device
     );




More information about the wine-cvs mailing list