Commit dff3a422 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Track overlay surfaces in the overlayed surface.

parent b0c46737
......@@ -660,6 +660,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, U
object->currentDesc.MultiSampleType = MultiSample;
object->currentDesc.MultiSampleQuality = MultisampleQuality;
object->glDescription.level = Level;
list_init(&object->overlays);
/* Flags */
object->Flags = SFLAG_NORMCOORD; /* Default to normalized coords */
......
......@@ -474,6 +474,10 @@ ULONG WINAPI IWineD3DSurfaceImpl_Release(IWineD3DSurface *iface) {
if(iface == device->ddraw_primary)
device->ddraw_primary = NULL;
if(This->overlay_dest) {
list_remove(&This->overlay_entry);
}
TRACE("(%p) Released\n", This);
HeapFree(GetProcessHeap(), 0, This);
......
......@@ -450,9 +450,15 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_UpdateOverlay(IWineD3DSurface *iface, REC
This->overlay_destrect.bottom = Dst ? Dst->currentDesc.Height : 0;
}
if(Flags & WINEDDOVER_SHOW) {
This->overlay_dest = Dst;
if(This->overlay_dest && (This->overlay_dest != Dst || Flags & WINEDDOVER_HIDE)) {
list_remove(&This->overlay_entry);
}
if(Flags & WINEDDOVER_SHOW) {
if(This->overlay_dest != Dst) {
This->overlay_dest = Dst;
list_add_tail(&Dst->overlays, &This->overlay_entry);
}
} else if(Flags & WINEDDOVER_HIDE) {
/* tests show that the rectangles are erased on hide */
This->overlay_srcrect.left = 0; This->overlay_srcrect.top = 0;
......
......@@ -160,6 +160,10 @@ ULONG WINAPI IWineGDISurfaceImpl_Release(IWineD3DSurface *iface) {
if(iface == device->ddraw_primary)
device->ddraw_primary = NULL;
if(This->overlay_dest) {
list_remove(&This->overlay_entry);
}
TRACE("(%p) Released\n", This);
HeapFree(GetProcessHeap(), 0, This);
......
......@@ -1331,6 +1331,8 @@ struct IWineD3DSurfaceImpl
RECT overlay_srcrect;
RECT overlay_destrect;
IWineD3DSurfaceImpl *overlay_dest;
struct list overlays;
struct list overlay_entry;
};
extern const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment