Lines 407-414
Link Here
|
407 |
if (input_handler_client_) { |
407 |
if (input_handler_client_) { |
408 |
// This animates fling scrolls. But on Android WebView root flings are |
408 |
// This animates fling scrolls. But on Android WebView root flings are |
409 |
// controlled by the application, so the compositor does not animate them. |
409 |
// controlled by the application, so the compositor does not animate them. |
410 |
bool ignore_fling = |
410 |
bool ignore_fling = settings_.ignore_root_layer_flings && |
411 |
settings_.ignore_root_layer_flings && IsCurrentlyScrollingRoot(); |
411 |
IsCurrentlyScrollingInnerViewport(); |
412 |
if (!ignore_fling) |
412 |
if (!ignore_fling) |
413 |
input_handler_client_->Animate(monotonic_time); |
413 |
input_handler_client_->Animate(monotonic_time); |
414 |
} |
414 |
} |
Lines 476-487
Link Here
|
476 |
} |
476 |
} |
477 |
|
477 |
|
478 |
void LayerTreeHostImpl::SetNeedsAnimateInput() { |
478 |
void LayerTreeHostImpl::SetNeedsAnimateInput() { |
479 |
DCHECK_IMPLIES(IsCurrentlyScrollingRoot(), |
479 |
DCHECK_IMPLIES(IsCurrentlyScrollingInnerViewport(), |
480 |
!settings_.ignore_root_layer_flings); |
480 |
!settings_.ignore_root_layer_flings); |
481 |
SetNeedsAnimate(); |
481 |
SetNeedsAnimate(); |
482 |
} |
482 |
} |
483 |
|
483 |
|
484 |
bool LayerTreeHostImpl::IsCurrentlyScrollingRoot() const { |
484 |
bool LayerTreeHostImpl::IsCurrentlyScrollingInnerViewport() const { |
485 |
LayerImpl* scrolling_layer = CurrentlyScrollingLayer(); |
485 |
LayerImpl* scrolling_layer = CurrentlyScrollingLayer(); |
486 |
if (!scrolling_layer) |
486 |
if (!scrolling_layer) |
487 |
return false; |
487 |
return false; |
Lines 1885-1891
Link Here
|
1885 |
// On Android WebView root flings are controlled by the application, |
1885 |
// On Android WebView root flings are controlled by the application, |
1886 |
// so the compositor does not animate them and can't tell if they |
1886 |
// so the compositor does not animate them and can't tell if they |
1887 |
// are actually animating. So assume there are none. |
1887 |
// are actually animating. So assume there are none. |
1888 |
if (settings_.ignore_root_layer_flings && IsCurrentlyScrollingRoot()) |
1888 |
if (settings_.ignore_root_layer_flings && IsCurrentlyScrollingInnerViewport()) |
1889 |
return false; |
1889 |
return false; |
1890 |
return did_lock_scrolling_layer_; |
1890 |
return did_lock_scrolling_layer_; |
1891 |
} |
1891 |
} |
Lines 2414-2419
Link Here
|
2414 |
if (potentially_scrolling_layer_impl == OuterViewportScrollLayer()) |
2414 |
if (potentially_scrolling_layer_impl == OuterViewportScrollLayer()) |
2415 |
potentially_scrolling_layer_impl = InnerViewportScrollLayer(); |
2415 |
potentially_scrolling_layer_impl = InnerViewportScrollLayer(); |
2416 |
|
2416 |
|
|
|
2417 |
// Animated wheel scrolls need to scroll the outer viewport layer, and do not |
2418 |
// go through Viewport::ScrollBy which would normally handle the distribution. |
2419 |
// NOTE: This will need refactoring if we want smooth scrolling on Android. |
2420 |
if (type == ANIMATED_WHEEL && |
2421 |
potentially_scrolling_layer_impl == InnerViewportScrollLayer()) { |
2422 |
potentially_scrolling_layer_impl = OuterViewportScrollLayer(); |
2423 |
} |
2424 |
|
2417 |
return potentially_scrolling_layer_impl; |
2425 |
return potentially_scrolling_layer_impl; |
2418 |
} |
2426 |
} |
2419 |
|
2427 |
|
Lines 2437-2443
Link Here
|
2437 |
top_controls_manager_->ScrollBegin(); |
2445 |
top_controls_manager_->ScrollBegin(); |
2438 |
|
2446 |
|
2439 |
active_tree_->SetCurrentlyScrollingLayer(scrolling_layer_impl); |
2447 |
active_tree_->SetCurrentlyScrollingLayer(scrolling_layer_impl); |
2440 |
wheel_scrolling_ = (type == WHEEL); |
2448 |
wheel_scrolling_ = (type == WHEEL || type == ANIMATED_WHEEL); |
2441 |
client_->RenewTreePriority(); |
2449 |
client_->RenewTreePriority(); |
2442 |
UMA_HISTOGRAM_BOOLEAN("TryScroll.SlowScroll", false); |
2450 |
UMA_HISTOGRAM_BOOLEAN("TryScroll.SlowScroll", false); |
2443 |
return SCROLL_STARTED; |
2451 |
return SCROLL_STARTED; |
Lines 2495-2510
Link Here
|
2495 |
? SCROLL_STARTED |
2503 |
? SCROLL_STARTED |
2496 |
: SCROLL_IGNORED; |
2504 |
: SCROLL_IGNORED; |
2497 |
} |
2505 |
} |
2498 |
// ScrollAnimated is only used for wheel scrolls. We use the same bubbling |
2506 |
// ScrollAnimated is used for animated wheel scrolls. We find the first layer |
2499 |
// behavior as ScrollBy to determine which layer to animate, but we do not |
2507 |
// that can scroll and set up an animation of its scroll offset. Note that |
2500 |
// do the Android-specific things in ScrollBy like showing top controls. |
2508 |
// this does not currently go through the scroll customization and viewport |
2501 |
InputHandler::ScrollStatus scroll_status = ScrollBegin(viewport_point, WHEEL); |
2509 |
// machinery that ScrollBy uses for non-animated wheel scrolls. |
|
|
2510 |
InputHandler::ScrollStatus scroll_status = |
2511 |
ScrollBegin(viewport_point, ANIMATED_WHEEL); |
2502 |
if (scroll_status == SCROLL_STARTED) { |
2512 |
if (scroll_status == SCROLL_STARTED) { |
2503 |
gfx::Vector2dF pending_delta = scroll_delta; |
2513 |
gfx::Vector2dF pending_delta = scroll_delta; |
2504 |
for (LayerImpl* layer_impl = CurrentlyScrollingLayer(); layer_impl; |
2514 |
for (LayerImpl* layer_impl = CurrentlyScrollingLayer(); layer_impl; |
2505 |
layer_impl = NextLayerInScrollOrder(layer_impl)) { |
2515 |
layer_impl = NextLayerInScrollOrder(layer_impl)) { |
2506 |
// The inner viewport layer represents the viewport. |
2516 |
if (!layer_impl->scrollable()) |
2507 |
if (!layer_impl->scrollable() || layer_impl == OuterViewportScrollLayer()) |
|
|
2508 |
continue; |
2517 |
continue; |
2509 |
|
2518 |
|
2510 |
gfx::ScrollOffset current_offset = layer_impl->CurrentScrollOffset(); |
2519 |
gfx::ScrollOffset current_offset = layer_impl->CurrentScrollOffset(); |