From f0fc72f70eb9a63565a528aed0c93f9a913cc029 Mon Sep 17 00:00:00 2001 From: "jiayl@webrtc.org" Date: Thu, 27 Feb 2014 16:43:12 +0000 Subject: [PATCH] Call PrintWindow for the first time of capturing to capture the window frames correctly. This will fix artifacts on the captured window frames, especially for cmd, which sometimes leaks glimpss of other window's content. BUG= R=sergeyu@chromium.org Review URL: https://webrtc-codereview.appspot.com/8989004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5616 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/modules/desktop_capture/window_capturer_win.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webrtc/modules/desktop_capture/window_capturer_win.cc b/webrtc/modules/desktop_capture/window_capturer_win.cc index d65c625ea2..7e2859f692 100644 --- a/webrtc/modules/desktop_capture/window_capturer_win.cc +++ b/webrtc/modules/desktop_capture/window_capturer_win.cc @@ -217,11 +217,11 @@ void WindowCapturerWin::Capture(const DesktopRegion& region) { // When composition is enabled the DC returned by GetWindowDC() doesn't always // have window frame rendered correctly. Windows renders it only once and then // caches the result between captures. We hack it around by calling - // PrintWindow() whenever window size changes - it somehow affects what we - // get from BitBlt() on the subsequent captures. + // PrintWindow() whenever window size changes, including the first time of + // capturing - it somehow affects what we get from BitBlt() on the subsequent + // captures. - if (!IsAeroEnabled() || - (!previous_size_.is_empty() && !previous_size_.equals(frame->size()))) { + if (!IsAeroEnabled() || !previous_size_.equals(frame->size())) { result = PrintWindow(window_, mem_dc, 0); }