Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1757)

Side by Side Diff: webrtc/modules/desktop_capture/win/dxgi_output_duplicator.cc

Issue 2345163002: Several minor improvements of DirectX capturer (Closed)
Patch Set: Remove DPI awareness changes Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 return false; 140 return false;
141 } 141 }
142 142
143 // We need to merge updated region with the one from last frame, since current 143 // We need to merge updated region with the one from last frame, since current
144 // frame contains the content one frame before. Note, this is for double 144 // frame contains the content one frame before. Note, this is for double
145 // buffering implementation, as what we have in ScreenCapturerWinDirectx. If 145 // buffering implementation, as what we have in ScreenCapturerWinDirectx. If
146 // a consumer uses single buffering, we should clear context->updated_region 146 // a consumer uses single buffering, we should clear context->updated_region
147 // after it has been merged to updated_region. 147 // after it has been merged to updated_region.
148 DesktopRegion updated_region; 148 DesktopRegion updated_region;
149 updated_region.Swap(&context->updated_region); 149 updated_region.Swap(&context->updated_region);
150 if (error.Error() == S_OK && frame_info.AccumulatedFrames > 0) { 150 if (error.Error() == S_OK &&
151 frame_info.AccumulatedFrames > 0 &&
152 resource) {
Jamie 2016/09/17 00:49:30 Please add something to the CL description for thi
Hzj_jie 2016/09/19 19:09:57 Done.
151 DetectUpdatedRegion(frame_info, offset, &context->updated_region); 153 DetectUpdatedRegion(frame_info, offset, &context->updated_region);
152 if (!texture_->CopyFrom(frame_info, resource.Get(), 154 if (!texture_->CopyFrom(frame_info, resource.Get(),
153 context->updated_region)) { 155 context->updated_region)) {
154 return false; 156 return false;
155 } 157 }
156 SpreadContextChange(context); 158 SpreadContextChange(context);
157 updated_region.AddRegion(context->updated_region); 159 updated_region.AddRegion(context->updated_region);
158 160
159 const DesktopFrame& source = texture_->AsDesktopFrame(); 161 const DesktopFrame& source = texture_->AsDesktopFrame();
160 for (DesktopRegion::Iterator it(updated_region); !it.IsAtEnd(); 162 for (DesktopRegion::Iterator it(updated_region); !it.IsAtEnd();
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 } 310 }
309 311
310 DesktopRect DxgiOutputDuplicator::TargetRect(DesktopRect rect, 312 DesktopRect DxgiOutputDuplicator::TargetRect(DesktopRect rect,
311 DesktopVector offset) { 313 DesktopVector offset) {
312 rect = SourceRect(rect); 314 rect = SourceRect(rect);
313 rect.Translate(offset); 315 rect.Translate(offset);
314 return rect; 316 return rect;
315 } 317 }
316 318
317 } // namespace webrtc 319 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698