diff options
Diffstat (limited to 'chromium/ui/gl/dc_layer_tree.cc')
-rw-r--r-- | chromium/ui/gl/dc_layer_tree.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/chromium/ui/gl/dc_layer_tree.cc b/chromium/ui/gl/dc_layer_tree.cc index b97cf126264..f3548fbca02 100644 --- a/chromium/ui/gl/dc_layer_tree.cc +++ b/chromium/ui/gl/dc_layer_tree.cc @@ -4,8 +4,10 @@ #include "ui/gl/dc_layer_tree.h" +#include "base/metrics/histogram_functions.h" #include "base/trace_event/trace_event.h" #include "ui/gl/direct_composition_child_surface_win.h" +#include "ui/gl/direct_composition_surface_win.h" #include "ui/gl/swap_chain_presenter.h" namespace gl { @@ -63,6 +65,8 @@ bool DCLayerTree::InitializeVideoProcessor(const gfx::Size& input_size, // This can fail if the D3D device is "Microsoft Basic Display Adapter". if (FAILED(d3d11_device_.As(&video_device_))) { DLOG(ERROR) << "Failed to retrieve video device from D3D11 device"; + DCHECK(false); + DirectCompositionSurfaceWin::DisableOverlays(); return false; } DCHECK(video_device_); @@ -97,17 +101,27 @@ bool DCLayerTree::InitializeVideoProcessor(const gfx::Size& input_size, desc.Usage = D3D11_VIDEO_USAGE_PLAYBACK_NORMAL; HRESULT hr = video_device_->CreateVideoProcessorEnumerator( &desc, &video_processor_enumerator_); + base::UmaHistogramSparse( + "GPU.DirectComposition.CreateVideoProcessorEnumerator", hr); if (FAILED(hr)) { DLOG(ERROR) << "CreateVideoProcessorEnumerator failed with error 0x" << std::hex << hr; + // It might fail again next time. Disable overlay support so + // overlay processor will stop sending down overlay frames. + DirectCompositionSurfaceWin::DisableOverlays(); return false; } hr = video_device_->CreateVideoProcessor(video_processor_enumerator_.Get(), 0, &video_processor_); + base::UmaHistogramSparse( + "GPU.DirectComposition.VideoDeviceCreateVideoProcessor", hr); if (FAILED(hr)) { DLOG(ERROR) << "CreateVideoProcessor failed with error 0x" << std::hex << hr; + // It might fail again next time. Disable overlay support so + // overlay processor will stop sending down overlay frames. + DirectCompositionSurfaceWin::DisableOverlays(); return false; } |