| 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 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 } | 106 } |
| 107 | 107 |
| 108 void DxgiAdapterDuplicator::Unregister(const Context* const context) { | 108 void DxgiAdapterDuplicator::Unregister(const Context* const context) { |
| 109 RTC_DCHECK_EQ(context->contexts.size(), duplicators_.size()); | 109 RTC_DCHECK_EQ(context->contexts.size(), duplicators_.size()); |
| 110 for (size_t i = 0; i < duplicators_.size(); i++) { | 110 for (size_t i = 0; i < duplicators_.size(); i++) { |
| 111 duplicators_[i].Unregister(&context->contexts[i]); | 111 duplicators_[i].Unregister(&context->contexts[i]); |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 | 114 |
| 115 bool DxgiAdapterDuplicator::Duplicate(Context* context, | 115 bool DxgiAdapterDuplicator::Duplicate(Context* context, |
| 116 const DesktopFrame* last_frame, | 116 SharedDesktopFrame* target) { |
| 117 DesktopFrame* target) { | |
| 118 RTC_DCHECK_EQ(context->contexts.size(), duplicators_.size()); | 117 RTC_DCHECK_EQ(context->contexts.size(), duplicators_.size()); |
| 119 for (size_t i = 0; i < duplicators_.size(); i++) { | 118 for (size_t i = 0; i < duplicators_.size(); i++) { |
| 120 if (!duplicators_[i].Duplicate(&context->contexts[i], last_frame, | 119 if (!duplicators_[i].Duplicate(&context->contexts[i], |
| 121 duplicators_[i].desktop_rect().top_left(), | 120 duplicators_[i].desktop_rect().top_left(), |
| 122 target)) { | 121 target)) { |
| 123 return false; | 122 return false; |
| 124 } | 123 } |
| 125 } | 124 } |
| 126 return true; | 125 return true; |
| 127 } | 126 } |
| 128 | 127 |
| 129 bool DxgiAdapterDuplicator::DuplicateMonitor(Context* context, | 128 bool DxgiAdapterDuplicator::DuplicateMonitor(Context* context, |
| 130 int monitor_id, | 129 int monitor_id, |
| 131 const DesktopFrame* last_frame, | 130 SharedDesktopFrame* target) { |
| 132 DesktopFrame* target) { | |
| 133 RTC_DCHECK(monitor_id >= 0 && | 131 RTC_DCHECK(monitor_id >= 0 && |
| 134 monitor_id < static_cast<int>(duplicators_.size()) && | 132 monitor_id < static_cast<int>(duplicators_.size()) && |
| 135 context->contexts.size() == duplicators_.size()); | 133 context->contexts.size() == duplicators_.size()); |
| 136 return duplicators_[monitor_id].Duplicate( | 134 return duplicators_[monitor_id].Duplicate(&context->contexts[monitor_id], |
| 137 &context->contexts[monitor_id], last_frame, DesktopVector(), target); | 135 DesktopVector(), target); |
| 138 } | 136 } |
| 139 | 137 |
| 140 DesktopRect DxgiAdapterDuplicator::ScreenRect(int id) const { | 138 DesktopRect DxgiAdapterDuplicator::ScreenRect(int id) const { |
| 141 RTC_DCHECK(id >= 0 && id < static_cast<int>(duplicators_.size())); | 139 RTC_DCHECK(id >= 0 && id < static_cast<int>(duplicators_.size())); |
| 142 return duplicators_[id].desktop_rect(); | 140 return duplicators_[id].desktop_rect(); |
| 143 } | 141 } |
| 144 | 142 |
| 145 } // namespace webrtc | 143 } // namespace webrtc |
| OLD | NEW |