Chromium Code Reviews| Index: webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc |
| diff --git a/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc b/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc |
| index 80d2da55de20069900af55b2680eb2a4f88c5554..5faacd5f620e8374a1f59d65410b113d5c7fd3cf 100644 |
| --- a/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc |
| +++ b/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc |
| @@ -20,7 +20,6 @@ |
| #include "webrtc/modules/desktop_capture/desktop_frame.h" |
| #include "webrtc/modules/desktop_capture/desktop_frame_win.h" |
| #include "webrtc/modules/desktop_capture/desktop_region.h" |
| -#include "webrtc/modules/desktop_capture/differ.h" |
| #include "webrtc/modules/desktop_capture/mouse_cursor.h" |
| #include "webrtc/modules/desktop_capture/win/cursor.h" |
| #include "webrtc/modules/desktop_capture/win/desktop.h" |
| @@ -86,41 +85,14 @@ void ScreenCapturerWinGdi::Capture(const DesktopRegion& region) { |
| return; |
| } |
| - const DesktopFrame* current_frame = queue_.current_frame(); |
| - const DesktopFrame* last_frame = queue_.previous_frame(); |
| - if (last_frame && last_frame->size().equals(current_frame->size())) { |
| - // Make sure the differencer is set up correctly for these previous and |
| - // current screens. |
| - if (!differ_.get() || |
| - (differ_->width() != current_frame->size().width()) || |
| - (differ_->height() != current_frame->size().height()) || |
| - (differ_->bytes_per_row() != current_frame->stride())) { |
| - differ_.reset(new Differ(current_frame->size().width(), |
| - current_frame->size().height(), |
| - DesktopFrame::kBytesPerPixel, |
| - current_frame->stride())); |
| - } |
| - |
| - // Calculate difference between the two last captured frames. |
| - DesktopRegion region; |
| - differ_->CalcDirtyRegion(last_frame->data(), current_frame->data(), |
| - ®ion); |
| - helper_.InvalidateRegion(region); |
| - } else { |
| - // No previous frame is available, or the screen is resized. Invalidate the |
| - // whole screen. |
| - helper_.InvalidateScreen(current_frame->size()); |
| - } |
| - |
| - helper_.set_size_most_recent(current_frame->size()); |
| - |
| // Emit the current frame. |
| std::unique_ptr<DesktopFrame> frame = queue_.current_frame()->Share(); |
| frame->set_dpi(DesktopVector( |
| GetDeviceCaps(desktop_dc_, LOGPIXELSX), |
| GetDeviceCaps(desktop_dc_, LOGPIXELSY))); |
| - frame->mutable_updated_region()->Clear(); |
| - helper_.TakeInvalidRegion(frame->mutable_updated_region()); |
| + // ScreenCapturerDifferWrapper will help to detect updated region if needed. |
|
Sergey Ulanov
2016/09/22 18:25:08
I suggest adding a comment in screen_capturer_win_
Hzj_jie
2016/09/22 21:01:34
Done.
|
| + frame->mutable_updated_region()->SetRect( |
| + DesktopRect::MakeSize(frame->size())); |
| frame->set_capture_time_ms( |
| (rtc::TimeNanos() - capture_start_time_nanos) / |
| rtc::kNumNanosecsPerMillisec); |
| @@ -212,8 +184,6 @@ void ScreenCapturerWinGdi::PrepareCaptureResources() { |
| // Make sure the frame buffers will be reallocated. |
| queue_.Reset(); |
| - |
| - helper_.ClearInvalidRegion(); |
| } |
| } |