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 2777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2788 | 2788 |
2789 active_tree_->SetCurrentlyScrollingNode(scrolling_node); | 2789 active_tree_->SetCurrentlyScrollingNode(scrolling_node); |
2790 // TODO(majidvp): get rid of wheel_scrolling_ and set is_direct_manipulation | 2790 // TODO(majidvp): get rid of wheel_scrolling_ and set is_direct_manipulation |
2791 // in input_handler_proxy instead. | 2791 // in input_handler_proxy instead. |
2792 wheel_scrolling_ = IsWheelBasedScroll(type); | 2792 wheel_scrolling_ = IsWheelBasedScroll(type); |
2793 scroll_state->set_is_direct_manipulation(!wheel_scrolling_); | 2793 scroll_state->set_is_direct_manipulation(!wheel_scrolling_); |
2794 // Invoke |DistributeScrollDelta| even with zero delta and velocity to ensure | 2794 // Invoke |DistributeScrollDelta| even with zero delta and velocity to ensure |
2795 // scroll customization callbacks are invoked. | 2795 // scroll customization callbacks are invoked. |
2796 DistributeScrollDelta(scroll_state); | 2796 DistributeScrollDelta(scroll_state); |
2797 | 2797 |
2798 // If the CurrentlyScrollingNode doesn't exist after distributing scroll | |
2799 // delta, no scroller can scroll in the given delta hint direction(s). | |
2800 if (!active_tree_->CurrentlyScrollingNode()) { | |
2801 scroll_status.thread = InputHandler::SCROLL_IGNORED; | |
2802 scroll_status.main_thread_scrolling_reasons = | |
2803 MainThreadScrollingReason::kNotScrollingOnMain; | |
2804 return scroll_status; | |
2805 } | |
2806 | |
2798 client_->RenewTreePriority(); | 2807 client_->RenewTreePriority(); |
2799 RecordCompositorSlowScrollMetric(type, CC_THREAD); | 2808 RecordCompositorSlowScrollMetric(type, CC_THREAD); |
2800 | 2809 |
2801 UpdateScrollSourceInfo(wheel_scrolling_); | 2810 UpdateScrollSourceInfo(wheel_scrolling_); |
2802 | 2811 |
2803 return scroll_status; | 2812 return scroll_status; |
2804 } | 2813 } |
2805 | 2814 |
2806 InputHandler::ScrollStatus LayerTreeHostImpl::RootScrollBegin( | 2815 InputHandler::ScrollStatus LayerTreeHostImpl::RootScrollBegin( |
2807 ScrollState* scroll_state, | 2816 ScrollState* scroll_state, |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2915 } | 2924 } |
2916 | 2925 |
2917 // If |first_scrolling_layer_or_drawn_scrollbar| is not scrollable, it must | 2926 // If |first_scrolling_layer_or_drawn_scrollbar| is not scrollable, it must |
2918 // be a drawn scrollbar. These hit tests require falling back to main-thread | 2927 // be a drawn scrollbar. These hit tests require falling back to main-thread |
2919 // scrolling. | 2928 // scrolling. |
2920 DCHECK(first_scrolling_layer_or_drawn_scrollbar->IsDrawnScrollbar()); | 2929 DCHECK(first_scrolling_layer_or_drawn_scrollbar->IsDrawnScrollbar()); |
2921 return false; | 2930 return false; |
2922 } | 2931 } |
2923 | 2932 |
2924 InputHandler::ScrollStatus LayerTreeHostImpl::ScrollAnimatedBegin( | 2933 InputHandler::ScrollStatus LayerTreeHostImpl::ScrollAnimatedBegin( |
2925 const gfx::Point& viewport_point) { | 2934 ScrollState* scroll_state) { |
2926 InputHandler::ScrollStatus scroll_status; | 2935 InputHandler::ScrollStatus scroll_status; |
2927 scroll_status.main_thread_scrolling_reasons = | 2936 scroll_status.main_thread_scrolling_reasons = |
2928 MainThreadScrollingReason::kNotScrollingOnMain; | 2937 MainThreadScrollingReason::kNotScrollingOnMain; |
2929 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; | 2938 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; |
2930 ScrollNode* scroll_node = scroll_tree.CurrentlyScrollingNode(); | 2939 ScrollNode* scroll_node = scroll_tree.CurrentlyScrollingNode(); |
2931 if (scroll_node) { | 2940 if (scroll_node) { |
2932 gfx::Vector2dF delta; | 2941 gfx::Vector2dF delta; |
2933 | 2942 |
2934 if (ScrollAnimationUpdateTarget(scroll_node, delta, base::TimeDelta())) { | 2943 if (ScrollAnimationUpdateTarget(scroll_node, delta, base::TimeDelta())) { |
2935 scroll_status.thread = SCROLL_ON_IMPL_THREAD; | 2944 scroll_status.thread = SCROLL_ON_IMPL_THREAD; |
2936 } else { | 2945 } else { |
2937 scroll_status.thread = SCROLL_IGNORED; | 2946 scroll_status.thread = SCROLL_IGNORED; |
2938 scroll_status.main_thread_scrolling_reasons = | 2947 scroll_status.main_thread_scrolling_reasons = |
2939 MainThreadScrollingReason::kNotScrollable; | 2948 MainThreadScrollingReason::kNotScrollable; |
2940 } | 2949 } |
2941 return scroll_status; | 2950 return scroll_status; |
2942 } | 2951 } |
2943 ScrollStateData scroll_state_data; | |
2944 scroll_state_data.position_x = viewport_point.x(); | |
2945 scroll_state_data.position_y = viewport_point.y(); | |
2946 ScrollState scroll_state(scroll_state_data); | |
2947 | 2952 |
2948 // ScrollAnimated is used for animated wheel scrolls. We find the first layer | 2953 // ScrollAnimated is used for animated wheel scrolls. We find the first layer |
2949 // that can scroll and set up an animation of its scroll offset. Note that | 2954 // that can scroll and set up an animation of its scroll offset. Note that |
2950 // this does not currently go through the scroll customization machinery | 2955 // this does not currently go through the scroll customization machinery |
2951 // that ScrollBy uses for non-animated wheel scrolls. | 2956 // that ScrollBy uses for non-animated wheel scrolls. |
2952 scroll_status = ScrollBegin(&scroll_state, WHEEL); | 2957 scroll_status = ScrollBegin(scroll_state, WHEEL); |
2953 if (scroll_status.thread == SCROLL_ON_IMPL_THREAD) { | 2958 if (scroll_status.thread == SCROLL_ON_IMPL_THREAD) { |
2954 scroll_animating_latched_node_id_ = ScrollTree::kInvalidNodeId; | 2959 scroll_animating_latched_node_id_ = ScrollTree::kInvalidNodeId; |
2955 ScrollStateData scroll_state_end_data; | 2960 ScrollStateData scroll_state_end_data; |
2956 scroll_state_end_data.is_ending = true; | 2961 scroll_state_end_data.is_ending = true; |
2957 ScrollState scroll_state_end(scroll_state_end_data); | 2962 ScrollState scroll_state_end(scroll_state_end_data); |
2958 ScrollEnd(&scroll_state_end); | 2963 ScrollEnd(&scroll_state_end); |
2959 } | 2964 } |
2960 return scroll_status; | 2965 return scroll_status; |
2961 } | 2966 } |
2962 | 2967 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3116 scroll_status.thread == SCROLL_ON_IMPL_THREAD) { | 3121 scroll_status.thread == SCROLL_ON_IMPL_THREAD) { |
3117 // If we get to here, we shouldn't return SCROLL_ON_IMPL_THREAD as otherwise | 3122 // If we get to here, we shouldn't return SCROLL_ON_IMPL_THREAD as otherwise |
3118 // we'll mark the scroll as handled and the scroll won't bubble. | 3123 // we'll mark the scroll as handled and the scroll won't bubble. |
3119 scroll_status.thread = SCROLL_IGNORED; | 3124 scroll_status.thread = SCROLL_IGNORED; |
3120 scroll_status.main_thread_scrolling_reasons = | 3125 scroll_status.main_thread_scrolling_reasons = |
3121 MainThreadScrollingReason::kNotScrollable; | 3126 MainThreadScrollingReason::kNotScrollable; |
3122 } | 3127 } |
3123 return scroll_status; | 3128 return scroll_status; |
3124 } | 3129 } |
3125 | 3130 |
3126 gfx::Vector2dF LayerTreeHostImpl::ScrollNodeWithViewportSpaceDelta( | 3131 bool LayerTreeHostImpl::CalculateLocalScrollDeltaAndStartPoint( |
3127 ScrollNode* scroll_node, | 3132 ScrollNode* scroll_node, |
3128 const gfx::PointF& viewport_point, | 3133 const gfx::PointF& viewport_point, |
3129 const gfx::Vector2dF& viewport_delta, | 3134 const gfx::Vector2dF& viewport_delta, |
3130 ScrollTree* scroll_tree) { | 3135 ScrollTree* scroll_tree, |
bokan
2017/06/22 21:44:38
While we're moving things around, please pass this
sahel
2017/06/23 18:22:04
Done.
| |
3136 gfx::PointF* local_start_point, | |
3137 gfx::Vector2dF* local_scroll_delta) { | |
bokan
2017/06/22 21:44:38
call these out_local_start_point and out_local_scr
sahel
2017/06/23 18:22:04
Done.
| |
3131 // Layers with non-invertible screen space transforms should not have passed | 3138 // Layers with non-invertible screen space transforms should not have passed |
3132 // the scroll hit test in the first place. | 3139 // the scroll hit test in the first place. |
3133 const gfx::Transform screen_space_transform = | 3140 const gfx::Transform screen_space_transform = |
3134 scroll_tree->ScreenSpaceTransform(scroll_node->id); | 3141 scroll_tree->ScreenSpaceTransform(scroll_node->id); |
3135 DCHECK(screen_space_transform.IsInvertible()); | 3142 DCHECK(screen_space_transform.IsInvertible()); |
3136 gfx::Transform inverse_screen_space_transform( | 3143 gfx::Transform inverse_screen_space_transform( |
3137 gfx::Transform::kSkipInitialization); | 3144 gfx::Transform::kSkipInitialization); |
3138 bool did_invert = | 3145 bool did_invert = |
3139 screen_space_transform.GetInverse(&inverse_screen_space_transform); | 3146 screen_space_transform.GetInverse(&inverse_screen_space_transform); |
3140 // TODO(shawnsingh): With the advent of impl-side scrolling for non-root | 3147 // TODO(shawnsingh): With the advent of impl-side scrolling for non-root |
3141 // layers, we may need to explicitly handle uninvertible transforms here. | 3148 // layers, we may need to explicitly handle uninvertible transforms here. |
3142 DCHECK(did_invert); | 3149 DCHECK(did_invert); |
3143 | 3150 |
3144 float scale_from_viewport_to_screen_space = | 3151 float scale_from_viewport_to_screen_space = |
3145 active_tree_->device_scale_factor(); | 3152 active_tree_->device_scale_factor(); |
3146 gfx::PointF screen_space_point = | 3153 gfx::PointF screen_space_point = |
3147 gfx::ScalePoint(viewport_point, scale_from_viewport_to_screen_space); | 3154 gfx::ScalePoint(viewport_point, scale_from_viewport_to_screen_space); |
3148 | 3155 |
3149 gfx::Vector2dF screen_space_delta = viewport_delta; | 3156 gfx::Vector2dF screen_space_delta = viewport_delta; |
3150 screen_space_delta.Scale(scale_from_viewport_to_screen_space); | 3157 screen_space_delta.Scale(scale_from_viewport_to_screen_space); |
3151 | 3158 |
3152 // First project the scroll start and end points to local layer space to find | 3159 // Project the scroll start and end points to local layer space to find the |
3153 // the scroll delta in layer coordinates. | 3160 // scroll delta in layer coordinates. |
3154 bool start_clipped, end_clipped; | 3161 bool start_clipped, end_clipped; |
3155 gfx::PointF screen_space_end_point = screen_space_point + screen_space_delta; | 3162 gfx::PointF screen_space_end_point = screen_space_point + screen_space_delta; |
3156 gfx::PointF local_start_point = MathUtil::ProjectPoint( | 3163 *local_start_point = MathUtil::ProjectPoint( |
3157 inverse_screen_space_transform, screen_space_point, &start_clipped); | 3164 inverse_screen_space_transform, screen_space_point, &start_clipped); |
3158 gfx::PointF local_end_point = MathUtil::ProjectPoint( | 3165 gfx::PointF local_end_point = MathUtil::ProjectPoint( |
3159 inverse_screen_space_transform, screen_space_end_point, &end_clipped); | 3166 inverse_screen_space_transform, screen_space_end_point, &end_clipped); |
3167 *local_scroll_delta = local_end_point - *local_start_point; | |
3160 | 3168 |
3161 // In general scroll point coordinates should not get clipped. | 3169 // In general scroll point coordinates should not get clipped. |
3162 DCHECK(!start_clipped); | 3170 DCHECK(!start_clipped); |
3163 DCHECK(!end_clipped); | 3171 DCHECK(!end_clipped); |
bokan
2017/06/22 21:44:38
Do you know when this happens? DCHECK followed by
sahel
2017/06/23 18:22:04
Done.
| |
3164 if (start_clipped || end_clipped) | 3172 if (start_clipped || end_clipped) |
3173 return false; | |
3174 | |
3175 return true; | |
3176 } | |
3177 | |
3178 gfx::Vector2dF LayerTreeHostImpl::ScrollNodeWithViewportSpaceDelta( | |
3179 ScrollNode* scroll_node, | |
3180 const gfx::PointF& viewport_point, | |
3181 const gfx::Vector2dF& viewport_delta, | |
3182 ScrollTree* scroll_tree) { | |
3183 gfx::PointF local_start_point; | |
3184 gfx::Vector2dF local_scroll_delta; | |
3185 if (!CalculateLocalScrollDeltaAndStartPoint( | |
3186 scroll_node, viewport_point, viewport_delta, scroll_tree, | |
3187 &local_start_point, &local_scroll_delta)) | |
3165 return gfx::Vector2dF(); | 3188 return gfx::Vector2dF(); |
3166 | 3189 |
3167 // Apply the scroll delta. | 3190 // Apply the scroll delta. |
3168 gfx::ScrollOffset previous_offset = | 3191 gfx::ScrollOffset previous_offset = |
3169 scroll_tree->current_scroll_offset(scroll_node->element_id); | 3192 scroll_tree->current_scroll_offset(scroll_node->element_id); |
3170 scroll_tree->ScrollBy(scroll_node, local_end_point - local_start_point, | 3193 scroll_tree->ScrollBy(scroll_node, local_scroll_delta, active_tree()); |
3171 active_tree()); | |
3172 gfx::ScrollOffset scrolled = | 3194 gfx::ScrollOffset scrolled = |
3173 scroll_tree->current_scroll_offset(scroll_node->element_id) - | 3195 scroll_tree->current_scroll_offset(scroll_node->element_id) - |
3174 previous_offset; | 3196 previous_offset; |
3175 | 3197 |
3176 // Get the end point in the layer's content space so we can apply its | 3198 // Get the end point in the layer's content space so we can apply its |
3177 // ScreenSpaceTransform. | 3199 // ScreenSpaceTransform. |
3178 gfx::PointF actual_local_end_point = | 3200 gfx::PointF actual_local_end_point = |
3179 local_start_point + gfx::Vector2dF(scrolled.x(), scrolled.y()); | 3201 local_start_point + gfx::Vector2dF(scrolled.x(), scrolled.y()); |
3180 | 3202 |
3181 // Calculate the applied scroll delta in viewport space coordinates. | 3203 // Calculate the applied scroll delta in viewport space coordinates. |
3204 bool end_clipped; | |
3205 const gfx::Transform screen_space_transform = | |
3206 scroll_tree->ScreenSpaceTransform(scroll_node->id); | |
3182 gfx::PointF actual_screen_space_end_point = MathUtil::MapPoint( | 3207 gfx::PointF actual_screen_space_end_point = MathUtil::MapPoint( |
3183 screen_space_transform, actual_local_end_point, &end_clipped); | 3208 screen_space_transform, actual_local_end_point, &end_clipped); |
3184 DCHECK(!end_clipped); | 3209 DCHECK(!end_clipped); |
bokan
2017/06/22 21:44:38
Ditto here, remove DCHECK.
sahel
2017/06/23 18:22:04
Done.
| |
3185 if (end_clipped) | 3210 if (end_clipped) |
3186 return gfx::Vector2dF(); | 3211 return gfx::Vector2dF(); |
3212 | |
3213 float scale_from_viewport_to_screen_space = | |
3214 active_tree_->device_scale_factor(); | |
3187 gfx::PointF actual_viewport_end_point = gfx::ScalePoint( | 3215 gfx::PointF actual_viewport_end_point = gfx::ScalePoint( |
3188 actual_screen_space_end_point, 1.f / scale_from_viewport_to_screen_space); | 3216 actual_screen_space_end_point, 1.f / scale_from_viewport_to_screen_space); |
3189 return actual_viewport_end_point - viewport_point; | 3217 return actual_viewport_end_point - viewport_point; |
3190 } | 3218 } |
3191 | 3219 |
3192 static gfx::Vector2dF ScrollNodeWithLocalDelta( | 3220 static gfx::Vector2dF ScrollNodeWithLocalDelta( |
3193 ScrollNode* scroll_node, | 3221 ScrollNode* scroll_node, |
3194 const gfx::Vector2dF& local_delta, | 3222 const gfx::Vector2dF& local_delta, |
3195 float page_scale_factor, | 3223 float page_scale_factor, |
3196 LayerTreeImpl* layer_tree_impl) { | 3224 LayerTreeImpl* layer_tree_impl) { |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3307 } | 3335 } |
3308 | 3336 |
3309 void LayerTreeHostImpl::DistributeScrollDelta(ScrollState* scroll_state) { | 3337 void LayerTreeHostImpl::DistributeScrollDelta(ScrollState* scroll_state) { |
3310 // TODO(majidvp): in Blink we compute scroll chain only at scroll begin which | 3338 // TODO(majidvp): in Blink we compute scroll chain only at scroll begin which |
3311 // is not the case here. We eventually want to have the same behaviour on both | 3339 // is not the case here. We eventually want to have the same behaviour on both |
3312 // sides but it may become a non issue if we get rid of scroll chaining (see | 3340 // sides but it may become a non issue if we get rid of scroll chaining (see |
3313 // crbug.com/526462) | 3341 // crbug.com/526462) |
3314 std::list<ScrollNode*> current_scroll_chain; | 3342 std::list<ScrollNode*> current_scroll_chain; |
3315 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; | 3343 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; |
3316 ScrollNode* scroll_node = scroll_tree.CurrentlyScrollingNode(); | 3344 ScrollNode* scroll_node = scroll_tree.CurrentlyScrollingNode(); |
3317 ScrollNode* viewport_scroll_node = OuterViewportScrollNode(); | 3345 ScrollNode* viewport_scroll_node = |
3346 viewport()->MainScrollLayer() | |
3347 ? scroll_tree.Node(viewport()->MainScrollLayer()->scroll_tree_index()) | |
3348 : nullptr; | |
3318 if (scroll_node) { | 3349 if (scroll_node) { |
3319 // TODO(bokan): The loop checks for a null parent but don't we still want to | 3350 // TODO(bokan): The loop checks for a null parent but don't we still want to |
3320 // distribute to the root scroll node? | 3351 // distribute to the root scroll node? |
3321 for (; scroll_tree.parent(scroll_node); | 3352 for (; scroll_tree.parent(scroll_node); |
3322 scroll_node = scroll_tree.parent(scroll_node)) { | 3353 scroll_node = scroll_tree.parent(scroll_node)) { |
3323 if (scroll_node == viewport_scroll_node) { | 3354 if (scroll_node == viewport_scroll_node) { |
3324 // Don't chain scrolls past the outer viewport scroll layer. Once we | 3355 // Don't chain scrolls past the outer viewport scroll layer. Once we |
3325 // reach that, we should scroll the viewport which is represented by the | 3356 // reach that, we should scroll the viewport which is represented by the |
3326 // main viewport scroll layer. | 3357 // main viewport scroll layer. |
3327 DCHECK(viewport_scroll_node); | 3358 DCHECK(viewport_scroll_node); |
3328 current_scroll_chain.push_front(viewport_scroll_node); | 3359 current_scroll_chain.push_front(viewport_scroll_node); |
3329 break; | 3360 break; |
3330 } | 3361 } |
3331 | 3362 |
3332 if (!scroll_node->scrollable) | 3363 if (!scroll_node->scrollable) |
3333 continue; | 3364 continue; |
3334 | 3365 |
3335 current_scroll_chain.push_front(scroll_node); | 3366 if (CanConsumeDelta(scroll_node, *scroll_state)) |
3367 current_scroll_chain.push_front(scroll_node); | |
3336 } | 3368 } |
3337 } | 3369 } |
3370 active_tree_->SetCurrentlyScrollingNode( | |
3371 current_scroll_chain.empty() ? nullptr : current_scroll_chain.back()); | |
3338 scroll_state->set_scroll_chain_and_layer_tree(current_scroll_chain, | 3372 scroll_state->set_scroll_chain_and_layer_tree(current_scroll_chain, |
3339 active_tree()); | 3373 active_tree()); |
3340 scroll_state->DistributeToScrollChainDescendant(); | 3374 scroll_state->DistributeToScrollChainDescendant(); |
3341 } | 3375 } |
3342 | 3376 |
3377 bool LayerTreeHostImpl::CanConsumeDelta(ScrollNode* scroll_node, | |
3378 const ScrollState& scroll_state) { | |
3379 gfx::Vector2dF delta_to_scroll; | |
3380 if (scroll_state.is_beginning()) { | |
3381 if (scroll_state.ignore_delta_hints()) | |
3382 return true; | |
3383 | |
3384 delta_to_scroll = gfx::Vector2dF(scroll_state.delta_x_hint(), | |
3385 scroll_state.delta_y_hint()); | |
3386 } else { | |
3387 delta_to_scroll = | |
3388 gfx::Vector2dF(scroll_state.delta_x(), scroll_state.delta_y()); | |
3389 } | |
3390 | |
3391 if (delta_to_scroll == gfx::Vector2dF()) | |
3392 return true; | |
3393 | |
3394 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; | |
3395 if (scroll_state.is_direct_manipulation()) { | |
3396 gfx::PointF local_start_point; | |
bokan
2017/06/22 21:44:38
If you sometimes don't need the output of an out p
sahel
2017/06/23 18:22:04
Done.
| |
3397 gfx::Vector2dF local_scroll_delta; | |
3398 if (!CalculateLocalScrollDeltaAndStartPoint( | |
3399 scroll_node, | |
3400 gfx::PointF(scroll_state.position_x(), scroll_state.position_y()), | |
3401 delta_to_scroll, &scroll_tree, &local_start_point, | |
3402 &local_scroll_delta)) { | |
bokan
2017/06/22 21:44:38
just pass in &delta_to_scroll
sahel
2017/06/23 18:22:04
Done.
| |
3403 return false; | |
3404 } | |
3405 delta_to_scroll = local_scroll_delta; | |
3406 } | |
3407 | |
3408 if (ComputeScrollDelta(scroll_node, delta_to_scroll) != gfx::Vector2dF()) | |
3409 return true; | |
3410 | |
3411 if (scroll_node->scrolls_inner_viewport) { | |
3412 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; | |
3413 ScrollNode* viewport_scroll_node = | |
3414 viewport()->MainScrollLayer() | |
3415 ? scroll_tree.Node( | |
3416 viewport()->MainScrollLayer()->scroll_tree_index()) | |
3417 : nullptr; | |
3418 if (viewport_scroll_node) | |
3419 return ComputeScrollDelta(viewport_scroll_node, delta_to_scroll) != | |
3420 gfx::Vector2dF(); | |
3421 } | |
3422 | |
3423 return false; | |
3424 } | |
3425 | |
3343 InputHandlerScrollResult LayerTreeHostImpl::ScrollBy( | 3426 InputHandlerScrollResult LayerTreeHostImpl::ScrollBy( |
3344 ScrollState* scroll_state) { | 3427 ScrollState* scroll_state) { |
3345 DCHECK(scroll_state); | 3428 DCHECK(scroll_state); |
3346 | 3429 |
3347 TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBy"); | 3430 TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBy"); |
3348 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; | 3431 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; |
3349 ScrollNode* scroll_node = scroll_tree.CurrentlyScrollingNode(); | 3432 ScrollNode* scroll_node = scroll_tree.CurrentlyScrollingNode(); |
3350 | 3433 |
3351 if (!scroll_node) | 3434 if (!scroll_node) |
3352 return InputHandlerScrollResult(); | 3435 return InputHandlerScrollResult(); |
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4314 | 4397 |
4315 void LayerTreeHostImpl::ShowScrollbarsForImplScroll(ElementId element_id) { | 4398 void LayerTreeHostImpl::ShowScrollbarsForImplScroll(ElementId element_id) { |
4316 if (!element_id) | 4399 if (!element_id) |
4317 return; | 4400 return; |
4318 if (ScrollbarAnimationController* animation_controller = | 4401 if (ScrollbarAnimationController* animation_controller = |
4319 ScrollbarAnimationControllerForElementId(element_id)) | 4402 ScrollbarAnimationControllerForElementId(element_id)) |
4320 animation_controller->DidScrollUpdate(); | 4403 animation_controller->DidScrollUpdate(); |
4321 } | 4404 } |
4322 | 4405 |
4323 } // namespace cc | 4406 } // namespace cc |
OLD | NEW |