Chromium Code Reviews| Index: gpu/ipc/service/direct_composition_surface_win.cc |
| diff --git a/gpu/ipc/service/direct_composition_surface_win.cc b/gpu/ipc/service/direct_composition_surface_win.cc |
| index acbc271b0dd81360928050c87c9ecec203fc9e08..f97d720430ba88bd76580762a92da1f537177bb0 100644 |
| --- a/gpu/ipc/service/direct_composition_surface_win.cc |
| +++ b/gpu/ipc/service/direct_composition_surface_win.cc |
| @@ -8,6 +8,7 @@ |
| #include <dcomptypes.h> |
| #include "base/memory/ptr_util.h" |
| +#include "base/metrics/histogram_macros.h" |
| #include "base/optional.h" |
| #include "base/synchronization/waitable_event.h" |
| #include "base/trace_event/trace_event.h" |
| @@ -344,6 +345,16 @@ void DCLayerTree::SwapChainPresenter::PresentToSwapChain( |
| swap_chain_scale_y_ = bounds_rect.height() * 1.0f / swap_chain_size.height(); |
| swap_chain_->Present(first_present ? 0 : 1, 0); |
| + |
| + base::win::ScopedComPtr<IDXGISwapChainMedia> swap_chain_media; |
| + if (SUCCEEDED(swap_chain_.QueryInterface(swap_chain_media.Receive()))) { |
| + DXGI_FRAME_STATISTICS_MEDIA stats = {}; |
| + if (SUCCEEDED(swap_chain_media->GetFrameStatisticsMedia(&stats))) { |
| + UMA_HISTOGRAM_ENUMERATION( |
| + "GPU.DirectComposition.CompositionMode", stats.CompositionMode, |
| + DXGI_FRAME_PRESENTATION_MODE_COMPOSITION_FAILURE + 1); |
|
Ilya Sherman
2017/03/29 05:16:42
This code looks fragile, in the sense that someone
|
| + } |
| + } |
| } |
| bool DCLayerTree::SwapChainPresenter::InitializeVideoProcessor( |
| @@ -555,6 +566,8 @@ void DCLayerTree::UpdateVisualClip(VisualInfo* visual_info, |
| bool DCLayerTree::CommitAndClearPendingOverlays() { |
| TRACE_EVENT1("gpu", "DCLayerTree::CommitAndClearPendingOverlays", "size", |
| pending_overlays_.size()); |
| + UMA_HISTOGRAM_BOOLEAN("GPU.DirectComposition.OverlaysUsed", |
| + !pending_overlays_.empty()); |
| // Add an overlay with z-order 0 representing the main plane. |
| gfx::Size surface_size = surface_->GetSize(); |
| pending_overlays_.push_back(base::MakeUnique<ui::DCRendererLayerParams>( |