Chromium Code Reviews| Index: webrtc/modules/desktop_capture/win/dxgi_frame.cc |
| diff --git a/webrtc/modules/desktop_capture/win/dxgi_frame.cc b/webrtc/modules/desktop_capture/win/dxgi_frame.cc |
| index 0ba678dd0ad21d24831fbff0a87dc24eebd8e3b6..e6bda29bf987cf7fbf9603f081a0052d70bafb4b 100644 |
| --- a/webrtc/modules/desktop_capture/win/dxgi_frame.cc |
| +++ b/webrtc/modules/desktop_capture/win/dxgi_frame.cc |
| @@ -40,6 +40,11 @@ bool DxgiFrame::Prepare(DesktopSize size, DesktopCapturer::SourceId source_id) { |
| std::unique_ptr<DesktopFrame> frame; |
| if (factory_) { |
| frame = SharedMemoryDesktopFrame::Create(size, factory_); |
| + // DirectX capturer won't paint each pixel in the frame due to its one |
| + // capturer per monitor design. So once the new frame is created from |
| + // shared memory, we should clear it to avoid the legacy image to be |
| + // remained on it. See http://crbug.com/708766. |
| + memset(frame->data(), 0, frame->stride() * frame->size().height()); |
|
Sergey Ulanov
2017/04/20 22:01:10
I don't think it matters if it's a sharedmemory or
Hzj_jie
2017/04/20 22:48:58
Sorry, I always under the impression that we are u
|
| } else { |
| frame.reset(new BasicDesktopFrame(size)); |
| } |