Stefan Dösinger : wined3d: Update the overlay when the destination was drawn to.
Alexandre Julliard
julliard at winehq.org
Thu Aug 21 10:02:44 CDT 2008
Module: wine
Branch: master
Commit: bab367e1a0c0f1bbf36f26827efad49b5d37162d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=bab367e1a0c0f1bbf36f26827efad49b5d37162d
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Wed Aug 20 10:48:14 2008 -0500
wined3d: Update the overlay when the destination was drawn to.
---
dlls/wined3d/surface.c | 16 ++++++++++++++++
dlls/wined3d/wined3d_private.h | 1 +
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 9a50e84..3ef659f 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4077,6 +4077,7 @@ void surface_load_ds_location(IWineD3DSurface *iface, DWORD location) {
static void WINAPI IWineD3DSurfaceImpl_ModifyLocation(IWineD3DSurface *iface, DWORD flag, BOOL persistent) {
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
IWineD3DBaseTexture *texture;
+ IWineD3DSurfaceImpl *overlay;
TRACE("(%p)->(%s, %s)\n", iface,
flag == SFLAG_INSYSMEM ? "SFLAG_INSYSMEM" : flag == SFLAG_INDRAWABLE ? "SFLAG_INDRAWABLE" : "SFLAG_INTEXTURE",
@@ -4105,6 +4106,13 @@ static void WINAPI IWineD3DSurfaceImpl_ModifyLocation(IWineD3DSurface *iface, DW
}
This->Flags &= ~SFLAG_LOCATIONS;
This->Flags |= flag;
+
+ /* Redraw emulated overlays, if any */
+ if(flag & SFLAG_INDRAWABLE && !list_empty(&This->overlays)) {
+ LIST_FOR_EACH_ENTRY(overlay, &This->overlays, IWineD3DSurfaceImpl, overlay_entry) {
+ IWineD3DSurface_DrawOverlay((IWineD3DSurface *) overlay);
+ }
+ }
} else {
if((This->Flags & SFLAG_INTEXTURE) && (flag & SFLAG_INTEXTURE)) {
if (IWineD3DSurface_GetContainer(iface, &IID_IWineD3DBaseTexture, (void **)&texture) == WINED3D_OK) {
@@ -4556,9 +4564,17 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_DrawOverlay(IWineD3DSurface *iface) {
/* 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;
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index e2b1215..45d8ace 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1423,6 +1423,7 @@ void flip_surface(IWineD3DSurfaceImpl *front, IWineD3DSurfaceImpl *back);
#define SFLAG_NORMCOORD 0x00080000 /* Set if the GL texture coords are normalized(non-texture rectangle) */
#define SFLAG_DS_ONSCREEN 0x00100000 /* Is a depth stencil, last modified onscreen */
#define SFLAG_DS_OFFSCREEN 0x00200000 /* Is a depth stencil, last modified offscreen */
+#define SFLAG_INOVERLAYDRAW 0x00400000 /* Overlay drawing is in progress. Recursion prevention */
/* In some conditions the surface memory must not be freed:
* SFLAG_OVERSIZE: Not all data can be kept in GL
More information about the wine-cvs
mailing list