Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(469)

Unified Diff: gpu/ipc/service/direct_composition_surface_win.cc

Issue 2779643004: Add UMA histograms for DirectComposition overlays. (Closed)
Patch Set: rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>(
« no previous file with comments | « no previous file | gpu/ipc/service/image_transport_surface_win.cc » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698