=?UTF-8?Q?Stefan=20D=C3=B6singer=20?=: wined3d: Remove broken ddraw overlay support.

Alexandre Julliard julliard at winehq.org
Wed Nov 20 13:38:57 CST 2013


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

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Wed Nov 20 12:33:30 2013 +0100

wined3d: Remove broken ddraw overlay support.

---

 dlls/wined3d/surface.c         |   48 +---------------------------------------
 dlls/wined3d/wined3d_private.h |   25 ++++++++++----------
 2 files changed, 13 insertions(+), 60 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 1536908..0ad52d1 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -800,27 +800,6 @@ static void surface_realize_palette(struct wined3d_surface *surface)
         surface_load_location(surface, surface->draw_binding, NULL);
 }
 
-static HRESULT surface_draw_overlay(struct wined3d_surface *surface)
-{
-    HRESULT hr;
-
-    /* If there's no destination surface there is nothing to do. */
-    if (!surface->overlay_dest)
-        return WINED3D_OK;
-
-    /* Blt calls ModifyLocation on the dest surface, which in turn calls
-     * DrawOverlay to update the overlay. Prevent an endless recursion. */
-    if (surface->overlay_dest->flags & SFLAG_INOVERLAYDRAW)
-        return WINED3D_OK;
-
-    surface->overlay_dest->flags |= SFLAG_INOVERLAYDRAW;
-    hr = wined3d_surface_blt(surface->overlay_dest, &surface->overlay_destrect, surface,
-            &surface->overlay_srcrect, WINEDDBLT_WAIT, NULL, WINED3D_TEXF_LINEAR);
-    surface->overlay_dest->flags &= ~SFLAG_INOVERLAYDRAW;
-
-    return hr;
-}
-
 static void surface_map(struct wined3d_surface *surface, const RECT *rect, DWORD flags)
 {
     struct wined3d_device *device = surface->resource.device;
@@ -929,7 +908,7 @@ static void surface_unmap(struct wined3d_surface *surface)
     if (surface->flags & (SFLAG_INDRAWABLE | SFLAG_INTEXTURE))
     {
         TRACE("Not dirtified, nothing to do.\n");
-        goto done;
+        return;
     }
 
     if (surface->swapchain && surface->swapchain->front_buffer == surface)
@@ -972,11 +951,6 @@ static void surface_unmap(struct wined3d_surface *surface)
     {
         FIXME("Depth / stencil buffer locking is not implemented.\n");
     }
-
-done:
-    /* Overlays have to be redrawn manually after changes with the GL implementation */
-    if (surface->overlay_dest)
-        surface_draw_overlay(surface);
 }
 
 static BOOL surface_is_full_rect(const struct wined3d_surface *surface, const RECT *r)
@@ -2861,8 +2835,6 @@ HRESULT CDECL wined3d_surface_set_overlay_position(struct wined3d_surface *surfa
     surface->overlay_destrect.right = x + w;
     surface->overlay_destrect.bottom = y + h;
 
-    surface_draw_overlay(surface);
-
     return WINED3D_OK;
 }
 
@@ -2971,8 +2943,6 @@ HRESULT CDECL wined3d_surface_update_overlay(struct wined3d_surface *surface, co
         surface->overlay_dest = NULL;
     }
 
-    surface_draw_overlay(surface);
-
     return WINED3D_OK;
 }
 
@@ -3603,11 +3573,6 @@ HRESULT CDECL wined3d_surface_flip(struct wined3d_surface *surface, struct wined
     }
 
     flip_surface(surface, override);
-
-    /* Update overlays if they're visible. */
-    if ((surface->resource.usage & WINED3DUSAGE_OVERLAY) && surface->overlay_dest)
-        return surface_draw_overlay(surface);
-
     return WINED3D_OK;
 }
 
@@ -5167,20 +5132,9 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
 
 void surface_validate_location(struct wined3d_surface *surface, DWORD location)
 {
-    struct wined3d_surface *overlay;
-
     TRACE("surface %p, location %s.\n", surface, debug_surflocation(location & SFLAG_LOCATIONS));
 
     surface->flags |= (location & SFLAG_LOCATIONS);
-
-    /* Redraw emulated overlays, if any. */
-    if (location & SFLAG_INDRAWABLE && !list_empty(&surface->overlays))
-    {
-        LIST_FOR_EACH_ENTRY(overlay, &surface->overlays, struct wined3d_surface, overlay_entry)
-        {
-            surface_draw_overlay(overlay);
-        }
-    }
 }
 
 void surface_invalidate_location(struct wined3d_surface *surface, DWORD location)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 16fae5a..58b8998 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2292,19 +2292,18 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) D
 #define SFLAG_LOST              0x00000080 /* Surface lost flag for ddraw. */
 #define SFLAG_GLCKEY            0x00000100 /* The GL texture was created with a color key. */
 #define SFLAG_CLIENT            0x00000200 /* GL_APPLE_client_storage is used with this surface. */
-#define SFLAG_INOVERLAYDRAW     0x00000400 /* Overlay drawing is in progress. Recursion prevention. */
-#define SFLAG_DIBSECTION        0x00000800 /* Has a DIB section attached for GetDC. */
-#define SFLAG_USERPTR           0x00001000 /* The application allocated the memory for this surface. */
-#define SFLAG_ALLOCATED         0x00002000 /* A GL texture is allocated for this surface. */
-#define SFLAG_SRGBALLOCATED     0x00004000 /* A sRGB GL texture is allocated for this surface. */
-#define SFLAG_PBO               0x00008000 /* The surface has a PBO. */
-#define SFLAG_INSYSMEM          0x00010000 /* The system memory copy is current. */
-#define SFLAG_INTEXTURE         0x00020000 /* The GL texture is current. */
-#define SFLAG_INSRGBTEX         0x00040000 /* The GL sRGB texture is current. */
-#define SFLAG_INDRAWABLE        0x00080000 /* The GL drawable is current. */
-#define SFLAG_INRB_MULTISAMPLE  0x00100000 /* The multisample renderbuffer is current. */
-#define SFLAG_INRB_RESOLVED     0x00200000 /* The resolved renderbuffer is current. */
-#define SFLAG_DISCARDED         0x00400000 /* Surface was discarded, allocating new location is enough. */
+#define SFLAG_DIBSECTION        0x00000400 /* Has a DIB section attached for GetDC. */
+#define SFLAG_USERPTR           0x00000800 /* The application allocated the memory for this surface. */
+#define SFLAG_ALLOCATED         0x00001000 /* A GL texture is allocated for this surface. */
+#define SFLAG_SRGBALLOCATED     0x00002000 /* A sRGB GL texture is allocated for this surface. */
+#define SFLAG_PBO               0x00004000 /* The surface has a PBO. */
+#define SFLAG_INSYSMEM          0x00008000 /* The system memory copy is current. */
+#define SFLAG_INTEXTURE         0x00010000 /* The GL texture is current. */
+#define SFLAG_INSRGBTEX         0x00020000 /* The GL sRGB texture is current. */
+#define SFLAG_INDRAWABLE        0x00040000 /* The GL drawable is current. */
+#define SFLAG_INRB_MULTISAMPLE  0x00080000 /* The multisample renderbuffer is current. */
+#define SFLAG_INRB_RESOLVED     0x00100000 /* The resolved renderbuffer is current. */
+#define SFLAG_DISCARDED         0x00200000 /* Surface was discarded, allocating new location is enough. */
 
 /* In some conditions the surface memory must not be freed:
  * SFLAG_CONVERTED: Converting the data back would take too long




More information about the wine-cvs mailing list