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

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

Issue 2779643004: Add UMA histograms for DirectComposition overlays. (Closed)
Patch Set: use UMA_HISTOGRAM_SPARSE_SLOWLY 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
« no previous file with comments | « no previous file | gpu/ipc/service/image_transport_surface_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..55037938f7293e12ffb6ad12b2afe98c762bf4b4 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,15 @@ 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_SPARSE_SLOWLY("GPU.DirectComposition.CompositionMode",
+ stats.CompositionMode);
+ }
+ }
}
bool DCLayerTree::SwapChainPresenter::InitializeVideoProcessor(
@@ -555,6 +565,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698