[vlc-devel] [PATCH 18/41] vout:gdi: simplify the blitting code

Steve Lhomme robux4 at ycbcr.xyz
Fri Mar 22 16:13:56 CET 2019


The extra RECT is not needed as it's moved back to 0,0. So we use 0,0 for the
top/left and the width/height of the RECT for the right/bottom.
---
 modules/video_output/win32/wingdi.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/modules/video_output/win32/wingdi.c b/modules/video_output/win32/wingdi.c
index a994a6bef9..6a66c75f16 100644
--- a/modules/video_output/win32/wingdi.c
+++ b/modules/video_output/win32/wingdi.c
@@ -147,23 +147,21 @@ static void Display(vout_display_t *vd, picture_t *picture)
 
 #define rect_src_clipped sys->sys.area.rect_src_clipped
 #define rect_dest sys->sys.area.rect_dest
-    RECT dst_rect = rect_dest;
     HDC hdc = GetDC(sys->sys.hvideownd);
 
-    OffsetRect(&dst_rect, -rect_dest.left, -rect_dest.top);
     SelectObject(sys->off_dc, sys->off_bitmap);
 
     if (RECTWidth(rect_dest) != RECTWidth(rect_src_clipped) ||
         RECTHeight(rect_dest) != RECTHeight(rect_src_clipped)) {
-        StretchBlt(hdc, dst_rect.left, dst_rect.top,
-                   dst_rect.right, dst_rect.bottom,
+        StretchBlt(hdc, 0, 0,
+                   RECTWidth(rect_dest), RECTHeight(rect_dest),
                    sys->off_dc,
                    rect_src_clipped.left,  rect_src_clipped.top,
                    rect_src_clipped.right, rect_src_clipped.bottom,
                    SRCCOPY);
     } else {
-        BitBlt(hdc, dst_rect.left, dst_rect.top,
-               dst_rect.right, dst_rect.bottom,
+        BitBlt(hdc, 0, 0,
+               RECTWidth(rect_dest), RECTHeight(rect_dest),
                sys->off_dc,
                rect_src_clipped.left, rect_src_clipped.top,
                SRCCOPY);
-- 
2.17.1



More information about the vlc-devel mailing list