Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 2770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2781 } else { | 2781 } else { |
| 2782 scroll_status.thread = SCROLL_IGNORED; | 2782 scroll_status.thread = SCROLL_IGNORED; |
| 2783 scroll_status.main_thread_scrolling_reasons = | 2783 scroll_status.main_thread_scrolling_reasons = |
| 2784 MainThreadScrollingReason::kNotScrollable; | 2784 MainThreadScrollingReason::kNotScrollable; |
| 2785 } | 2785 } |
| 2786 return scroll_status; | 2786 return scroll_status; |
| 2787 } | 2787 } |
| 2788 ScrollStateData scroll_state_data; | 2788 ScrollStateData scroll_state_data; |
| 2789 scroll_state_data.position_x = viewport_point.x(); | 2789 scroll_state_data.position_x = viewport_point.x(); |
| 2790 scroll_state_data.position_y = viewport_point.y(); | 2790 scroll_state_data.position_y = viewport_point.y(); |
| 2791 scroll_state_data.is_in_inertial_phase = true; | 2791 scroll_state_data.is_in_inertial_phase = false; |
| 2792 ScrollState scroll_state(scroll_state_data); | 2792 ScrollState scroll_state(scroll_state_data); |
| 2793 | 2793 |
| 2794 // ScrollAnimated is used for animated wheel scrolls. We find the first layer | 2794 // ScrollAnimated is used for animated wheel scrolls. We find the first layer |
| 2795 // that can scroll and set up an animation of its scroll offset. Note that | 2795 // that can scroll and set up an animation of its scroll offset. Note that |
| 2796 // this does not currently go through the scroll customization machinery | 2796 // this does not currently go through the scroll customization machinery |
| 2797 // that ScrollBy uses for non-animated wheel scrolls. | 2797 // that ScrollBy uses for non-animated wheel scrolls. |
| 2798 scroll_status = ScrollBegin(&scroll_state, WHEEL); | 2798 scroll_status = ScrollBegin(&scroll_state, WHEEL); |
| 2799 scroll_node = scroll_tree.CurrentlyScrollingNode(); | 2799 scroll_node = scroll_tree.CurrentlyScrollingNode(); |
| 2800 if (scroll_status.thread == SCROLL_ON_IMPL_THREAD) { | 2800 if (scroll_status.thread == SCROLL_ON_IMPL_THREAD) { |
| 2801 ScrollStateData scroll_state_end_data; | 2801 ScrollStateData scroll_state_end_data; |
| 2802 scroll_state_end_data.is_ending = true; | 2802 scroll_state_end_data.is_ending = true; |
| 2803 ScrollState scroll_state_end(scroll_state_end_data); | 2803 ScrollState scroll_state_end(scroll_state_end_data); |
| 2804 // TODO(Sahel): Once the touchpad scroll latching for Non-mac devices is | |
| 2805 // impelemented, the current scrolling layer should not get cleared after | |
|
tdresser
2016/08/31 13:10:05
implemented
sahel
2016/08/31 14:25:10
Done.
| |
| 2806 // each animation (crbug.com/526463). | |
| 2804 ScrollEnd(&scroll_state_end); | 2807 ScrollEnd(&scroll_state_end); |
| 2808 ClearCurrentlyScrollingLayer(); | |
|
ymalik
2016/08/31 14:01:55
I suspect that this is working correctly now becau
sahel
2016/08/31 14:25:09
It is working because of the call. The problem was
| |
| 2805 } | 2809 } |
| 2806 return scroll_status; | 2810 return scroll_status; |
| 2807 } | 2811 } |
| 2808 | 2812 |
| 2809 gfx::Vector2dF LayerTreeHostImpl::ComputeScrollDelta( | 2813 gfx::Vector2dF LayerTreeHostImpl::ComputeScrollDelta( |
| 2810 ScrollNode* scroll_node, | 2814 ScrollNode* scroll_node, |
| 2811 const gfx::Vector2dF& delta) { | 2815 const gfx::Vector2dF& delta) { |
| 2812 ScrollTree& scroll_tree = active_tree()->property_trees()->scroll_tree; | 2816 ScrollTree& scroll_tree = active_tree()->property_trees()->scroll_tree; |
| 2813 float scale_factor = active_tree()->current_page_scale_factor(); | 2817 float scale_factor = active_tree()->current_page_scale_factor(); |
| 2814 | 2818 |
| (...skipping 1373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4188 return task_runner_provider_->HasImplThread(); | 4192 return task_runner_provider_->HasImplThread(); |
| 4189 } | 4193 } |
| 4190 | 4194 |
| 4191 bool LayerTreeHostImpl::CommitToActiveTree() const { | 4195 bool LayerTreeHostImpl::CommitToActiveTree() const { |
| 4192 // In single threaded mode we skip the pending tree and commit directly to the | 4196 // In single threaded mode we skip the pending tree and commit directly to the |
| 4193 // active tree. | 4197 // active tree. |
| 4194 return !task_runner_provider_->HasImplThread(); | 4198 return !task_runner_provider_->HasImplThread(); |
| 4195 } | 4199 } |
| 4196 | 4200 |
| 4197 } // namespace cc | 4201 } // namespace cc |
| OLD | NEW |