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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 // Enlarges current DesktopRect by subtracting |left_offset| and |top_offset| | 131 // Enlarges current DesktopRect by subtracting |left_offset| and |top_offset| |
| 132 // from |left_| and |top_|, and adding |right_offset| and |bottom_offset| to | 132 // from |left_| and |top_|, and adding |right_offset| and |bottom_offset| to |
| 133 // |right_| and |bottom_|. This function does not normalize the result, so | 133 // |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 | 134 // |left_| and |top_| may be less than zero or larger than |right_| and |
| 135 // |bottom_|. | 135 // |bottom_|. |
| 136 void Extend(int32_t left_offset, | 136 void Extend(int32_t left_offset, |
| 137 int32_t top_offset, | 137 int32_t top_offset, |
| 138 int32_t right_offset, | 138 int32_t right_offset, |
| 139 int32_t bottom_offset); | 139 int32_t bottom_offset); |
| 140 | 140 |
| 141 // Finds the minimum area to cover both |this| and |rect|. If |this| is empty, | |
| 142 // replaces |this| with |rect|. | |
|
jamiewalch
2017/05/02 22:18:11
This is not symmetric w.r.t |this| and |rect|. Spe
Hzj_jie
2017/05/02 23:28:28
A good point, I failed to notice it. I believe a c
| |
| 143 void UnionWith(const DesktopRect& rect); | |
| 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 |
| OLD | NEW |