[vlc-commits] vout:win32: simplify the rect_src_clipped computing

Steve Lhomme git at videolan.org
Mon Apr 1 12:03:22 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Mar 22 13:17:33 2019 +0100| [f4fb0ddd05c31f0b13af8a3212b8e9843716c8bd] | committer: Steve Lhomme

vout:win32: simplify the rect_src_clipped computing

Since rect_dest_clipped = rect_dest it's always the source visible area.

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

 modules/video_output/win32/common.c | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index 4df73be3a8..85cf30e6e1 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -243,20 +243,10 @@ void UpdateRects(vout_display_t *vd, vout_display_sys_win32_t *sys, bool is_forc
     rect_src.bottom = sys->pf_GetPictureHeight(vd);
 
     /* Clip the source image */
-    rect_src_clipped.left = source->i_x_offset +
-        (rect_dest.left - rect_dest.left) *
-        source->i_visible_width / RECTWidth(rect_dest);
-    rect_src_clipped.right = source->i_x_offset +
-        source->i_visible_width -
-        (rect_dest.right - rect_dest.right) *
-        source->i_visible_width / RECTWidth(rect_dest);
-    rect_src_clipped.top = source->i_y_offset +
-        (rect_dest.top - rect_dest.top) *
-        source->i_visible_height / RECTHeight(rect_dest);
-    rect_src_clipped.bottom = source->i_y_offset +
-        source->i_visible_height -
-        (rect_dest.bottom - rect_dest.bottom) *
-        source->i_visible_height / RECTHeight(rect_dest);
+    rect_src_clipped.left   = source->i_x_offset;
+    rect_src_clipped.right  = source->i_x_offset + source->i_visible_width;
+    rect_src_clipped.top    = source->i_y_offset;
+    rect_src_clipped.bottom = source->i_y_offset + source->i_visible_height;
 
 #ifndef NDEBUG
     msg_Dbg(vd, "DirectXUpdateRects source"
@@ -267,10 +257,6 @@ void UpdateRects(vout_display_t *vd, vout_display_sys_win32_t *sys, bool is_forc
         " coords: %li,%li,%li,%li",
         rect_src.left, rect_src.top,
         rect_src.right, rect_src.bottom);
-    msg_Dbg(vd, "DirectXUpdateRects image_src_clipped"
-        " coords: %li,%li,%li,%li",
-        rect_src_clipped.left, rect_src_clipped.top,
-        rect_src_clipped.right, rect_src_clipped.bottom);
     msg_Dbg(vd, "DirectXUpdateRects image_dst"
         " coords: %li,%li,%li,%li",
         rect_dest.left, rect_dest.top,



More information about the vlc-commits mailing list