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

Unified Diff: cc/layers/layer_impl.cc

Issue 1013753014: Re-introduce ScrollY trace event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index a1a61618720e9b678b4aa577dee5866da683f52d..a747219aca3aa25618ea06f6b9ec2d8019176c78 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -1322,12 +1322,20 @@ void LayerImpl::SetScrollbarPosition(ScrollbarLayerImplBase* scrollbar_layer,
scrollbar_layer->SetVisibleToTotalLengthRatio(visible_ratio);
} else {
float visible_ratio = clip_rect.height() / scroll_rect.height();
- scrollbar_needs_animation |=
+ bool y_offset_did_change =
scrollbar_layer->SetCurrentPos(current_offset.y());
+ scrollbar_needs_animation |= y_offset_did_change;
scrollbar_needs_animation |=
scrollbar_layer->SetMaximum(scroll_rect.height() - clip_rect.height());
scrollbar_needs_animation |=
scrollbar_layer->SetVisibleToTotalLengthRatio(visible_ratio);
+ // Get the current_offset_.y() value for a sanity-check on scrolling
enne (OOO) 2015/03/24 17:53:21 This comment seems unnecessary.
wjmaclean 2015/03/24 18:21:40 Don't we want to indicate why we're interested in
+ // benchmark metrics. Specifically, we want to make sure
+ // BasicMouseWheelSmoothScrollGesture has proper scroll curves.
+ if (y_offset_did_change && layer_tree_impl()->IsActiveTree()) {
+ TRACE_COUNTER_ID1("gpu", "scroll_offset_y", this->id(),
enne (OOO) 2015/03/24 17:53:21 This should be a cc trace, I think? Should we onl
wjmaclean 2015/03/24 18:21:40 Done.
+ current_offset.y());
+ }
}
if (scrollbar_needs_animation) {
layer_tree_impl()->set_needs_update_draw_properties();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698