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

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

Issue 2848443004: Allow Windows to return a monitor out of the first quadrant (Closed)
Patch Set: TranslateRect() should only be executed once Created 3 years, 8 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
Index: webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.cc
diff --git a/webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.cc b/webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.cc
index 12876c2c89d4612731de10c6e1ba51932f1d8003..576267bbfa6ce93d116de984a6d15b9faec93db1 100644
--- a/webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.cc
+++ b/webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.cc
@@ -194,6 +194,7 @@ bool DxgiDuplicatorController::DoInitialize() {
std::max(left.bottom(), right.bottom()));
}
}
+ TranslateRect();
HDC hdc = GetDC(nullptr);
// Use old DPI value if failed.
@@ -295,7 +296,7 @@ int64_t DxgiDuplicatorController::GetNumFramesCaptured() const {
}
DesktopSize DxgiDuplicatorController::desktop_size() const {
- return DesktopSize(desktop_rect_.right(), desktop_rect_.bottom());
+ return desktop_rect_.size();
}
DesktopRect DxgiDuplicatorController::ScreenRect(int id) const {
@@ -378,4 +379,13 @@ bool DxgiDuplicatorController::EnsureFrameCaptured(Context* context,
return true;
}
+void DxgiDuplicatorController::TranslateRect() {
+ const DesktopVector position =
+ DesktopVector().subtract(desktop_rect_.top_left());
+ desktop_rect_.Translate(position);
+ for (auto& duplicator : duplicators_) {
+ duplicator.TranslateRect(position);
+ }
+}
+
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698