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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 | 98 |
| 99 DesktopRect() : left_(0), top_(0), right_(0), bottom_(0) {} | 99 DesktopRect() : left_(0), top_(0), right_(0), bottom_(0) {} |
| 100 | 100 |
| 101 int32_t left() const { return left_; } | 101 int32_t left() const { return left_; } |
| 102 int32_t top() const { return top_; } | 102 int32_t top() const { return top_; } |
| 103 int32_t right() const { return right_; } | 103 int32_t right() const { return right_; } |
| 104 int32_t bottom() const { return bottom_; } | 104 int32_t bottom() const { return bottom_; } |
| 105 int32_t width() const { return right_ - left_; } | 105 int32_t width() const { return right_ - left_; } |
| 106 int32_t height() const { return bottom_ - top_; } | 106 int32_t height() const { return bottom_ - top_; } |
| 107 | 107 |
| 108 // Create a new DesktopRect instance to represent a rectangle which is | |
| 109 // |padding| pixels larger than current instance in each direction. This is | |
| 110 // for VideoEncoderVpx and ScreenCapturerWinDirectx. | |
|
Sergey Ulanov
2016/04/14 23:10:42
Don't need this sentence (it will expire quickly a
Hzj_jie
2016/04/15 19:42:17
Done.
| |
| 111 // Note, left and top of the new instance won't be less than zero, and right | |
| 112 // and bottom wont't be larger than the desktop size. | |
|
Sergey Ulanov
2016/04/14 23:10:42
So it looks like this function currently does two
Hzj_jie
2016/04/15 19:42:17
Done.
| |
| 113 DesktopRect Expand(uint32_t padding, const DesktopSize& size) const; | |
|
Sergey Ulanov
2016/04/14 23:10:42
Other functions in this class mutate the rect in-p
Sergey Ulanov
2016/04/14 23:10:42
nit: Move this function below, after other mutator
Sergey Ulanov
2016/04/14 23:10:42
padding should be int.
From https://google.github.
Hzj_jie
2016/04/15 19:42:17
Considering this is a simple class, mutable eventu
Hzj_jie
2016/04/15 19:42:17
Done.
Hzj_jie
2016/04/15 19:42:17
Done.
| |
| 114 | |
| 108 DesktopVector top_left() const { return DesktopVector(left_, top_); } | 115 DesktopVector top_left() const { return DesktopVector(left_, top_); } |
| 109 DesktopSize size() const { return DesktopSize(width(), height()); } | 116 DesktopSize size() const { return DesktopSize(width(), height()); } |
| 110 | 117 |
| 111 bool is_empty() const { return left_ >= right_ || top_ >= bottom_; } | 118 bool is_empty() const { return left_ >= right_ || top_ >= bottom_; } |
| 112 | 119 |
| 113 bool equals(const DesktopRect& other) const { | 120 bool equals(const DesktopRect& other) const { |
| 114 return left_ == other.left_ && top_ == other.top_ && | 121 return left_ == other.left_ && top_ == other.top_ && |
| 115 right_ == other.right_ && bottom_ == other.bottom_; | 122 right_ == other.right_ && bottom_ == other.bottom_; |
| 116 } | 123 } |
| 117 | 124 |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 136 int32_t left_; | 143 int32_t left_; |
| 137 int32_t top_; | 144 int32_t top_; |
| 138 int32_t right_; | 145 int32_t right_; |
| 139 int32_t bottom_; | 146 int32_t bottom_; |
| 140 }; | 147 }; |
| 141 | 148 |
| 142 } // namespace webrtc | 149 } // namespace webrtc |
| 143 | 150 |
| 144 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_GEOMETRY_H_ | 151 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_GEOMETRY_H_ |
| 145 | 152 |
| OLD | NEW |