[vlc-commits] vout:gdi: simplify the blitting code

Steve Lhomme git at videolan.org
Fri Mar 29 17:31:35 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Mar 22 11:18:33 2019 +0100| [3b794b954e66f1bcfbe8db05bcf61d26a0577ed8] | committer: Steve Lhomme

vout:gdi: simplify the blitting code

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.

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

 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 41c6bacfab..a4ec42f840 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 vd->sys->sys.rect_src_clipped
 #define rect_dest vd->sys->sys.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);



More information about the vlc-commits mailing list