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

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

Issue 2743233002: Ignore unmoved moved_rects in DxgiOutputDuplicator (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 static_cast<UINT>(metadata_.capacity()) - buff_size, dirty_rects, 281 static_cast<UINT>(metadata_.capacity()) - buff_size, dirty_rects,
282 &buff_size); 282 &buff_size);
283 if (error.Error() != S_OK) { 283 if (error.Error() != S_OK) {
284 LOG(LS_ERROR) << "Failed to get dirty rectangles, error " 284 LOG(LS_ERROR) << "Failed to get dirty rectangles, error "
285 << error.ErrorMessage() << ", code " << error.Error(); 285 << error.ErrorMessage() << ", code " << error.Error();
286 return false; 286 return false;
287 } 287 }
288 dirty_rects_count = buff_size / sizeof(RECT); 288 dirty_rects_count = buff_size / sizeof(RECT);
289 289
290 while (move_rects_count > 0) { 290 while (move_rects_count > 0) {
291 updated_region->AddRect( 291 if (move_rects->SourcePoint.x != move_rects->DestinationRect.left ||
Sergey Ulanov 2017/03/14 19:47:27 Do you know why the API returns unmoved rects? Do
Hzj_jie 2017/03/14 23:22:49 No idea about this. I just randomly tried this ide
292 RotateRect(DesktopRect::MakeXYWH(move_rects->SourcePoint.x, 292 move_rects->SourcePoint.y != move_rects->DestinationRect.top) {
293 move_rects->SourcePoint.y, 293 updated_region->AddRect(
294 move_rects->DestinationRect.right - 294 RotateRect(DesktopRect::MakeXYWH(move_rects->SourcePoint.x,
295 move_rects->DestinationRect.left, 295 move_rects->SourcePoint.y,
296 move_rects->DestinationRect.bottom - 296 move_rects->DestinationRect.right -
297 move_rects->DestinationRect.top), 297 move_rects->DestinationRect.left,
298 unrotated_size_, rotation_)); 298 move_rects->DestinationRect.bottom -
299 updated_region->AddRect( 299 move_rects->DestinationRect.top),
300 RotateRect(DesktopRect::MakeLTRB(move_rects->DestinationRect.left, 300 unrotated_size_, rotation_));
301 move_rects->DestinationRect.top, 301 updated_region->AddRect(
302 move_rects->DestinationRect.right, 302 RotateRect(DesktopRect::MakeLTRB(move_rects->DestinationRect.left,
303 move_rects->DestinationRect.bottom), 303 move_rects->DestinationRect.top,
304 unrotated_size_, rotation_)); 304 move_rects->DestinationRect.right,
305 move_rects->DestinationRect.bottom),
306 unrotated_size_, rotation_));
307 }
305 move_rects++; 308 move_rects++;
306 move_rects_count--; 309 move_rects_count--;
307 } 310 }
308 311
309 while (dirty_rects_count > 0) { 312 while (dirty_rects_count > 0) {
310 updated_region->AddRect(RotateRect( 313 updated_region->AddRect(RotateRect(
311 DesktopRect::MakeLTRB(dirty_rects->left, dirty_rects->top, 314 DesktopRect::MakeLTRB(dirty_rects->left, dirty_rects->top,
312 dirty_rects->right, dirty_rects->bottom), 315 dirty_rects->right, dirty_rects->bottom),
313 unrotated_size_, rotation_)); 316 unrotated_size_, rotation_));
314 dirty_rects++; 317 dirty_rects++;
(...skipping 28 matching lines...) Expand all
343 } 346 }
344 347
345 int64_t DxgiOutputDuplicator::num_frames_captured() const { 348 int64_t DxgiOutputDuplicator::num_frames_captured() const {
346 #if !defined(NDEBUG) 349 #if !defined(NDEBUG)
347 RTC_DCHECK_EQ(!!last_frame_, num_frames_captured_ > 0); 350 RTC_DCHECK_EQ(!!last_frame_, num_frames_captured_ > 0);
348 #endif 351 #endif
349 return num_frames_captured_; 352 return num_frames_captured_;
350 } 353 }
351 354
352 } // namespace webrtc 355 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698