Henri Verbeet : wined3d: Remove IWineD3DSurface::DrawOverlay() from the public interface.

Alexandre Julliard julliard at winehq.org
Mon Jan 24 11:07:36 CST 2011


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon Jan 24 11:19:38 2011 +0100

wined3d: Remove IWineD3DSurface::DrawOverlay() from the public interface.

---

 dlls/wined3d/surface.c         |   60 ++++++++++++++++++++--------------------
 dlls/wined3d/surface_base.c    |    4 +-
 dlls/wined3d/surface_gdi.c     |   13 ++++----
 dlls/wined3d/wined3d_private.h |    1 +
 include/wine/wined3d.idl       |    2 -
 5 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 658e3fc..2300a68 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -386,9 +386,32 @@ static void surface_realize_palette(IWineD3DSurfaceImpl *surface)
         surface_load_location(surface, SFLAG_INDRAWABLE, NULL);
 }
 
+static HRESULT surface_draw_overlay(IWineD3DSurfaceImpl *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 = IWineD3DSurface_Blt((IWineD3DSurface *)surface->overlay_dest,
+            &surface->overlay_destrect, (IWineD3DSurface *)surface, &surface->overlay_srcrect,
+            WINEDDBLT_WAIT, NULL, WINED3DTEXF_LINEAR);
+    surface->overlay_dest->flags &= ~SFLAG_INOVERLAYDRAW;
+
+    return hr;
+}
+
 static const struct wined3d_surface_ops surface_ops =
 {
     surface_realize_palette,
+    surface_draw_overlay,
 };
 
 HRESULT surface_init(IWineD3DSurfaceImpl *surface, WINED3DSURFTYPE surface_type, UINT alignment,
@@ -2070,9 +2093,9 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_Unmap(IWineD3DSurface *iface)
     memset(&This->lockedRect, 0, sizeof(RECT));
 
     /* Overlays have to be redrawn manually after changes with the GL implementation */
-    if(This->overlay_dest) {
-        IWineD3DSurface_DrawOverlay(iface);
-    }
+    if (This->overlay_dest)
+        This->surface_ops->surface_draw_overlay(This);
+
     return WINED3D_OK;
 }
 
