Commit b1d398e7 authored by Sadrul Habib Chowdhury's avatar Sadrul Habib Chowdhury Committed by Commit Bot

latency: Stop using FrameMetrics/SkippedFrameTracker.

We have not been using FrameMetrics or SkippedFrameTracker to report
any metrics so far. So stop using them from cc. Follow up CLs will
remove the code and associated tests.

BUG=1005377

Change-Id: Idb779df9210b1b075bb2d76fd499ec43b3822898
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1811201Reviewed-by: default avatarMohsen Izadi <mohsen@chromium.org>
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697831}
parent f1262a49
...@@ -202,25 +202,6 @@ void RecordCompositorSlowScrollMetric(InputHandler::ScrollInputType type, ...@@ -202,25 +202,6 @@ void RecordCompositorSlowScrollMetric(InputHandler::ScrollInputType type,
} }
} }
ui::FrameMetricsSettings LTHI_FrameMetricsSettings(
const LayerTreeSettings& settings) {
ui::FrameMetricsSource source =
settings.commit_to_active_tree
? ui::FrameMetricsSource::UiCompositor
: ui::FrameMetricsSource::RendererCompositor;
ui::FrameMetricsSourceThread source_thread =
settings.commit_to_active_tree
? ui::FrameMetricsSourceThread::UiCompositor
: ui::FrameMetricsSourceThread::RendererCompositor;
ui::FrameMetricsCompileTarget compile_target =
settings.using_synchronous_renderer_compositor
? ui::FrameMetricsCompileTarget::SynchronousCompositor
: settings.wait_for_all_pipeline_stages_before_draw
? ui::FrameMetricsCompileTarget::Headless
: ui::FrameMetricsCompileTarget::Chromium;
return ui::FrameMetricsSettings(source, source_thread, compile_target);
}
class ScopedPostAnimationEventsToMainThread { class ScopedPostAnimationEventsToMainThread {
public: public:
ScopedPostAnimationEventsToMainThread(MutatorHost* animation_host, ScopedPostAnimationEventsToMainThread(MutatorHost* animation_host,
...@@ -314,8 +295,6 @@ LayerTreeHostImpl::LayerTreeHostImpl( ...@@ -314,8 +295,6 @@ LayerTreeHostImpl::LayerTreeHostImpl(
image_animation_controller_(GetTaskRunner(), image_animation_controller_(GetTaskRunner(),
this, this,
settings_.enable_image_animation_resync), settings_.enable_image_animation_resync),
frame_metrics_(LTHI_FrameMetricsSettings(settings_)),
skipped_frame_tracker_(&frame_metrics_),
is_animating_for_snap_(false), is_animating_for_snap_(false),
paint_image_generator_client_id_(PaintImage::GetNextGeneratorClientId()), paint_image_generator_client_id_(PaintImage::GetNextGeneratorClientId()),
scrollbar_controller_(std::make_unique<ScrollbarController>(this)), scrollbar_controller_(std::make_unique<ScrollbarController>(this)),
...@@ -1469,7 +1448,6 @@ void LayerTreeHostImpl::InvalidateLayerTreeFrameSink(bool needs_redraw) { ...@@ -1469,7 +1448,6 @@ void LayerTreeHostImpl::InvalidateLayerTreeFrameSink(bool needs_redraw) {
DCHECK(layer_tree_frame_sink()); DCHECK(layer_tree_frame_sink());
layer_tree_frame_sink()->Invalidate(needs_redraw); layer_tree_frame_sink()->Invalidate(needs_redraw);
skipped_frame_tracker_.DidProduceFrame();
} }
DrawResult LayerTreeHostImpl::PrepareToDraw(FrameData* frame) { DrawResult LayerTreeHostImpl::PrepareToDraw(FrameData* frame) {
...@@ -2011,13 +1989,6 @@ void LayerTreeHostImpl::DidPresentCompositorFrame( ...@@ -2011,13 +1989,6 @@ void LayerTreeHostImpl::DidPresentCompositorFrame(
PresentationTimeCallbackBuffer::PendingCallbacks activated = PresentationTimeCallbackBuffer::PendingCallbacks activated =
presentation_time_callbacks_.PopPendingCallbacks(frame_token); presentation_time_callbacks_.PopPendingCallbacks(frame_token);
// Update compositor frame latency and smoothness stats only for frames
// that caused on-screen damage.
if (!activated.frame_time.is_null()) {
frame_metrics_.AddFrameDisplayed(activated.frame_time,
details.presentation_feedback.timestamp);
}
// Send all the main-thread callbacks to the client in one batch. The client // Send all the main-thread callbacks to the client in one batch. The client
// is in charge of posting them to the main thread. // is in charge of posting them to the main thread.
client_->DidPresentCompositorFrameOnImplThread( client_->DidPresentCompositorFrameOnImplThread(
...@@ -2025,7 +1996,6 @@ void LayerTreeHostImpl::DidPresentCompositorFrame( ...@@ -2025,7 +1996,6 @@ void LayerTreeHostImpl::DidPresentCompositorFrame(
} }
void LayerTreeHostImpl::DidNotNeedBeginFrame() { void LayerTreeHostImpl::DidNotNeedBeginFrame() {
skipped_frame_tracker_.WillNotProduceFrame();
frame_trackers_.NotifyPauseFrameProduction(); frame_trackers_.NotifyPauseFrameProduction();
} }
...@@ -2245,7 +2215,6 @@ bool LayerTreeHostImpl::DrawLayers(FrameData* frame) { ...@@ -2245,7 +2215,6 @@ bool LayerTreeHostImpl::DrawLayers(FrameData* frame) {
DCHECK(CanDraw()); DCHECK(CanDraw());
DCHECK_EQ(frame->has_no_damage, frame->render_passes.empty()); DCHECK_EQ(frame->has_no_damage, frame->render_passes.empty());
ResetRequiresHighResToDraw(); ResetRequiresHighResToDraw();
skipped_frame_tracker_.DidProduceFrame();
if (frame->has_no_damage) { if (frame->has_no_damage) {
DCHECK(!resourceless_software_draw_); DCHECK(!resourceless_software_draw_);
...@@ -2651,8 +2620,6 @@ bool LayerTreeHostImpl::WillBeginImplFrame(const viz::BeginFrameArgs& args) { ...@@ -2651,8 +2620,6 @@ bool LayerTreeHostImpl::WillBeginImplFrame(const viz::BeginFrameArgs& args) {
for (auto* it : video_frame_controllers_) for (auto* it : video_frame_controllers_)
it->OnBeginFrame(args); it->OnBeginFrame(args);
skipped_frame_tracker_.BeginFrame(args.frame_time, args.interval);
bool recent_frame_had_no_damage = bool recent_frame_had_no_damage =
consecutive_frame_with_damage_count_ < settings_.damaged_frame_limit; consecutive_frame_with_damage_count_ < settings_.damaged_frame_limit;
// Check damage early if the setting is enabled and a recent frame had no // Check damage early if the setting is enabled and a recent frame had no
...@@ -2687,7 +2654,6 @@ void LayerTreeHostImpl::DidFinishImplFrame() { ...@@ -2687,7 +2654,6 @@ void LayerTreeHostImpl::DidFinishImplFrame() {
frame_trackers_.NotifyMainFrameCausedNoDamage( frame_trackers_.NotifyMainFrameCausedNoDamage(
current_begin_frame_tracker_.Current()); current_begin_frame_tracker_.Current());
} }
skipped_frame_tracker_.FinishFrame();
impl_thread_phase_ = ImplThreadPhase::IDLE; impl_thread_phase_ = ImplThreadPhase::IDLE;
current_begin_frame_tracker_.Finish(); current_begin_frame_tracker_.Finish();
} }
...@@ -3170,8 +3136,6 @@ void LayerTreeHostImpl::SetNeedsOneBeginImplFrame() { ...@@ -3170,8 +3136,6 @@ void LayerTreeHostImpl::SetNeedsOneBeginImplFrame() {
void LayerTreeHostImpl::SetNeedsRedraw() { void LayerTreeHostImpl::SetNeedsRedraw() {
NotifySwapPromiseMonitorsOfSetNeedsRedraw(); NotifySwapPromiseMonitorsOfSetNeedsRedraw();
client_->SetNeedsRedrawOnImplThread(); client_->SetNeedsRedrawOnImplThread();
if (CurrentlyScrollingNode())
skipped_frame_tracker_.WillProduceFrame();
} }
ManagedMemoryPolicy LayerTreeHostImpl::ActualManagedMemoryPolicy() const { ManagedMemoryPolicy LayerTreeHostImpl::ActualManagedMemoryPolicy() const {
......
...@@ -59,7 +59,6 @@ ...@@ -59,7 +59,6 @@
#include "components/viz/common/surfaces/surface_id.h" #include "components/viz/common/surfaces/surface_id.h"
#include "components/viz/common/surfaces/surface_range.h" #include "components/viz/common/surfaces/surface_range.h"
#include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect.h"
#include "ui/latency/frame_metrics.h"
namespace gfx { namespace gfx {
class ScrollOffset; class ScrollOffset;
...@@ -1239,8 +1238,6 @@ class CC_EXPORT LayerTreeHostImpl : public InputHandler, ...@@ -1239,8 +1238,6 @@ class CC_EXPORT LayerTreeHostImpl : public InputHandler,
std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_; std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_;
PresentationTimeCallbackBuffer presentation_time_callbacks_; PresentationTimeCallbackBuffer presentation_time_callbacks_;
ui::FrameMetrics frame_metrics_;
ui::SkippedFrameTracker skipped_frame_tracker_;
bool is_animating_for_snap_; bool is_animating_for_snap_;
const PaintImage::GeneratorClientId paint_image_generator_client_id_; const PaintImage::GeneratorClientId paint_image_generator_client_id_;
......
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