summaryrefslogtreecommitdiff
path: root/chromium/ui/gl/dc_layer_tree.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/ui/gl/dc_layer_tree.cc
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/ui/gl/dc_layer_tree.cc')
-rw-r--r--chromium/ui/gl/dc_layer_tree.cc14
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;
}