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

Side by Side Diff: ui/compositor/layer.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, 10 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 unified diff | Download patch
« no previous file with comments | « ui/compositor/layer.h ('k') | ui/compositor/layer_animation_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/compositor/layer.h" 5 #include "ui/compositor/layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 1075
1076 float Layer::GetDeviceScaleFactor() const { 1076 float Layer::GetDeviceScaleFactor() const {
1077 return device_scale_factor_; 1077 return device_scale_factor_;
1078 } 1078 }
1079 1079
1080 LayerAnimatorCollection* Layer::GetLayerAnimatorCollection() { 1080 LayerAnimatorCollection* Layer::GetLayerAnimatorCollection() {
1081 Compositor* compositor = GetCompositor(); 1081 Compositor* compositor = GetCompositor();
1082 return compositor ? compositor->layer_animator_collection() : NULL; 1082 return compositor ? compositor->layer_animator_collection() : NULL;
1083 } 1083 }
1084 1084
1085 int Layer::GetFrameNumber() const {
1086 const Compositor* compositor = GetCompositor();
1087 return compositor ? compositor->committed_frame_number() : 0;
1088 }
1089
1090 float Layer::GetRefreshRate() const {
1091 const Compositor* compositor = GetCompositor();
1092 return compositor ? compositor->refresh_rate() : 60.0;
1093 }
1094
1085 cc::Layer* Layer::GetCcLayer() const { 1095 cc::Layer* Layer::GetCcLayer() const {
1086 return cc_layer_; 1096 return cc_layer_;
1087 } 1097 }
1088 1098
1089 LayerThreadedAnimationDelegate* Layer::GetThreadedAnimationDelegate() { 1099 LayerThreadedAnimationDelegate* Layer::GetThreadedAnimationDelegate() {
1090 DCHECK(animator_); 1100 DCHECK(animator_);
1091 return animator_.get(); 1101 return animator_.get();
1092 } 1102 }
1093 1103
1094 void Layer::CreateCcLayer() { 1104 void Layer::CreateCcLayer() {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
1166 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), 1176 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(),
1167 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { 1177 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) {
1168 return mirror_ptr.get() == mirror; 1178 return mirror_ptr.get() == mirror;
1169 }); 1179 });
1170 1180
1171 DCHECK(it != mirrors_.end()); 1181 DCHECK(it != mirrors_.end());
1172 mirrors_.erase(it); 1182 mirrors_.erase(it);
1173 } 1183 }
1174 1184
1175 } // namespace ui 1185 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/layer.h ('k') | ui/compositor/layer_animation_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698