@@ -2775,11 +2798,10 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_Flip(IWineD3DSurface *iface, IWineD3DS
         flip_surface(This, (IWineD3DSurfaceImpl *) override);
 
         /* Update the overlay if it is visible */
-        if(This->overlay_dest) {
-            return IWineD3DSurface_DrawOverlay((IWineD3DSurface *) This);
-        } else {
+        if (This->overlay_dest)
+            return This->surface_ops->surface_draw_overlay(This);
+        else
             return WINED3D_OK;
-        }
     }
 
     if(override) {
@@ -4306,7 +4328,7 @@ void surface_modify_location(IWineD3DSurfaceImpl *surface, DWORD flag, BOOL pers
         {
             LIST_FOR_EACH_ENTRY(overlay, &surface->overlays, IWineD3DSurfaceImpl, overlay_entry)
             {
-                IWineD3DSurface_DrawOverlay((IWineD3DSurface *)overlay);
+                overlay->surface_ops->surface_draw_overlay(overlay);
             }
         }
     }
@@ -4641,27 +4663,6 @@ static WINED3DSURFTYPE WINAPI IWineD3DSurfaceImpl_GetImplType(IWineD3DSurface *i
     return SURFACE_OPENGL;
 }
 
-static HRESULT WINAPI IWineD3DSurfaceImpl_DrawOverlay(IWineD3DSurface *iface) {
-    IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
-    HRESULT hr;
-
-    /* If there's no destination surface there is nothing to do */
-    if(!This->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 (This->overlay_dest->flags & SFLAG_INOVERLAYDRAW)
-        return WINED3D_OK;
-
-    This->overlay_dest->flags |= SFLAG_INOVERLAYDRAW;
-    hr = IWineD3DSurfaceImpl_Blt((IWineD3DSurface *)This->overlay_dest,
-            &This->overlay_destrect, iface, &This->overlay_srcrect,
-            WINEDDBLT_WAIT, NULL, WINED3DTEXF_LINEAR);
-    This->overlay_dest->flags &= ~SFLAG_INOVERLAYDRAW;
-
-    return hr;
-}
-
 BOOL surface_is_offscreen(IWineD3DSurfaceImpl *surface)
 {
     IWineD3DSwapChainImpl *swapchain = surface->container.u.swapchain;
@@ -4721,7 +4722,6 @@ const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl =
     IWineD3DSurfaceImpl_SetFormat,
     IWineD3DSurfaceImpl_PrivateSetup,
     IWineD3DSurfaceImpl_GetImplType,
-    IWineD3DSurfaceImpl_DrawOverlay
 };
 
 static HRESULT ffp_blit_alloc(IWineD3DDeviceImpl *device) { return WINED3D_OK; }
diff --git a/dlls/wined3d/surface_base.c b/dlls/wined3d/surface_base.c
index cad2caf..ae7e441 100644
--- a/dlls/wined3d/surface_base.c
+++ b/dlls/wined3d/surface_base.c
@@ -357,7 +357,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetOverlayPosition(IWineD3DSurface *iface
     This->overlay_destrect.right = X + w;
     This->overlay_destrect.bottom = Y + h;
 
-    IWineD3DSurface_DrawOverlay(iface);
+    This->surface_ops->surface_draw_overlay(This);
 
     return WINED3D_OK;
 }
@@ -462,7 +462,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_UpdateOverlay(IWineD3DSurface *iface, con
         This->overlay_dest = NULL;
     }
 
-    IWineD3DSurface_DrawOverlay(iface);
+    This->surface_ops->surface_draw_overlay(This);
 
     return WINED3D_OK;
 }
diff --git a/dlls/wined3d/surface_gdi.c b/dlls/wined3d/surface_gdi.c
index c564285..9a729fb 100644
--- a/dlls/wined3d/surface_gdi.c
+++ b/dlls/wined3d/surface_gdi.c
@@ -95,9 +95,16 @@ static void gdi_surface_realize_palette(IWineD3DSurfaceImpl *surface)
     }
 }
 
+static HRESULT gdi_surface_draw_overlay(IWineD3DSurfaceImpl *surface)
+{
+    FIXME("GDI surfaces can't draw overlays yet.\n");
+    return E_FAIL;
+}
+
 static const struct wined3d_surface_ops gdi_surface_ops =
 {
     gdi_surface_realize_palette,
+    gdi_surface_draw_overlay,
 };
 
 /*****************************************************************************
@@ -439,11 +446,6 @@ static WINED3DSURFTYPE WINAPI IWineGDISurfaceImpl_GetImplType(IWineD3DSurface *i
     return SURFACE_GDI;
 }
 
-static HRESULT WINAPI IWineGDISurfaceImpl_DrawOverlay(IWineD3DSurface *iface) {
-    FIXME("GDI surfaces can't draw overlays yet\n");
-    return E_FAIL;
-}
-
 /* FIXME: This vtable should not use any IWineD3DSurface* implementation functions,
  * only IWineD3DBaseSurface and IWineGDISurface ones.
  */
@@ -491,5 +493,4 @@ const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl =
     IWineD3DBaseSurfaceImpl_SetFormat,
     IWineGDISurfaceImpl_PrivateSetup,
     IWineGDISurfaceImpl_GetImplType,
-    IWineGDISurfaceImpl_DrawOverlay
 };
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 68e4734..96b845f 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2091,6 +2091,7 @@ struct wined3d_subresource_container
 struct wined3d_surface_ops
 {
     void (*surface_realize_palette)(struct IWineD3DSurfaceImpl *surface);
+    HRESULT (*surface_draw_overlay)(struct IWineD3DSurfaceImpl *surface);
 };
 
 /*****************************************************************************
diff --git a/include/wine/wined3d.idl b/include/wine/wined3d.idl
index b99fb4d..523d7fc 100644
--- a/include/wine/wined3d.idl
+++ b/include/wine/wined3d.idl
@@ -2467,8 +2467,6 @@ interface IWineD3DSurface : IWineD3DResource
     );
     WINED3DSURFTYPE GetImplType(
     );
-    HRESULT DrawOverlay(
-    );
 }
 
 [




More information about the wine-cvs mailing list