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

Unified Diff: ui/compositor/compositor.cc

Issue 2631333002: [animations] Adds metrics for jank on selected layer animations (Closed)
Patch Set: Adds UMA reporting for ripples and overview mode (query refresh rate) Created 3 years, 11 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 | « ui/compositor/compositor.h ('k') | ui/compositor/layer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/compositor.cc
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index fb0fe72e4786b2f078102bc32582b471bf288cef..224ac86603ec7d054e5da1bb553d5b0bc031086c 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -80,6 +80,7 @@ Compositor::Compositor(const cc::FrameSinkId& frame_sink_id,
context_factory_private_(context_factory_private),
root_layer_(NULL),
widget_(gfx::kNullAcceleratedWidget),
+ committed_frame_number_(0),
widget_valid_(false),
compositor_frame_sink_requested_(false),
frame_sink_id_(frame_sink_id),
@@ -106,7 +107,7 @@ Compositor::Compositor(const cc::FrameSinkId& frame_sink_id,
settings.layers_always_allowed_lcd_text = true;
// Use occlusion to allow more overlapping windows to take less memory.
settings.use_occlusion_for_tile_prioritization = true;
- settings.renderer_settings.refresh_rate =
+ refresh_rate_ = settings.renderer_settings.refresh_rate =
context_factory_->DoesCreateTestContexts() ? kTestRefreshRate
: kDefaultRefreshRate;
settings.main_frame_before_activation_enabled = false;
@@ -389,6 +390,9 @@ bool Compositor::GetScrollOffsetForLayer(int layer_id,
void Compositor::SetAuthoritativeVSyncInterval(
const base::TimeDelta& interval) {
+ DCHECK_GT(interval.InMillisecondsF(), 0);
+ refresh_rate_ =
+ base::Time::kMillisecondsPerSecond / interval.InMillisecondsF();
if (context_factory_private_)
context_factory_private_->SetAuthoritativeVSyncInterval(this, interval);
vsync_manager_->SetAuthoritativeVSyncInterval(interval);
@@ -400,6 +404,9 @@ void Compositor::SetDisplayVSyncParameters(base::TimeTicks timebase,
// TODO(brianderson): We should not be receiving 0 intervals.
interval = cc::BeginFrameArgs::DefaultInterval();
}
+ DCHECK_GT(interval.InMillisecondsF(), 0);
+ refresh_rate_ =
+ base::Time::kMillisecondsPerSecond / interval.InMillisecondsF();
if (context_factory_private_) {
context_factory_private_->SetDisplayVSyncParameters(this, timebase,
@@ -506,6 +513,7 @@ void Compositor::DidCommit() {
}
void Compositor::DidReceiveCompositorFrameAck() {
+ ++committed_frame_number_;
for (auto& observer : observer_list_)
observer.OnCompositingEnded(this);
}
« no previous file with comments | « ui/compositor/compositor.h ('k') | ui/compositor/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698