Index: webrtc/modules/desktop_capture/desktop_geometry.cc |
diff --git a/webrtc/modules/desktop_capture/desktop_geometry.cc b/webrtc/modules/desktop_capture/desktop_geometry.cc |
index 2af8cf826e4dc70193e58569b0e6824eddc140de..33d6070cf25cd8dcced79bedbdd4110598a2c258 100644 |
--- a/webrtc/modules/desktop_capture/desktop_geometry.cc |
+++ b/webrtc/modules/desktop_capture/desktop_geometry.cc |
@@ -37,6 +37,22 @@ void DesktopRect::IntersectWith(const DesktopRect& rect) { |
} |
} |
+void DesktopRect::UnionWith(const DesktopRect& rect) { |
+ if (is_empty()) { |
+ *this = rect; |
+ return; |
+ } |
+ |
+ if (rect.is_empty()) { |
+ return; |
+ } |
+ |
+ left_ = std::min(left(), rect.left()); |
+ top_ = std::min(top(), rect.top()); |
+ right_ = std::max(right(), rect.right()); |
+ bottom_ = std::max(bottom(), rect.bottom()); |
+} |
+ |
void DesktopRect::Translate(int32_t dx, int32_t dy) { |
left_ += dx; |
top_ += dy; |