Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 // Finds union with |rect|. | |
|
Sergey Ulanov
2016/07/08 22:36:53
This actually returns a rect that covers both rect
Hzj_jie
2016/07/11 00:54:59
Done.
| |
| 128 void JoinWith(const DesktopRect& rect); | |
| 129 | |
| 127 // Adds (dx, dy) to the position of the rectangle. | 130 // Adds (dx, dy) to the position of the rectangle. |
| 128 void Translate(int32_t dx, int32_t dy); | 131 void Translate(int32_t dx, int32_t dy); |
| 129 void Translate(DesktopVector d) { Translate(d.x(), d.y()); }; | 132 void Translate(DesktopVector d) { Translate(d.x(), d.y()); }; |
| 130 | 133 |
| 131 private: | 134 private: |
| 132 DesktopRect(int32_t left, int32_t top, int32_t right, int32_t bottom) | 135 DesktopRect(int32_t left, int32_t top, int32_t right, int32_t bottom) |
| 133 : left_(left), top_(top), right_(right), bottom_(bottom) { | 136 : left_(left), top_(top), right_(right), bottom_(bottom) { |
| 134 } | 137 } |
| 135 | 138 |
| 136 int32_t left_; | 139 int32_t left_; |
| 137 int32_t top_; | 140 int32_t top_; |
| 138 int32_t right_; | 141 int32_t right_; |
| 139 int32_t bottom_; | 142 int32_t bottom_; |
| 140 }; | 143 }; |
| 141 | 144 |
| 142 } // namespace webrtc | 145 } // namespace webrtc |
| 143 | 146 |
| 144 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_GEOMETRY_H_ | 147 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_GEOMETRY_H_ |
| 145 | 148 |
| OLD | NEW |