Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc

Issue 2348803003: Remove differ from ScreenCapturer implementations (Closed)
Patch Set: Comment on the XDamage scenario in screen_capturer_x11.cc Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc
diff --git a/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc b/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc
index e22b272d145ea3a4072adc027c20c325bf9e6427..e5a37c97d50d0b6526d836c8bcff070b9411a35b 100644
--- a/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc
+++ b/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc
@@ -18,7 +18,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"
@@ -116,33 +115,12 @@ void ScreenCapturerWinMagnifier::Capture(const DesktopRegion& region) {
return;
}
- const DesktopFrame* current_frame = queue_.current_frame();
- const DesktopFrame* last_frame = queue_.previous_frame();
- DesktopRegion updated_region;
- 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.
- differ_->CalcDirtyRegion(
- last_frame->data(), current_frame->data(), &updated_region);
- } else {
- updated_region.SetRect(DesktopRect::MakeSize(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()->Swap(&updated_region);
+ frame->mutable_updated_region()->SetRect(
+ DesktopRect::MakeSize(frame->size()));
frame->set_capture_time_ms((rtc::TimeNanos() - capture_start_time_nanos) /
rtc::kNumNanosecsPerMillisec);
callback_->OnCaptureResult(Result::SUCCESS, std::move(frame));
« no previous file with comments | « webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698