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

This commit is contained in:
Henri Verbeet 2011-01-24 11:19:38 +01:00 committed by Alexandre Julliard
parent 05603c4568
commit 4891ca168e
5 changed files with 40 additions and 40 deletions

View File

@ -386,9 +386,32 @@ static void surface_realize_palette(IWineD3DSurfaceImpl *surface)
surface_load_location(surface, SFLAG_INDRAWABLE, NULL); 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 = static const struct wined3d_surface_ops surface_ops =
{ {
surface_realize_palette, surface_realize_palette,
surface_draw_overlay,
}; };
HRESULT surface_init(IWineD3DSurfaceImpl *surface, WINED3DSURFTYPE surface_type, UINT alignment, 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)); memset(&This->lockedRect, 0, sizeof(RECT));
/* Overlays have to be redrawn manually after changes with the GL implementation */ /* Overlays have to be redrawn manually after changes with the GL implementation */
if(This->overlay_dest) { if (This->overlay_dest)
IWineD3DSurface_DrawOverlay(iface); This->surface_ops->surface_draw_overlay(This);
}
return WINED3D_OK; return WINED3D_OK;
} }
@ -2775,11 +2798,10 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_Flip(IWineD3DSurface *iface, IWineD3DS
flip_surface(This, (IWineD3DSurfaceImpl *) override); flip_surface(This, (IWineD3DSurfaceImpl *) override);
/* Update the overlay if it is visible */ /* Update the overlay if it is visible */
if(This->overlay_dest) { if (This->overlay_dest)
return IWineD3DSurface_DrawOverlay((IWineD3DSurface *) This); return This->surface_ops->surface_draw_overlay(This);
} else { else
return WINED3D_OK; return WINED3D_OK;
}
} }
if(override) { 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) 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; 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) BOOL surface_is_offscreen(IWineD3DSurfaceImpl *surface)
{ {
IWineD3DSwapChainImpl *swapchain = surface->container.u.swapchain; IWineD3DSwapChainImpl *swapchain = surface->container.u.swapchain;
@ -4721,7 +4722,6 @@ const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl =
IWineD3DSurfaceImpl_SetFormat, IWineD3DSurfaceImpl_SetFormat,
IWineD3DSurfaceImpl_PrivateSetup, IWineD3DSurfaceImpl_PrivateSetup,
IWineD3DSurfaceImpl_GetImplType, IWineD3DSurfaceImpl_GetImplType,
IWineD3DSurfaceImpl_DrawOverlay
}; };
static HRESULT ffp_blit_alloc(IWineD3DDeviceImpl *device) { return WINED3D_OK; } static HRESULT ffp_blit_alloc(IWineD3DDeviceImpl *device) { return WINED3D_OK; }

View File

@ -357,7 +357,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetOverlayPosition(IWineD3DSurface *iface
This->overlay_destrect.right = X + w; This->overlay_destrect.right = X + w;
This->overlay_destrect.bottom = Y + h; This->overlay_destrect.bottom = Y + h;
IWineD3DSurface_DrawOverlay(iface); This->surface_ops->surface_draw_overlay(This);
return WINED3D_OK; return WINED3D_OK;
} }
@ -462,7 +462,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_UpdateOverlay(IWineD3DSurface *iface, con
This->overlay_dest = NULL; This->overlay_dest = NULL;
} }
IWineD3DSurface_DrawOverlay(iface); This->surface_ops->surface_draw_overlay(This);
return WINED3D_OK; return WINED3D_OK;
} }

View File

@ -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 = static const struct wined3d_surface_ops gdi_surface_ops =
{ {
gdi_surface_realize_palette, gdi_surface_realize_palette,
gdi_surface_draw_overlay,
}; };
/***************************************************************************** /*****************************************************************************
@ -439,11 +446,6 @@ static WINED3DSURFTYPE WINAPI IWineGDISurfaceImpl_GetImplType(IWineD3DSurface *i
return SURFACE_GDI; 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, /* FIXME: This vtable should not use any IWineD3DSurface* implementation functions,
* only IWineD3DBaseSurface and IWineGDISurface ones. * only IWineD3DBaseSurface and IWineGDISurface ones.
*/ */
@ -491,5 +493,4 @@ const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl =
IWineD3DBaseSurfaceImpl_SetFormat, IWineD3DBaseSurfaceImpl_SetFormat,
IWineGDISurfaceImpl_PrivateSetup, IWineGDISurfaceImpl_PrivateSetup,
IWineGDISurfaceImpl_GetImplType, IWineGDISurfaceImpl_GetImplType,
IWineGDISurfaceImpl_DrawOverlay
}; };

View File

@ -2091,6 +2091,7 @@ struct wined3d_subresource_container
struct wined3d_surface_ops struct wined3d_surface_ops
{ {
void (*surface_realize_palette)(struct IWineD3DSurfaceImpl *surface); void (*surface_realize_palette)(struct IWineD3DSurfaceImpl *surface);
HRESULT (*surface_draw_overlay)(struct IWineD3DSurfaceImpl *surface);
}; };
/***************************************************************************** /*****************************************************************************

View File

@ -2467,8 +2467,6 @@ interface IWineD3DSurface : IWineD3DResource
); );
WINED3DSURFTYPE GetImplType( WINED3DSURFTYPE GetImplType(
); );
HRESULT DrawOverlay(
);
} }
[ [