OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 |
11 #include "webrtc/modules/desktop_capture/desktop_frame_generator.h" | 11 #include "webrtc/modules/desktop_capture/desktop_frame_generator.h" |
12 | 12 |
13 #include <stdint.h> | 13 #include <stdint.h> |
14 #include <string.h> | 14 #include <string.h> |
15 | 15 |
16 #include <memory> | 16 #include <memory> |
17 | 17 |
| 18 #include "webrtc/base/random.h" |
| 19 #include "webrtc/base/timeutils.h" |
18 #include "webrtc/modules/desktop_capture/rgba_color.h" | 20 #include "webrtc/modules/desktop_capture/rgba_color.h" |
19 #include "webrtc/rtc_base/random.h" | |
20 #include "webrtc/rtc_base/timeutils.h" | |
21 | 21 |
22 namespace webrtc { | 22 namespace webrtc { |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 // Sets |updated_region| to |frame|. If |enlarge_updated_region| is | 26 // Sets |updated_region| to |frame|. If |enlarge_updated_region| is |
27 // true, this function will randomly enlarge each DesktopRect in | 27 // true, this function will randomly enlarge each DesktopRect in |
28 // |updated_region|. But the enlarged DesktopRegion won't excceed the | 28 // |updated_region|. But the enlarged DesktopRegion won't excceed the |
29 // frame->size(). If |add_random_updated_region| is true, several random | 29 // frame->size(). If |add_random_updated_region| is true, several random |
30 // rectangles will also be included in |frame|. | 30 // rectangles will also be included in |frame|. |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 bool BlackWhiteDesktopFramePainter::Paint(DesktopFrame* frame, | 174 bool BlackWhiteDesktopFramePainter::Paint(DesktopFrame* frame, |
175 DesktopRegion* updated_region) { | 175 DesktopRegion* updated_region) { |
176 RTC_DCHECK(updated_region->is_empty()); | 176 RTC_DCHECK(updated_region->is_empty()); |
177 memset(frame->data(), 0, frame->stride() * frame->size().height()); | 177 memset(frame->data(), 0, frame->stride() * frame->size().height()); |
178 PaintRegion(frame, &updated_region_, RgbaColor(0xFFFFFFFF)); | 178 PaintRegion(frame, &updated_region_, RgbaColor(0xFFFFFFFF)); |
179 updated_region_.Swap(updated_region); | 179 updated_region_.Swap(updated_region); |
180 return true; | 180 return true; |
181 } | 181 } |
182 | 182 |
183 } // namespace webrtc | 183 } // namespace webrtc |
OLD | NEW |