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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 2040543002: Take MT jank into account when animating the scroll offset on CC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
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/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 2800 matching lines...) Expand 10 before | Expand all | Expand 10 after
2811 gfx::ScrollOffset target_offset = scroll_tree.ClampScrollOffsetToLimits( 2811 gfx::ScrollOffset target_offset = scroll_tree.ClampScrollOffsetToLimits(
2812 current_offset + gfx::ScrollOffset(delta), scroll_node); 2812 current_offset + gfx::ScrollOffset(delta), scroll_node);
2813 animation_host_->ImplOnlyScrollAnimationCreate(scroll_node->owner_id, 2813 animation_host_->ImplOnlyScrollAnimationCreate(scroll_node->owner_id,
2814 target_offset, current_offset); 2814 target_offset, current_offset);
2815 2815
2816 SetNeedsOneBeginImplFrame(); 2816 SetNeedsOneBeginImplFrame();
2817 2817
2818 return true; 2818 return true;
2819 } 2819 }
2820 2820
2821 void LayerTreeHostImpl::AdjustDuration(base::TimeDelta adjustment) {
2822 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree;
2823 ScrollNode* scroll_node = scroll_tree.CurrentlyScrollingNode();
2824 if (scroll_node) {
2825 animation_host_->ImplOnlyScrollAnimationAdjustDuration(
2826 scroll_node->owner_id, adjustment);
2827 }
2828 }
2829
2821 InputHandler::ScrollStatus LayerTreeHostImpl::ScrollAnimated( 2830 InputHandler::ScrollStatus LayerTreeHostImpl::ScrollAnimated(
2822 const gfx::Point& viewport_point, 2831 const gfx::Point& viewport_point,
2823 const gfx::Vector2dF& scroll_delta) { 2832 const gfx::Vector2dF& scroll_delta) {
2824 InputHandler::ScrollStatus scroll_status; 2833 InputHandler::ScrollStatus scroll_status;
2825 scroll_status.main_thread_scrolling_reasons = 2834 scroll_status.main_thread_scrolling_reasons =
2826 MainThreadScrollingReason::kNotScrollingOnMain; 2835 MainThreadScrollingReason::kNotScrollingOnMain;
2827 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; 2836 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree;
2828 ScrollNode* scroll_node = scroll_tree.CurrentlyScrollingNode(); 2837 ScrollNode* scroll_node = scroll_tree.CurrentlyScrollingNode();
2829 if (scroll_node) { 2838 if (scroll_node) {
2830 gfx::Vector2dF delta = scroll_delta; 2839 gfx::Vector2dF delta = scroll_delta;
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after
4049 const { 4058 const {
4050 return fixed_raster_scale_attempted_scale_change_history_.count() >= 4059 return fixed_raster_scale_attempted_scale_change_history_.count() >=
4051 kFixedRasterScaleAttemptedScaleChangeThreshold; 4060 kFixedRasterScaleAttemptedScaleChangeThreshold;
4052 } 4061 }
4053 4062
4054 void LayerTreeHostImpl::SetFixedRasterScaleAttemptedToChangeScale() { 4063 void LayerTreeHostImpl::SetFixedRasterScaleAttemptedToChangeScale() {
4055 fixed_raster_scale_attempted_scale_change_history_.set(0); 4064 fixed_raster_scale_attempted_scale_change_history_.set(0);
4056 } 4065 }
4057 4066
4058 } // namespace cc 4067 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698