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

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

Issue 2988153003: Replace CHECK(x && y) with two separate CHECK() calls (Closed)
Patch Set: fix mistakes Created 3 years, 4 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 DxgiOutputDuplicator::DxgiOutputDuplicator(const D3dDevice& device, 63 DxgiOutputDuplicator::DxgiOutputDuplicator(const D3dDevice& device,
64 const ComPtr<IDXGIOutput1>& output, 64 const ComPtr<IDXGIOutput1>& output,
65 const DXGI_OUTPUT_DESC& desc) 65 const DXGI_OUTPUT_DESC& desc)
66 : device_(device), 66 : device_(device),
67 output_(output), 67 output_(output),
68 device_name_(rtc::ToUtf8(desc.DeviceName)), 68 device_name_(rtc::ToUtf8(desc.DeviceName)),
69 desktop_rect_(RECTToDesktopRect(desc.DesktopCoordinates)) { 69 desktop_rect_(RECTToDesktopRect(desc.DesktopCoordinates)) {
70 RTC_DCHECK(output_); 70 RTC_DCHECK(output_);
71 RTC_DCHECK(!desktop_rect_.is_empty()); 71 RTC_DCHECK(!desktop_rect_.is_empty());
72 RTC_DCHECK(desktop_rect_.width() > 0 && desktop_rect_.height() > 0); 72 RTC_DCHECK_GT(desktop_rect_.width(), 0);
73 RTC_DCHECK_GT(desktop_rect_.height(), 0);
73 } 74 }
74 75
75 DxgiOutputDuplicator::DxgiOutputDuplicator(DxgiOutputDuplicator&& other) = 76 DxgiOutputDuplicator::DxgiOutputDuplicator(DxgiOutputDuplicator&& other) =
76 default; 77 default;
77 78
78 DxgiOutputDuplicator::~DxgiOutputDuplicator() { 79 DxgiOutputDuplicator::~DxgiOutputDuplicator() {
79 if (duplication_) { 80 if (duplication_) {
80 duplication_->ReleaseFrame(); 81 duplication_->ReleaseFrame();
81 } 82 }
82 texture_.reset(); 83 texture_.reset();
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 379
379 int64_t DxgiOutputDuplicator::num_frames_captured() const { 380 int64_t DxgiOutputDuplicator::num_frames_captured() const {
380 #if !defined(NDEBUG) 381 #if !defined(NDEBUG)
381 RTC_DCHECK_EQ(!!last_frame_, num_frames_captured_ > 0); 382 RTC_DCHECK_EQ(!!last_frame_, num_frames_captured_ > 0);
382 #endif 383 #endif
383 return num_frames_captured_; 384 return num_frames_captured_;
384 } 385 }
385 386
386 void DxgiOutputDuplicator::TranslateRect(const DesktopVector& position) { 387 void DxgiOutputDuplicator::TranslateRect(const DesktopVector& position) {
387 desktop_rect_.Translate(position); 388 desktop_rect_.Translate(position);
388 RTC_DCHECK(desktop_rect_.left() >= 0 && desktop_rect_.top() >= 0); 389 RTC_DCHECK_GE(desktop_rect_.left(), 0);
390 RTC_DCHECK_GE(desktop_rect_.top(), 0);
389 } 391 }
390 392
391 } // namespace webrtc 393 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/desktop_capture/win/dxgi_adapter_duplicator.cc ('k') | webrtc/modules/desktop_capture/win/dxgi_texture.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698