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

Side by Side Diff: cc/layers/layer_impl.cc

Issue 26880010: gfx: Add FrameTime and DisplayTime classes (Closed) Base URL: http://git.chromium.org/chromium/src.git@checkHighResNow4
Patch Set: WIP Created 7 years, 1 month 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 | « cc/layers/heads_up_display_layer_impl.cc ('k') | cc/layers/picture_layer_impl.cc » ('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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "cc/layers/layer_impl.h" 5 #include "cc/layers/layer_impl.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "cc/animation/animation_registrar.h" 9 #include "cc/animation/animation_registrar.h"
10 #include "cc/animation/scrollbar_animation_controller.h" 10 #include "cc/animation/scrollbar_animation_controller.h"
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 vertical_scrollbar_layer_->SetVisibleToTotalLengthRatio( 965 vertical_scrollbar_layer_->SetVisibleToTotalLengthRatio(
966 viewport.height() / scrollable_size.height()); 966 viewport.height() / scrollable_size.height());
967 } 967 }
968 968
969 if (current_offset == last_scroll_offset_) 969 if (current_offset == last_scroll_offset_)
970 return; 970 return;
971 last_scroll_offset_ = current_offset; 971 last_scroll_offset_ = current_offset;
972 972
973 if (scrollbar_animation_controller_) { 973 if (scrollbar_animation_controller_) {
974 bool should_animate = scrollbar_animation_controller_->DidScrollUpdate( 974 bool should_animate = scrollbar_animation_controller_->DidScrollUpdate(
975 layer_tree_impl_->CurrentPhysicalTimeTicks()); 975 layer_tree_impl_->CurrentPhysicalFrameTime());
976 if (should_animate) 976 if (should_animate)
977 layer_tree_impl_->StartScrollbarAnimation(); 977 layer_tree_impl_->StartScrollbarAnimation();
978 } 978 }
979 979
980 // Get the current_offset_.y() value for a sanity-check on scrolling 980 // Get the current_offset_.y() value for a sanity-check on scrolling
981 // benchmark metrics. Specifically, we want to make sure 981 // benchmark metrics. Specifically, we want to make sure
982 // BasicMouseWheelSmoothScrollGesture has proper scroll curves. 982 // BasicMouseWheelSmoothScrollGesture has proper scroll curves.
983 if (layer_tree_impl()->IsActiveTree()) { 983 if (layer_tree_impl()->IsActiveTree()) {
984 TRACE_COUNTER_ID1("gpu", "scroll_offset_y", this->id(), current_offset.y()); 984 TRACE_COUNTER_ID1("gpu", "scroll_offset_y", this->id(), current_offset.y());
985 } 985 }
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
1326 1326
1327 size_t LayerImpl::GPUMemoryUsageInBytes() const { return 0; } 1327 size_t LayerImpl::GPUMemoryUsageInBytes() const { return 0; }
1328 1328
1329 scoped_ptr<base::Value> LayerImpl::AsValue() const { 1329 scoped_ptr<base::Value> LayerImpl::AsValue() const {
1330 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); 1330 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
1331 AsValueInto(state.get()); 1331 AsValueInto(state.get());
1332 return state.PassAs<base::Value>(); 1332 return state.PassAs<base::Value>();
1333 } 1333 }
1334 1334
1335 } // namespace cc 1335 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/heads_up_display_layer_impl.cc ('k') | cc/layers/picture_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698