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

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

Issue 2840883003: Experimental fix for scroll animation update bug. [DO NOT COMMIT THIS CHANGE]
Patch Set: Created 3 years, 7 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 2941 matching lines...) Expand 10 before | Expand all | Expand 10 after
2952 2952
2953 gfx::Vector2dF delta = scroll_delta; 2953 gfx::Vector2dF delta = scroll_delta;
2954 if (!scroll_node->user_scrollable_horizontal) 2954 if (!scroll_node->user_scrollable_horizontal)
2955 delta.set_x(0); 2955 delta.set_x(0);
2956 if (!scroll_node->user_scrollable_vertical) 2956 if (!scroll_node->user_scrollable_vertical)
2957 delta.set_y(0); 2957 delta.set_y(0);
2958 2958
2959 if (ScrollAnimationUpdateTarget(scroll_node, delta, delayed_by)) { 2959 if (ScrollAnimationUpdateTarget(scroll_node, delta, delayed_by)) {
2960 scroll_status.thread = SCROLL_ON_IMPL_THREAD; 2960 scroll_status.thread = SCROLL_ON_IMPL_THREAD;
2961 } else { 2961 } else {
2962 scroll_status.thread = SCROLL_IGNORED; 2962 if (ScrollAnimationCreate(scroll_node, scroll_delta, delayed_by)) {
2963 scroll_status.main_thread_scrolling_reasons = 2963 scroll_animating_latched_node_id_ = scroll_node->id;
2964 MainThreadScrollingReason::kNotScrollable; 2964 scroll_status.thread = SCROLL_ON_IMPL_THREAD;
2965 } else {
2966 scroll_status.thread = SCROLL_IGNORED;
2967 scroll_status.main_thread_scrolling_reasons =
2968 MainThreadScrollingReason::kNotScrollable;
2969 }
2965 } 2970 }
2966 return scroll_status; 2971 return scroll_status;
2967 } 2972 }
2968 2973
2969 ScrollStateData scroll_state_data; 2974 ScrollStateData scroll_state_data;
2970 scroll_state_data.position_x = viewport_point.x(); 2975 scroll_state_data.position_x = viewport_point.x();
2971 scroll_state_data.position_y = viewport_point.y(); 2976 scroll_state_data.position_y = viewport_point.y();
2972 ScrollState scroll_state(scroll_state_data); 2977 ScrollState scroll_state(scroll_state_data);
2973 2978
2974 // ScrollAnimated is used for animated wheel scrolls. We find the first layer 2979 // ScrollAnimated is used for animated wheel scrolls. We find the first layer
(...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after
4296 } 4301 }
4297 4302
4298 void LayerTreeHostImpl::UpdateScrollSourceInfo(bool is_wheel_scroll) { 4303 void LayerTreeHostImpl::UpdateScrollSourceInfo(bool is_wheel_scroll) {
4299 if (is_wheel_scroll) 4304 if (is_wheel_scroll)
4300 has_scrolled_by_wheel_ = true; 4305 has_scrolled_by_wheel_ = true;
4301 else 4306 else
4302 has_scrolled_by_touch_ = true; 4307 has_scrolled_by_touch_ = true;
4303 } 4308 }
4304 4309
4305 } // namespace cc 4310 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/scroll_offset_animations_impl.cc ('k') | content/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698