| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 DxgiOutputDuplicator::~DxgiOutputDuplicator() { | 79 DxgiOutputDuplicator::~DxgiOutputDuplicator() { |
| 80 if (duplication_) { | 80 if (duplication_) { |
| 81 duplication_->ReleaseFrame(); | 81 duplication_->ReleaseFrame(); |
| 82 } | 82 } |
| 83 texture_.reset(); | 83 texture_.reset(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 bool DxgiOutputDuplicator::Initialize() { | 86 bool DxgiOutputDuplicator::Initialize() { |
| 87 if (DuplicateOutput()) { | 87 if (DuplicateOutput()) { |
| 88 DesktopSize unrotated_size = | |
| 89 RotateSize(desktop_rect().size(), ReverseRotation(rotation_)); | |
| 90 if (desc_.DesktopImageInSystemMemory) { | 88 if (desc_.DesktopImageInSystemMemory) { |
| 91 texture_.reset( | 89 texture_.reset(new DxgiTextureMapping(duplication_.Get())); |
| 92 new DxgiTextureMapping(unrotated_size, duplication_.Get())); | |
| 93 } else { | 90 } else { |
| 94 texture_.reset(new DxgiTextureStaging(unrotated_size, device_)); | 91 texture_.reset(new DxgiTextureStaging(device_)); |
| 95 } | 92 } |
| 96 return true; | 93 return true; |
| 97 } else { | 94 } else { |
| 98 duplication_.Reset(); | 95 duplication_.Reset(); |
| 99 return false; | 96 return false; |
| 100 } | 97 } |
| 101 } | 98 } |
| 102 | 99 |
| 103 bool DxgiOutputDuplicator::DuplicateOutput() { | 100 bool DxgiOutputDuplicator::DuplicateOutput() { |
| 104 RTC_DCHECK(!duplication_); | 101 RTC_DCHECK(!duplication_); |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 void DxgiOutputDuplicator::SpreadContextChange(const Context* const source) { | 332 void DxgiOutputDuplicator::SpreadContextChange(const Context* const source) { |
| 336 for (Context* dest : contexts_) { | 333 for (Context* dest : contexts_) { |
| 337 RTC_DCHECK(dest); | 334 RTC_DCHECK(dest); |
| 338 if (dest != source) { | 335 if (dest != source) { |
| 339 dest->updated_region.AddRegion(source->updated_region); | 336 dest->updated_region.AddRegion(source->updated_region); |
| 340 } | 337 } |
| 341 } | 338 } |
| 342 } | 339 } |
| 343 | 340 |
| 344 } // namespace webrtc | 341 } // namespace webrtc |
| OLD | NEW |