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

Side by Side Diff: webrtc/modules/desktop_capture/desktop_geometry.h

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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/modules/desktop_capture/desktop_geometry.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 // Returns true if |point| lies within the rectangle boundaries. 118 // Returns true if |point| lies within the rectangle boundaries.
119 bool Contains(const DesktopVector& point) const; 119 bool Contains(const DesktopVector& point) const;
120 120
121 // Returns true if |rect| lies within the boundaries of this rectangle. 121 // Returns true if |rect| lies within the boundaries of this rectangle.
122 bool ContainsRect(const DesktopRect& rect) const; 122 bool ContainsRect(const DesktopRect& rect) const;
123 123
124 // Finds intersection with |rect|. 124 // Finds intersection with |rect|.
125 void IntersectWith(const DesktopRect& rect); 125 void IntersectWith(const DesktopRect& rect);
126 126
127 // Extends the rectangle to cover |rect|. If |this| is empty, replaces |this|
128 // with |rect|; if |rect| is empty, this function takes no effect.
129 void UnionWith(const DesktopRect& rect);
130
127 // Adds (dx, dy) to the position of the rectangle. 131 // Adds (dx, dy) to the position of the rectangle.
128 void Translate(int32_t dx, int32_t dy); 132 void Translate(int32_t dx, int32_t dy);
129 void Translate(DesktopVector d) { Translate(d.x(), d.y()); }; 133 void Translate(DesktopVector d) { Translate(d.x(), d.y()); };
130 134
131 // Enlarges current DesktopRect by subtracting |left_offset| and |top_offset| 135 // Enlarges current DesktopRect by subtracting |left_offset| and |top_offset|
132 // from |left_| and |top_|, and adding |right_offset| and |bottom_offset| to 136 // from |left_| and |top_|, and adding |right_offset| and |bottom_offset| to
133 // |right_| and |bottom_|. This function does not normalize the result, so 137 // |right_| and |bottom_|. This function does not normalize the result, so
134 // |left_| and |top_| may be less than zero or larger than |right_| and 138 // |left_| and |top_| may be less than zero or larger than |right_| and
135 // |bottom_|. 139 // |bottom_|.
136 void Extend(int32_t left_offset, 140 void Extend(int32_t left_offset,
137 int32_t top_offset, 141 int32_t top_offset,
138 int32_t right_offset, 142 int32_t right_offset,
139 int32_t bottom_offset); 143 int32_t bottom_offset);
140 144
141 private: 145 private:
142 DesktopRect(int32_t left, int32_t top, int32_t right, int32_t bottom) 146 DesktopRect(int32_t left, int32_t top, int32_t right, int32_t bottom)
143 : left_(left), top_(top), right_(right), bottom_(bottom) { 147 : left_(left), top_(top), right_(right), bottom_(bottom) {
144 } 148 }
145 149
146 int32_t left_; 150 int32_t left_;
147 int32_t top_; 151 int32_t top_;
148 int32_t right_; 152 int32_t right_;
149 int32_t bottom_; 153 int32_t bottom_;
150 }; 154 };
151 155
152 } // namespace webrtc 156 } // namespace webrtc
153 157
154 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_GEOMETRY_H_ 158 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_GEOMETRY_H_
155 159
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/desktop_capture/desktop_geometry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698