Henri Verbeet : wined3d: Get rid of surface_gdi_cleanup().

Alexandre Julliard julliard at winehq.org
Mon Oct 24 13:43:53 CDT 2011


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Sun Oct 23 18:23:59 2011 +0200

wined3d: Get rid of surface_gdi_cleanup().

It's effectively the same as surface_cleanup(). The GL objects that
surface_cleanup() destroys are never created for "GDI" surfaces.

---

 dlls/wined3d/surface.c         |   39 ++-------------------------------------
 dlls/wined3d/wined3d_private.h |    1 -
 2 files changed, 2 insertions(+), 38 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 7b17e2f..7dfc5b1 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1962,7 +1962,6 @@ static const struct wined3d_resource_ops surface_resource_ops =
 static const struct wined3d_surface_ops surface_ops =
 {
     surface_private_setup,
-    surface_cleanup,
     surface_realize_palette,
     surface_draw_overlay,
     surface_preload,
@@ -2015,39 +2014,6 @@ static HRESULT gdi_surface_private_setup(struct wined3d_surface *surface)
     return WINED3D_OK;
 }
 
-static void surface_gdi_cleanup(struct wined3d_surface *surface)
-{
-    struct wined3d_surface *overlay, *cur;
-
-    TRACE("surface %p.\n", surface);
-
-    if (surface->flags & SFLAG_DIBSECTION)
-    {
-        /* Release the DC. */
-        SelectObject(surface->hDC, surface->dib.holdbitmap);
-        DeleteDC(surface->hDC);
-        /* Release the DIB section. */
-        DeleteObject(surface->dib.DIBsection);
-        surface->dib.bitmap_data = NULL;
-        surface->resource.allocatedMemory = NULL;
-    }
-
-    if (surface->flags & SFLAG_USERPTR)
-        wined3d_surface_set_mem(surface, NULL);
-    if (surface->overlay_dest)
-        list_remove(&surface->overlay_entry);
-
-    LIST_FOR_EACH_ENTRY_SAFE(overlay, cur, &surface->overlays, struct wined3d_surface, overlay_entry)
-    {
-        list_remove(&overlay->overlay_entry);
-        overlay->overlay_dest = NULL;
-    }
-
-    HeapFree(GetProcessHeap(), 0, surface->palette9);
-
-    resource_cleanup(&surface->resource);
-}
-
 static void gdi_surface_realize_palette(struct wined3d_surface *surface)
 {
     struct wined3d_palette *palette = surface->palette;
@@ -2155,7 +2121,6 @@ static HRESULT gdi_surface_getdc(struct wined3d_surface *surface)
 static const struct wined3d_surface_ops gdi_surface_ops =
 {
     gdi_surface_private_setup,
-    surface_gdi_cleanup,
     gdi_surface_realize_palette,
     gdi_surface_draw_overlay,
     gdi_surface_preload,
@@ -2915,7 +2880,7 @@ ULONG CDECL wined3d_surface_decref(struct wined3d_surface *surface)
 
     if (!refcount)
     {
-        surface->surface_ops->surface_cleanup(surface);
+        surface_cleanup(surface);
         surface->resource.parent_ops->wined3d_object_destroyed(surface->resource.parent);
 
         TRACE("Destroyed surface %p.\n", surface);
@@ -7214,7 +7179,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, WINED3DSURFTYPE sur
     if (FAILED(hr))
     {
         ERR("Private setup failed, returning %#x\n", hr);
-        surface->surface_ops->surface_cleanup(surface);
+        surface_cleanup(surface);
         return hr;
     }
 
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index ebe277b..e2fd75e 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1990,7 +1990,6 @@ struct wined3d_subresource_container
 struct wined3d_surface_ops
 {
     HRESULT (*surface_private_setup)(struct wined3d_surface *surface);
-    void (*surface_cleanup)(struct wined3d_surface *surface);
     void (*surface_realize_palette)(struct wined3d_surface *surface);
     HRESULT (*surface_draw_overlay)(struct wined3d_surface *surface);
     void (*surface_preload)(struct wined3d_surface *surface);




More information about the wine-cvs mailing list