Module: wine Branch: master Commit: 6d2bd75c4a82d10ee98c63010a5701d428ccc5d0 URL: https://gitlab.winehq.org/wine/wine/-/commit/6d2bd75c4a82d10ee98c63010a5701d...
Author: Alexandros Frantzis alexandros.frantzis@collabora.com Date: Thu Feb 16 18:20:56 2023 +0200
win32u: Reset draw_start_ticks for new window_surface.
Normally, a new window_surface has no damage so its draw_start_ticks value is reset at the time of the first lock_surface.
However, if contents from the old window_surface are copied to the new one when the window_surface for a window is updated, the new window_surface will be initially damaged. We want to reset the draw_start_ticks value in this case too, to avoid flushes occuring soon after such updates, during the initial redraw of the window_surface.
Signed-off-by: Alexandros Frantzis alexandros.frantzis@collabora.com
---
dlls/win32u/dibdrv/dc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/win32u/dibdrv/dc.c b/dlls/win32u/dibdrv/dc.c index f96374c1229..23ef7f64390 100644 --- a/dlls/win32u/dibdrv/dc.c +++ b/dlls/win32u/dibdrv/dc.c @@ -744,7 +744,8 @@ static inline void lock_surface( struct windrv_physdev *dev ) { /* gdi_lock should not be locked */ dev->surface->funcs->lock( dev->surface ); - if (IsRectEmpty( dev->dibdrv->bounds )) dev->surface->draw_start_ticks = NtGetTickCount(); + if (IsRectEmpty( dev->dibdrv->bounds ) || dev->surface->draw_start_ticks == 0) + dev->surface->draw_start_ticks = NtGetTickCount(); }
static inline void unlock_surface( struct windrv_physdev *dev )