[vlc-commits] vout:win32: we don't need to update the visible area of the window

Steve Lhomme git at videolan.org
Mon Apr 1 16:50:07 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Mar 25 12:10:15 2019 +0100| [e4eb21047a768fd20d70d594077e9b4e0ba7293a] | committer: Steve Lhomme

vout:win32: we don't need to update the visible area of the window

If anything the HWND handler knows the size better, but it's not used after
creating the window.

We also don't care about the position of the window in the screen to compute
the rect_dest.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e4eb21047a768fd20d70d594077e9b4e0ba7293a
---

 modules/video_output/win32/common.c | 24 ++++--------------------
 modules/video_output/win32/events.c |  7 -------
 modules/video_output/win32/events.h |  1 -
 3 files changed, 4 insertions(+), 28 deletions(-)

diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index b02a66a8a1..303ab5c433 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -152,7 +152,6 @@ void UpdateRects(vout_display_t *vd, vout_display_sys_win32_t *sys, bool is_forc
     const video_format_t *source = &vd->source;
 
     UINT  display_width, display_height;
-    POINT point = { 0 };
 
     /* */
     const vout_display_cfg_t *cfg = &sys->vdcfg;
@@ -165,21 +164,6 @@ void UpdateRects(vout_display_t *vd, vout_display_sys_win32_t *sys, bool is_forc
     }
 
     /* If nothing changed, we can return */
-#if !VLC_WINSTORE_APP
-    if (!sys->b_windowless)
-    {
-        /* Retrieve the window position */
-        ClientToScreen(sys->hwnd, &point);
-
-        RECT rect = {
-            .left   = point.x,
-            .right  = point.x + display_width,
-            .top    = point.y,
-            .bottom = point.y + display_height,
-        };
-        EventThreadUpdateWindowPosition(sys->event, &rect);
-    }
-#endif /* !VLC_WINSTORE_APP */
     bool resized = display_width  != sys->display_width ||
                    display_height != sys->display_height;
     sys->display_width = display_width;
@@ -223,10 +207,10 @@ void UpdateRects(vout_display_t *vd, vout_display_sys_win32_t *sys, bool is_forc
 #define rect_dest           sys->rect_dest
     RECT before_rect_dest = rect_dest;
     /* Destination image position and dimensions */
-    rect_dest.left = point.x + place.x;
-    rect_dest.right = rect_dest.left + place.width;
-    rect_dest.top = point.y + place.y;
-    rect_dest.bottom = rect_dest.top + place.height;
+    rect_dest.left   = place.x;
+    rect_dest.right  = place.x + place.width;
+    rect_dest.top    = place.y;
+    rect_dest.bottom = place.y + place.height;
 
     /* Signal the change in size/position */
     if (!EqualRect(&before_rect_dest, &rect_dest))
diff --git a/modules/video_output/win32/events.c b/modules/video_output/win32/events.c
index 1af265712a..8fb0af9185 100644
--- a/modules/video_output/win32/events.c
+++ b/modules/video_output/win32/events.c
@@ -408,13 +408,6 @@ int EventThreadGetWindowStyle( event_thread_t *p_event )
     return p_event->i_window_style;
 }
 
-void EventThreadUpdateWindowPosition( event_thread_t *p_event, const RECT *area )
-{
-    vlc_mutex_lock( &p_event->lock );
-    p_event->window_area = *area;
-    vlc_mutex_unlock( &p_event->lock );
-}
-
 void EventThreadUpdateSourceAndPlace( event_thread_t *p_event,
                                       const video_format_t *p_source,
                                       const vout_display_place_t *p_place )
diff --git a/modules/video_output/win32/events.h b/modules/video_output/win32/events.h
index 04b69b69ee..1570c283fa 100644
--- a/modules/video_output/win32/events.h
+++ b/modules/video_output/win32/events.h
@@ -52,7 +52,6 @@ void            EventThreadStop( event_thread_t * );
 
 void            EventThreadUpdateTitle( event_thread_t *, const char *psz_fallback );
 int             EventThreadGetWindowStyle( event_thread_t * );
-void            EventThreadUpdateWindowPosition( event_thread_t *, const RECT * );
 void            EventThreadUpdateSourceAndPlace( event_thread_t *p_event,
                                                  const video_format_t *p_source,
                                                  const vout_display_place_t *p_place );



More information about the vlc-commits mailing list