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

Unified Diff: webrtc/modules/desktop_capture/mac/desktop_configuration.mm

Issue 2845213002: DesktopRect::UnionWith() to extend current rect to cover the input rect (Closed)
Patch Set: Sync latest changes Created 3 years, 7 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/mac/desktop_configuration.mm
diff --git a/webrtc/modules/desktop_capture/mac/desktop_configuration.mm b/webrtc/modules/desktop_capture/mac/desktop_configuration.mm
index 4e227ca43d9d47d8e5dfbe04fc69974c07152579..c82d1cb631d68ee7370c7b28c3eb01936e0a9045 100644
--- a/webrtc/modules/desktop_capture/mac/desktop_configuration.mm
+++ b/webrtc/modules/desktop_capture/mac/desktop_configuration.mm
@@ -36,15 +36,6 @@ DesktopRect NSRectToDesktopRect(const NSRect& ns_rect) {
static_cast<int>(ceil(ns_rect.origin.y + ns_rect.size.height)));
}
-DesktopRect JoinRects(const DesktopRect& a,
- const DesktopRect& b) {
- return DesktopRect::MakeLTRB(
- std::min(a.left(), b.left()),
- std::min(a.top(), b.top()),
- std::max(a.right(), b.right()),
- std::max(a.bottom(), b.bottom()));
-}
-
// Inverts the position of |rect| from bottom-up coordinates to top-down,
// relative to |bounds|.
void InvertRectYOrigin(const DesktopRect& bounds,
@@ -148,10 +139,8 @@ MacDesktopConfiguration MacDesktopConfiguration::GetCurrent(Origin origin) {
// display uses different DPI settings.
if (display_config.dip_to_pixel_scale ==
desktop_config.dip_to_pixel_scale) {
- desktop_config.bounds =
- JoinRects(desktop_config.bounds, display_config.bounds);
- desktop_config.pixel_bounds =
- JoinRects(desktop_config.pixel_bounds, display_config.pixel_bounds);
+ desktop_config.bounds.UnionWith(display_config.bounds);
+ desktop_config.pixel_bounds.UnionWith(display_config.pixel_bounds);
}
}
« no previous file with comments | « webrtc/modules/desktop_capture/desktop_geometry.cc ('k') | webrtc/modules/desktop_capture/win/dxgi_adapter_duplicator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698