[vlc-devel] [PATCH 26/41] vout:gdi: use the source visible area directly

Steve Lhomme robux4 at ycbcr.xyz
Fri Mar 22 16:14:04 CET 2019


Instead of using source_visible_rect.

It doesn't matter if the display width/height is 0, we'll end up copying nothing.
---
 modules/video_output/win32/wingdi.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/modules/video_output/win32/wingdi.c b/modules/video_output/win32/wingdi.c
index e2774ee9b1..a2ce1696c5 100644
--- a/modules/video_output/win32/wingdi.c
+++ b/modules/video_output/win32/wingdi.c
@@ -151,30 +151,29 @@ static void Display(vout_display_t *vd, picture_t *picture)
     vout_display_sys_t *sys = vd->sys;
     VLC_UNUSED(picture);
 
-#define source_visible_rect sys->sys.area.source_visible_rect
 #define rect_dest           sys->sys.area.rect_dest
     HDC hdc = GetDC(sys->sys.hvideownd);
 
     SelectObject(sys->off_dc, sys->off_bitmap);
 
-    if (RECTWidth(rect_dest) != RECTWidth(source_visible_rect) ||
-        RECTHeight(rect_dest) != RECTHeight(source_visible_rect)) {
+    if (RECTWidth(rect_dest) != vd->source.i_visible_width ||
+        RECTHeight(rect_dest) != vd->source.i_visible_height) {
         StretchBlt(hdc, 0, 0,
                    RECTWidth(rect_dest), RECTHeight(rect_dest),
                    sys->off_dc,
-                   source_visible_rect.left,  source_visible_rect.top,
-                   source_visible_rect.right, source_visible_rect.bottom,
+                   vd->source.i_x_offset, vd->source.i_y_offset,
+                   vd->source.i_x_offset + vd->source.i_visible_width,
+                   vd->source.i_y_offset + vd->source.i_visible_height,
                    SRCCOPY);
     } else {
         BitBlt(hdc, 0, 0,
                RECTWidth(rect_dest), RECTHeight(rect_dest),
                sys->off_dc,
-               source_visible_rect.left, source_visible_rect.top,
+               vd->source.i_x_offset, vd->source.i_y_offset,
                SRCCOPY);
     }
 
     ReleaseDC(sys->sys.hvideownd, hdc);
-#undef source_visible_rect
 #undef rect_dest
 
     CommonDisplay(&sys->sys);
-- 
2.17.1



More information about the vlc-devel mailing list