Chromium Code Reviews| Index: webrtc/modules/desktop_capture/win/dxgi_texture_staging.cc |
| diff --git a/webrtc/modules/desktop_capture/win/dxgi_texture_staging.cc b/webrtc/modules/desktop_capture/win/dxgi_texture_staging.cc |
| index 7478728143d0d8f93c274709e5d9207fc67073d4..23dff5a948fe81627a9bb3922bee55b221c67876 100644 |
| --- a/webrtc/modules/desktop_capture/win/dxgi_texture_staging.cc |
| +++ b/webrtc/modules/desktop_capture/win/dxgi_texture_staging.cc |
| @@ -38,9 +38,13 @@ bool DxgiTextureStaging::InitializeStage(ID3D11Texture2D* texture) { |
| return false; |
| } |
| + desc.ArraySize = 1; |
| desc.BindFlags = 0; |
| desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; |
| + desc.MipLevels = 1; |
| desc.MiscFlags = 0; |
| + desc.SampleDesc.Count = 1; |
| + desc.SampleDesc.Quality = 0; |
| desc.Usage = D3D11_USAGE_STAGING; |
| if (stage_) { |
| AssertStageAndSurfaceAreSameObject(); |
| @@ -58,8 +62,8 @@ bool DxgiTextureStaging::InitializeStage(ID3D11Texture2D* texture) { |
| RTC_DCHECK(!surface_); |
| } |
| - _com_error error = _com_error(device_.d3d_device()->CreateTexture2D( |
| - &desc, nullptr, stage_.GetAddressOf())); |
| + _com_error error = device_.d3d_device()->CreateTexture2D( |
|
Sergey Ulanov
2016/09/19 22:15:19
do you need _com_error here instead of HRESULT?
Sa
Hzj_jie
2016/09/19 23:15:27
What _com_error can provide is the functionality t
|
| + &desc, nullptr, stage_.GetAddressOf()); |
| if (error.Error() != S_OK || !stage_) { |
| LOG(LS_ERROR) << "Failed to create a new ID3D11Texture2D as stage, error " |
| << error.ErrorMessage() << ", code " << error.Error(); |