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

Unified Diff: webrtc/modules/desktop_capture/win/dxgi_adapter_duplicator.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_adapter_duplicator.cc
diff --git a/webrtc/modules/desktop_capture/win/dxgi_adapter_duplicator.cc b/webrtc/modules/desktop_capture/win/dxgi_adapter_duplicator.cc
index caef1c2ca7b67c802b73040fd8f5337488187150..5947daf5dcccf8d8786e6d7c390721cbbc7468e8 100644
--- a/webrtc/modules/desktop_capture/win/dxgi_adapter_duplicator.cc
+++ b/webrtc/modules/desktop_capture/win/dxgi_adapter_duplicator.cc
@@ -25,8 +25,7 @@ using Microsoft::WRL::ComPtr;
namespace {
bool IsValidRect(const RECT& rect) {
- return rect.left >= 0 && rect.top >= 0 && rect.right > rect.left &&
- rect.bottom > rect.top;
+ return rect.right > rect.left && rect.bottom > rect.top;
}
} // namespace
@@ -153,4 +152,12 @@ int64_t DxgiAdapterDuplicator::GetNumFramesCaptured() const {
return min;
}
+void DxgiAdapterDuplicator::TranslateRect(const DesktopVector& position) {
+ desktop_rect_.Translate(position);
+ RTC_DCHECK(desktop_rect_.left() >= 0 && desktop_rect_.top() >= 0);
+ for (auto& duplicator : duplicators_) {
+ duplicator.TranslateRect(position);
+ }
+}
+
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698