DirectDraw surface flipping

Jukka Heinonen jhei at iki.fi
Wed Oct 17 05:23:56 CDT 2001


DirectDraw surface handling had a funny bug when background surface
was flipped with primary surface: the new primary surface kept
the damage region from the last unlock command which means that
only part of the background buffer was really displayed to the user.
Since there is no easy way to know how much content primary surface and 
background surface are sharing, it is better to mark the whole
primary surface damaged. DirectDraw version 8 and above might
provide a way to figure out the proper damage region.

As a side note, it seems that the update logic in user.c
is broken unless SYNC_UPDATE is used. This is because
screen update thread and lock_update routine both access the 
damage region and if more than one lock/unlock pair happens
between update thread blits, display might not be updated correctly.

Changelog:
  When a surface becomes primary surface, mark the whole surface damaged.

Index: wine/dlls/ddraw/dsurface/user.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/dsurface/user.c,v
retrieving revision 1.7
diff -u -r1.7 user.c
--- wine/dlls/ddraw/dsurface/user.c     2001/09/10 23:12:16     1.7
+++ wine/dlls/ddraw/dsurface/user.c     2001/10/17 08:35:00
@@ -256,10 +256,12 @@
 void User_DirectDrawSurface_flip_update(IDirectDrawSurfaceImpl* This, DWORD dwFlags)
 {
 #ifdef SYNC_UPDATE
+    This->lastlockrect.left = This->lastlockrect.right = 0;
     assert(This->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE);
     User_copy_to_screen(This,NULL);
 #else
     USER_PRIV_VAR(priv, This);
+    This->lastlockrect.left = This->lastlockrect.right = 0;
     assert(This->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE);
     SetEvent(priv->user.update_event);
 #endif


-- 
Jukka Heinonen <http://www.iki.fi/jhei/>




More information about the wine-patches mailing list