| 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 const 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 const ScrollTree& scroll_tree, |
| 3136 gfx::Vector2dF* out_local_scroll_delta, |
| 3137 gfx::PointF* out_local_start_point /*= nullptr*/) { |
| 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 gfx::PointF 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 DCHECK(out_local_scroll_delta); |
| 3168 *out_local_scroll_delta = local_end_point - local_start_point; |
| 3160 | 3169 |
| 3161 // In general scroll point coordinates should not get clipped. | 3170 if (out_local_start_point) |
| 3162 DCHECK(!start_clipped); | 3171 *out_local_start_point = local_start_point; |
| 3163 DCHECK(!end_clipped); | 3172 |
| 3164 if (start_clipped || end_clipped) | 3173 if (start_clipped || end_clipped) |
| 3174 return false; |
| 3175 |
| 3176 return true; |
| 3177 } |
| 3178 |
| 3179 gfx::Vector2dF LayerTreeHostImpl::ScrollNodeWithViewportSpaceDelta( |
| 3180 ScrollNode* scroll_node, |
| 3181 const gfx::PointF& viewport_point, |
| 3182 const gfx::Vector2dF& viewport_delta, |
| 3183 ScrollTree* scroll_tree) { |
| 3184 gfx::PointF local_start_point; |
| 3185 gfx::Vector2dF local_scroll_delta; |
| 3186 if (!CalculateLocalScrollDeltaAndStartPoint( |
| 3187 *scroll_node, viewport_point, viewport_delta, *scroll_tree, |
| 3188 &local_scroll_delta, &local_start_point)) { |
| 3165 return gfx::Vector2dF(); | 3189 return gfx::Vector2dF(); |
| 3190 } |
| 3166 | 3191 |
| 3167 // Apply the scroll delta. | 3192 // Apply the scroll delta. |
| 3168 gfx::ScrollOffset previous_offset = | 3193 gfx::ScrollOffset previous_offset = |
| 3169 scroll_tree->current_scroll_offset(scroll_node->element_id); | 3194 scroll_tree->current_scroll_offset(scroll_node->element_id); |
| 3170 scroll_tree->ScrollBy(scroll_node, local_end_point - local_start_point, | 3195 scroll_tree->ScrollBy(scroll_node, local_scroll_delta, active_tree()); |
| 3171 active_tree()); | |
| 3172 gfx::ScrollOffset scrolled = | 3196 gfx::ScrollOffset scrolled = |
| 3173 scroll_tree->current_scroll_offset(scroll_node->element_id) - | 3197 scroll_tree->current_scroll_offset(scroll_node->element_id) - |
| 3174 previous_offset; | 3198 previous_offset; |
| 3175 | 3199 |
| 3176 // Get the end point in the layer's content space so we can apply its | 3200 // Get the end point in the layer's content space so we can apply its |
| 3177 // ScreenSpaceTransform. | 3201 // ScreenSpaceTransform. |
| 3178 gfx::PointF actual_local_end_point = | 3202 gfx::PointF actual_local_end_point = |
| 3179 local_start_point + gfx::Vector2dF(scrolled.x(), scrolled.y()); | 3203 local_start_point + gfx::Vector2dF(scrolled.x(), scrolled.y()); |
| 3180 | 3204 |
| 3181 // Calculate the applied scroll delta in viewport space coordinates. | 3205 // Calculate the applied scroll delta in viewport space coordinates. |
| 3206 bool end_clipped; |
| 3207 const gfx::Transform screen_space_transform = |
| 3208 scroll_tree->ScreenSpaceTransform(scroll_node->id); |
| 3182 gfx::PointF actual_screen_space_end_point = MathUtil::MapPoint( | 3209 gfx::PointF actual_screen_space_end_point = MathUtil::MapPoint( |
| 3183 screen_space_transform, actual_local_end_point, &end_clipped); | 3210 screen_space_transform, actual_local_end_point, &end_clipped); |
| 3184 DCHECK(!end_clipped); | 3211 DCHECK(!end_clipped); |
| 3185 if (end_clipped) | 3212 if (end_clipped) |
| 3186 return gfx::Vector2dF(); | 3213 return gfx::Vector2dF(); |
| 3214 |
| 3215 float scale_from_viewport_to_screen_space = |
| 3216 active_tree_->device_scale_factor(); |
| 3187 gfx::PointF actual_viewport_end_point = gfx::ScalePoint( | 3217 gfx::PointF actual_viewport_end_point = gfx::ScalePoint( |
| 3188 actual_screen_space_end_point, 1.f / scale_from_viewport_to_screen_space); | 3218 actual_screen_space_end_point, 1.f / scale_from_viewport_to_screen_space); |
| 3189 return actual_viewport_end_point - viewport_point; | 3219 return actual_viewport_end_point - viewport_point; |
| 3190 } | 3220 } |
| 3191 | 3221 |
| 3192 static gfx::Vector2dF ScrollNodeWithLocalDelta( | 3222 static gfx::Vector2dF ScrollNodeWithLocalDelta( |
| 3193 ScrollNode* scroll_node, | 3223 ScrollNode* scroll_node, |
| 3194 const gfx::Vector2dF& local_delta, | 3224 const gfx::Vector2dF& local_delta, |
| 3195 float page_scale_factor, | 3225 float page_scale_factor, |
| 3196 LayerTreeImpl* layer_tree_impl) { | 3226 LayerTreeImpl* layer_tree_impl) { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3307 } | 3337 } |
| 3308 | 3338 |
| 3309 void LayerTreeHostImpl::DistributeScrollDelta(ScrollState* scroll_state) { | 3339 void LayerTreeHostImpl::DistributeScrollDelta(ScrollState* scroll_state) { |
| 3310 // TODO(majidvp): in Blink we compute scroll chain only at scroll begin which | 3340 // 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 | 3341 // 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 | 3342 // sides but it may become a non issue if we get rid of scroll chaining (see |
| 3313 // crbug.com/526462) | 3343 // crbug.com/526462) |
| 3314 std::list<ScrollNode*> current_scroll_chain; | 3344 std::list<ScrollNode*> current_scroll_chain; |
| 3315 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; | 3345 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; |
| 3316 ScrollNode* scroll_node = scroll_tree.CurrentlyScrollingNode(); | 3346 ScrollNode* scroll_node = scroll_tree.CurrentlyScrollingNode(); |
| 3317 ScrollNode* viewport_scroll_node = OuterViewportScrollNode(); | 3347 ScrollNode* viewport_scroll_node = |
| 3348 viewport()->MainScrollLayer() |
| 3349 ? scroll_tree.Node(viewport()->MainScrollLayer()->scroll_tree_index()) |
| 3350 : nullptr; |
| 3318 if (scroll_node) { | 3351 if (scroll_node) { |
| 3319 // TODO(bokan): The loop checks for a null parent but don't we still want to | 3352 // TODO(bokan): The loop checks for a null parent but don't we still want to |
| 3320 // distribute to the root scroll node? | 3353 // distribute to the root scroll node? |
| 3321 for (; scroll_tree.parent(scroll_node); | 3354 for (; scroll_tree.parent(scroll_node); |
| 3322 scroll_node = scroll_tree.parent(scroll_node)) { | 3355 scroll_node = scroll_tree.parent(scroll_node)) { |
| 3323 if (scroll_node == viewport_scroll_node) { | 3356 if (scroll_node == viewport_scroll_node) { |
| 3324 // Don't chain scrolls past the outer viewport scroll layer. Once we | 3357 // 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 | 3358 // reach that, we should scroll the viewport which is represented by the |
| 3326 // main viewport scroll layer. | 3359 // main viewport scroll layer. |
| 3327 DCHECK(viewport_scroll_node); | 3360 DCHECK(viewport_scroll_node); |
| 3328 current_scroll_chain.push_front(viewport_scroll_node); | 3361 current_scroll_chain.push_front(viewport_scroll_node); |
| 3329 break; | 3362 break; |
| 3330 } | 3363 } |
| 3331 | 3364 |
| 3332 if (!scroll_node->scrollable) | 3365 if (!scroll_node->scrollable) |
| 3333 continue; | 3366 continue; |
| 3334 | 3367 |
| 3335 current_scroll_chain.push_front(scroll_node); | 3368 if (CanConsumeDelta(scroll_node, *scroll_state)) |
| 3369 current_scroll_chain.push_front(scroll_node); |
| 3336 } | 3370 } |
| 3337 } | 3371 } |
| 3372 active_tree_->SetCurrentlyScrollingNode( |
| 3373 current_scroll_chain.empty() ? nullptr : current_scroll_chain.back()); |
| 3338 scroll_state->set_scroll_chain_and_layer_tree(current_scroll_chain, | 3374 scroll_state->set_scroll_chain_and_layer_tree(current_scroll_chain, |
| 3339 active_tree()); | 3375 active_tree()); |
| 3340 scroll_state->DistributeToScrollChainDescendant(); | 3376 scroll_state->DistributeToScrollChainDescendant(); |
| 3341 } | 3377 } |
| 3342 | 3378 |
| 3379 bool LayerTreeHostImpl::CanConsumeDelta(ScrollNode* scroll_node, |
| 3380 const ScrollState& scroll_state) { |
| 3381 gfx::Vector2dF delta_to_scroll; |
| 3382 if (scroll_state.is_beginning()) { |
| 3383 if (scroll_state.ignore_delta_hints()) |
| 3384 return true; |
| 3385 |
| 3386 delta_to_scroll = gfx::Vector2dF(scroll_state.delta_x_hint(), |
| 3387 scroll_state.delta_y_hint()); |
| 3388 } else { |
| 3389 delta_to_scroll = |
| 3390 gfx::Vector2dF(scroll_state.delta_x(), scroll_state.delta_y()); |
| 3391 } |
| 3392 |
| 3393 if (delta_to_scroll == gfx::Vector2dF()) |
| 3394 return true; |
| 3395 |
| 3396 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; |
| 3397 if (scroll_state.is_direct_manipulation()) { |
| 3398 gfx::Vector2dF local_scroll_delta; |
| 3399 if (!CalculateLocalScrollDeltaAndStartPoint( |
| 3400 *scroll_node, |
| 3401 gfx::PointF(scroll_state.position_x(), scroll_state.position_y()), |
| 3402 delta_to_scroll, scroll_tree, &local_scroll_delta)) { |
| 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 return false; |
| 3412 } |
| 3413 |
| 3343 InputHandlerScrollResult LayerTreeHostImpl::ScrollBy( | 3414 InputHandlerScrollResult LayerTreeHostImpl::ScrollBy( |
| 3344 ScrollState* scroll_state) { | 3415 ScrollState* scroll_state) { |
| 3345 DCHECK(scroll_state); | 3416 DCHECK(scroll_state); |
| 3346 | 3417 |
| 3347 TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBy"); | 3418 TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBy"); |
| 3348 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; | 3419 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; |
| 3349 ScrollNode* scroll_node = scroll_tree.CurrentlyScrollingNode(); | 3420 ScrollNode* scroll_node = scroll_tree.CurrentlyScrollingNode(); |
| 3350 | 3421 |
| 3351 if (!scroll_node) | 3422 if (!scroll_node) |
| 3352 return InputHandlerScrollResult(); | 3423 return InputHandlerScrollResult(); |
| (...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4314 | 4385 |
| 4315 void LayerTreeHostImpl::ShowScrollbarsForImplScroll(ElementId element_id) { | 4386 void LayerTreeHostImpl::ShowScrollbarsForImplScroll(ElementId element_id) { |
| 4316 if (!element_id) | 4387 if (!element_id) |
| 4317 return; | 4388 return; |
| 4318 if (ScrollbarAnimationController* animation_controller = | 4389 if (ScrollbarAnimationController* animation_controller = |
| 4319 ScrollbarAnimationControllerForElementId(element_id)) | 4390 ScrollbarAnimationControllerForElementId(element_id)) |
| 4320 animation_controller->DidScrollUpdate(); | 4391 animation_controller->DidScrollUpdate(); |
| 4321 } | 4392 } |
| 4322 | 4393 |
| 4323 } // namespace cc | 4394 } // namespace cc |
| OLD | NEW |