| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #if !defined(OS_WIN) | 7 #if !defined(OS_WIN) |
| 8 #error This file should only be built on Windows. | 8 #error This file should only be built on Windows. |
| 9 #endif // !defined(OS_WIN) | 9 #endif // !defined(OS_WIN) |
| 10 | 10 |
| (...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 RETURN_ON_HR_FAILURE(hr, | 732 RETURN_ON_HR_FAILURE(hr, |
| 733 "QueryInterface for IDirect3DDevice9Ex from angle device failed", | 733 "QueryInterface for IDirect3DDevice9Ex from angle device failed", |
| 734 false); | 734 false); |
| 735 } else { | 735 } else { |
| 736 D3DPRESENT_PARAMETERS present_params = {0}; | 736 D3DPRESENT_PARAMETERS present_params = {0}; |
| 737 present_params.BackBufferWidth = 1; | 737 present_params.BackBufferWidth = 1; |
| 738 present_params.BackBufferHeight = 1; | 738 present_params.BackBufferHeight = 1; |
| 739 present_params.BackBufferFormat = D3DFMT_UNKNOWN; | 739 present_params.BackBufferFormat = D3DFMT_UNKNOWN; |
| 740 present_params.BackBufferCount = 1; | 740 present_params.BackBufferCount = 1; |
| 741 present_params.SwapEffect = D3DSWAPEFFECT_DISCARD; | 741 present_params.SwapEffect = D3DSWAPEFFECT_DISCARD; |
| 742 present_params.hDeviceWindow = ::GetShellWindow(); | 742 present_params.hDeviceWindow = NULL; |
| 743 present_params.Windowed = TRUE; | 743 present_params.Windowed = TRUE; |
| 744 present_params.Flags = D3DPRESENTFLAG_VIDEO; | 744 present_params.Flags = D3DPRESENTFLAG_VIDEO; |
| 745 present_params.FullScreen_RefreshRateInHz = 0; | 745 present_params.FullScreen_RefreshRateInHz = 0; |
| 746 present_params.PresentationInterval = 0; | 746 present_params.PresentationInterval = 0; |
| 747 | 747 |
| 748 hr = d3d9_->CreateDeviceEx(D3DADAPTER_DEFAULT, | 748 hr = d3d9_->CreateDeviceEx(D3DADAPTER_DEFAULT, |
| 749 D3DDEVTYPE_HAL, | 749 D3DDEVTYPE_HAL, |
| 750 ::GetShellWindow(), | 750 NULL, |
| 751 D3DCREATE_FPU_PRESERVE | | 751 D3DCREATE_FPU_PRESERVE | |
| 752 D3DCREATE_HARDWARE_VERTEXPROCESSING | | 752 D3DCREATE_HARDWARE_VERTEXPROCESSING | |
| 753 D3DCREATE_DISABLE_PSGP_THREADING | | 753 D3DCREATE_DISABLE_PSGP_THREADING | |
| 754 D3DCREATE_MULTITHREADED, | 754 D3DCREATE_MULTITHREADED, |
| 755 &present_params, | 755 &present_params, |
| 756 NULL, | 756 NULL, |
| 757 d3d9_device_ex_.Receive()); | 757 d3d9_device_ex_.Receive()); |
| 758 RETURN_ON_HR_FAILURE(hr, "Failed to create D3D device", false); | 758 RETURN_ON_HR_FAILURE(hr, "Failed to create D3D device", false); |
| 759 } | 759 } |
| 760 | 760 |
| (...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2284 D3DSURFACE_DESC surface_desc; | 2284 D3DSURFACE_DESC surface_desc; |
| 2285 hr = surface->GetDesc(&surface_desc); | 2285 hr = surface->GetDesc(&surface_desc); |
| 2286 RETURN_ON_HR_FAILURE(hr, "Failed to get surface description", false); | 2286 RETURN_ON_HR_FAILURE(hr, "Failed to get surface description", false); |
| 2287 *width = surface_desc.Width; | 2287 *width = surface_desc.Width; |
| 2288 *height = surface_desc.Height; | 2288 *height = surface_desc.Height; |
| 2289 } | 2289 } |
| 2290 return true; | 2290 return true; |
| 2291 } | 2291 } |
| 2292 | 2292 |
| 2293 } // namespace content | 2293 } // namespace content |
| OLD | NEW |