[PATCH 3/3] wined3d: Don't create a DIB section in gdi_surface_map.

Stefan Dösinger stefan at codeweavers.com
Thu Nov 21 06:33:37 CST 2013


Gdi_surface_private_setup already created it. As the comment suggests,
the DIB section can get lost if the application sets its own memory
pointer and then unsets it. DirectDraw does not allow setting surface
memory back to NULL however. Beyond this the DIB section only matters if
GetDC is called, which also takes care of creating the DIB section if
necessary.
---
 dlls/wined3d/surface.c | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index a4c22f7..2d287dd 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1513,21 +1513,6 @@ static void gdi_surface_map(struct wined3d_surface *surface, const RECT *rect, D
 {
     TRACE("surface %p, rect %s, flags %#x.\n",
             surface, wine_dbgstr_rect(rect), flags);
-
-    if (!(surface->flags & SFLAG_DIBSECTION))
-    {
-        HRESULT hr;
-
-        /* This happens on gdi surfaces if the application set a user pointer
-         * and resets it. Recreate the DIB section. */
-        if (FAILED(hr = surface_create_dib_section(surface)))
-        {
-            ERR("Failed to create dib section, hr %#x.\n", hr);
-            return;
-        }
-        wined3d_resource_free_sysmem(&surface->resource);
-        surface->resource.allocatedMemory = surface->dib.bitmap_data;
-    }
 }
 
 static void gdi_surface_unmap(struct wined3d_surface *surface)
-- 
1.8.3.2




More information about the wine-patches mailing list