Commit 286a7797 authored by Weiliang Chen's avatar Weiliang Chen Committed by Chromium LUCI CQ

metrics: Fix Some Display Issues in Perf Metrics HUD

This CL fixes two things: it removes the perf metrics HUD in iframes,
and it stops flashing of metrics in some cases.

R=sadrul

Change-Id: I0b6603600c48bffbe6229a11f8798b0bb6ec31d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2601218Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Commit-Queue: weiliangc <weiliangc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#839794}
parent 37ec2edb
......@@ -91,7 +91,7 @@ void HeadsUpDisplayLayer::PushPropertiesTo(LayerImpl* layer) {
layer_impl->SetHUDTypeface(typeface_);
layer_impl->SetLayoutShiftRects(layout_shift_rects_);
layout_shift_rects_.clear();
if (web_vital_metrics_)
if (web_vital_metrics_ && web_vital_metrics_->HasValue())
layer_impl->SetWebVitalMetrics(std::move(web_vital_metrics_));
}
......
......@@ -567,7 +567,8 @@ void HeadsUpDisplayLayerImpl::PushPropertiesTo(LayerImpl* layer) {
layer_impl->SetHUDTypeface(typeface_);
layer_impl->SetLayoutShiftRects(layout_shift_rects_);
layout_shift_rects_.clear();
layer_impl->SetWebVitalMetrics(std::move(web_vital_metrics_));
if (web_vital_metrics_ && web_vital_metrics_->HasValue())
layer_impl->SetWebVitalMetrics(std::move(web_vital_metrics_));
}
void HeadsUpDisplayLayerImpl::UpdateHudContents() {
......
......@@ -2131,6 +2131,10 @@ std::unique_ptr<cc::WebVitalMetrics> WebFrameWidgetImpl::GetWebVitalMetrics() {
.WeightedScore();
if (layout_shift > 0.f)
metrics->layout_shift = layout_shift;
if (!metrics->HasValue())
return nullptr;
return metrics;
}
......
......@@ -360,10 +360,12 @@ cc::LayerTreeSettings GenerateLayerTreeSettings(
cmd.HasSwitch(cc::switches::kHighlightNonLCDTextLayers);
settings.initial_debug_state.show_web_vital_metrics =
base::FeatureList::IsEnabled(
::features::kHudDisplayForPerformanceMetrics);
::features::kHudDisplayForPerformanceMetrics) &&
!for_child_local_root_frame;
settings.initial_debug_state.show_smoothness_metrics =
base::FeatureList::IsEnabled(
::features::kHudDisplayForPerformanceMetrics);
::features::kHudDisplayForPerformanceMetrics) &&
!for_child_local_root_frame;
settings.initial_debug_state.SetRecordRenderingStats(
cmd.HasSwitch(cc::switches::kEnableGpuBenchmarking));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment