wined3d: Track overlay surfaces in the overlayed surface.

This commit is contained in:
Stefan Dösinger 2008-07-30 15:28:25 -05:00 committed by Alexandre Julliard
parent b0c4673779
commit dff3a42233
5 changed files with 19 additions and 2 deletions

View File

@ -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 */

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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;