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

Side by Side Diff: webrtc/modules/desktop_capture/win/dxgi_texture.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 24 matching lines...) Expand all
35 ~DxgiDesktopFrame() override = default; 35 ~DxgiDesktopFrame() override = default;
36 }; 36 };
37 37
38 } // namespace 38 } // namespace
39 39
40 DxgiTexture::DxgiTexture() = default; 40 DxgiTexture::DxgiTexture() = default;
41 DxgiTexture::~DxgiTexture() = default; 41 DxgiTexture::~DxgiTexture() = default;
42 42
43 bool DxgiTexture::CopyFrom(const DXGI_OUTDUPL_FRAME_INFO& frame_info, 43 bool DxgiTexture::CopyFrom(const DXGI_OUTDUPL_FRAME_INFO& frame_info,
44 IDXGIResource* resource) { 44 IDXGIResource* resource) {
45 RTC_DCHECK(resource && frame_info.AccumulatedFrames > 0); 45 RTC_DCHECK_GT(frame_info.AccumulatedFrames, 0);
46 RTC_DCHECK(resource);
46 ComPtr<ID3D11Texture2D> texture; 47 ComPtr<ID3D11Texture2D> texture;
47 _com_error error = resource->QueryInterface( 48 _com_error error = resource->QueryInterface(
48 __uuidof(ID3D11Texture2D), 49 __uuidof(ID3D11Texture2D),
49 reinterpret_cast<void**>(texture.GetAddressOf())); 50 reinterpret_cast<void**>(texture.GetAddressOf()));
50 if (error.Error() != S_OK || !texture) { 51 if (error.Error() != S_OK || !texture) {
51 LOG(LS_ERROR) << "Failed to convert IDXGIResource to ID3D11Texture2D, " 52 LOG(LS_ERROR) << "Failed to convert IDXGIResource to ID3D11Texture2D, "
52 "error " 53 "error "
53 << error.ErrorMessage() << ", code " << error.Error(); 54 << error.ErrorMessage() << ", code " << error.Error();
54 return false; 55 return false;
55 } 56 }
(...skipping 15 matching lines...) Expand all
71 bool DxgiTexture::Release() { 72 bool DxgiTexture::Release() {
72 frame_.reset(); 73 frame_.reset();
73 return DoRelease(); 74 return DoRelease();
74 } 75 }
75 76
76 DXGI_MAPPED_RECT* DxgiTexture::rect() { 77 DXGI_MAPPED_RECT* DxgiTexture::rect() {
77 return &rect_; 78 return &rect_;
78 } 79 }
79 80
80 } // namespace webrtc 81 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698