diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-09-18 14:34:04 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-10-04 11:15:27 +0000 |
commit | e6430e577f105ad8813c92e75c54660c4985026e (patch) | |
tree | 88115e5d1fb471fea807111924dcccbeadbf9e4f /chromium/cc/input | |
parent | 53d399fe6415a96ea6986ec0d402a9c07da72453 (diff) | |
download | qtwebengine-chromium-e6430e577f105ad8813c92e75c54660c4985026e.tar.gz |
BASELINE: Update Chromium to 61.0.3163.99
Change-Id: I8452f34574d88ca2b27af9bd56fc9ff3f16b1367
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/cc/input')
-rw-r--r-- | chromium/cc/input/browser_controls_offset_manager.cc | 2 | ||||
-rw-r--r-- | chromium/cc/input/browser_controls_offset_manager_unittest.cc | 59 | ||||
-rw-r--r-- | chromium/cc/input/input_handler.h | 24 | ||||
-rw-r--r-- | chromium/cc/input/scroll_boundary_behavior.h | 46 | ||||
-rw-r--r-- | chromium/cc/input/scroll_elasticity_helper.cc | 9 | ||||
-rw-r--r-- | chromium/cc/input/scroll_state.h | 4 | ||||
-rw-r--r-- | chromium/cc/input/scroll_state_data.cc | 2 | ||||
-rw-r--r-- | chromium/cc/input/scroll_state_data.h | 5 | ||||
-rw-r--r-- | chromium/cc/input/scrollbar_animation_controller_unittest.cc | 59 | ||||
-rw-r--r-- | chromium/cc/input/single_scrollbar_animation_controller_thinning_unittest.cc | 2 | ||||
-rw-r--r-- | chromium/cc/input/touch_action.h | 138 |
11 files changed, 310 insertions, 40 deletions
diff --git a/chromium/cc/input/browser_controls_offset_manager.cc b/chromium/cc/input/browser_controls_offset_manager.cc index ad61f21902d..6f31b42439b 100644 --- a/chromium/cc/input/browser_controls_offset_manager.cc +++ b/chromium/cc/input/browser_controls_offset_manager.cc @@ -223,7 +223,7 @@ void BrowserControlsOffsetManager::SetupAnimation( if (has_animation() && animation_direction_ == direction) return; - if (!TopControlsHeight()) { + if (!TopControlsHeight() && !BottomControlsHeight()) { client_->SetCurrentBrowserControlsShownRatio( direction == HIDING_CONTROLS ? 0.f : 1.f); return; diff --git a/chromium/cc/input/browser_controls_offset_manager_unittest.cc b/chromium/cc/input/browser_controls_offset_manager_unittest.cc index b053b0b17e5..c141b83151f 100644 --- a/chromium/cc/input/browser_controls_offset_manager_unittest.cc +++ b/chromium/cc/input/browser_controls_offset_manager_unittest.cc @@ -180,6 +180,38 @@ TEST(BrowserControlsOffsetManagerTest, PartialShownHideAnimation) { EXPECT_FLOAT_EQ(0.f, manager->ContentTopOffset()); } +TEST(BrowserControlsOffsetManagerTest, + BottomControlsPartialShownHideAnimation) { + MockBrowserControlsOffsetManagerClient client(0.f, 0.5f, 0.5f); + client.SetBottomControlsHeight(100.f); + BrowserControlsOffsetManager* manager = client.manager(); + manager->ScrollBegin(); + manager->ScrollBy(gfx::Vector2dF(0.f, 300.f)); + EXPECT_FLOAT_EQ(0.f, manager->BottomControlsShownRatio()); + EXPECT_FLOAT_EQ(0.f, manager->ContentTopOffset()); + manager->ScrollEnd(); + + manager->ScrollBegin(); + manager->ScrollBy(gfx::Vector2dF(0.f, -20.f)); + EXPECT_FLOAT_EQ(0.2f, manager->BottomControlsShownRatio()); + EXPECT_FLOAT_EQ(0.f, manager->ContentTopOffset()); + manager->ScrollEnd(); + + EXPECT_TRUE(manager->has_animation()); + + base::TimeTicks time = base::TimeTicks::Now(); + float previous; + while (manager->has_animation()) { + previous = manager->BottomControlsShownRatio(); + time = base::TimeDelta::FromMicroseconds(100) + time; + manager->Animate(time); + EXPECT_LT(manager->BottomControlsShownRatio(), previous); + } + EXPECT_FALSE(manager->has_animation()); + EXPECT_FLOAT_EQ(0.f, manager->BottomControlsShownRatio()); + EXPECT_FLOAT_EQ(0.f, manager->ContentTopOffset()); +} + TEST(BrowserControlsOffsetManagerTest, PartialShownShowAnimation) { MockBrowserControlsOffsetManagerClient client(100.f, 0.5f, 0.5f); BrowserControlsOffsetManager* manager = client.manager(); @@ -211,6 +243,33 @@ TEST(BrowserControlsOffsetManagerTest, PartialShownShowAnimation) { } TEST(BrowserControlsOffsetManagerTest, + BottomControlsPartialShownShowAnimation) { + MockBrowserControlsOffsetManagerClient client(0.f, 0.5f, 0.5f); + client.SetBottomControlsHeight(100.f); + BrowserControlsOffsetManager* manager = client.manager(); + + manager->ScrollBegin(); + manager->ScrollBy(gfx::Vector2dF(0.f, 20.f)); + EXPECT_FLOAT_EQ(0.8f, manager->BottomControlsShownRatio()); + EXPECT_FLOAT_EQ(0.f, manager->ContentTopOffset()); + manager->ScrollEnd(); + + EXPECT_TRUE(manager->has_animation()); + + base::TimeTicks time = base::TimeTicks::Now(); + float previous; + while (manager->has_animation()) { + previous = manager->BottomControlsShownRatio(); + time = base::TimeDelta::FromMicroseconds(100) + time; + manager->Animate(time); + EXPECT_GT(manager->BottomControlsShownRatio(), previous); + } + EXPECT_FALSE(manager->has_animation()); + EXPECT_FLOAT_EQ(1.f, manager->BottomControlsShownRatio()); + EXPECT_FLOAT_EQ(0.f, manager->ContentTopOffset()); +} + +TEST(BrowserControlsOffsetManagerTest, PartialHiddenWithAmbiguousThresholdShows) { MockBrowserControlsOffsetManagerClient client(100.f, 0.25f, 0.25f); BrowserControlsOffsetManager* manager = client.manager(); diff --git a/chromium/cc/input/input_handler.h b/chromium/cc/input/input_handler.h index 6ffdcce5737..899aca2c00f 100644 --- a/chromium/cc/input/input_handler.h +++ b/chromium/cc/input/input_handler.h @@ -14,6 +14,7 @@ #include "cc/input/main_thread_scrolling_reason.h" #include "cc/input/scroll_state.h" #include "cc/input/scrollbar.h" +#include "cc/input/touch_action.h" #include "cc/trees/swap_promise_monitor.h" namespace gfx { @@ -104,7 +105,7 @@ class CC_EXPORT InputHandler { NON_BUBBLING_GESTURE }; - enum class TouchStartEventListenerType { + enum class TouchStartOrMoveEventListenerType { NO_HANDLER, HANDLER, HANDLER_ON_SCROLLING_LAYER @@ -131,8 +132,7 @@ class CC_EXPORT InputHandler { // Returns SCROLL_ON_IMPL_THREAD if a layer is actively being scrolled or // a subsequent call to ScrollAnimated can begin on the impl thread. - virtual ScrollStatus ScrollAnimatedBegin( - const gfx::Point& viewport_point) = 0; + virtual ScrollStatus ScrollAnimatedBegin(ScrollState* scroll_state) = 0; // Returns SCROLL_ON_IMPL_THREAD if an animation is initiated on the impl // thread. delayed_by is the delay that is taken into account when determining @@ -194,12 +194,18 @@ class CC_EXPORT InputHandler { virtual EventListenerProperties GetEventListenerProperties( EventListenerClass event_class) const = 0; - // It returns the type of a touch start event listener at |viewport_point|. - // Whether the page should be given the opportunity to suppress scrolling by - // consuming touch events that started at |viewport_point|, and whether - // |viewport_point| is on the currently scrolling layer. - virtual TouchStartEventListenerType EventListenerTypeForTouchStartAt( - const gfx::Point& viewport_point) = 0; + // It returns the type of a touch start or move event listener at + // |viewport_point|. Whether the page should be given the opportunity to + // suppress scrolling by consuming touch events that started at + // |viewport_point|, and whether |viewport_point| is on the currently + // scrolling layer. + // |out_touch_action| is assigned the whitelisted touch action for the + // |viewport_point|. In the case there are no touch handlers or touch action + // regions, |out_touch_action| is assigned kTouchActionAuto since the default + // touch action is auto. + virtual TouchStartOrMoveEventListenerType + EventListenerTypeForTouchStartOrMoveAt(const gfx::Point& viewport_point, + TouchAction* out_touch_action) = 0; // Calling CreateLatencyInfoSwapPromiseMonitor() to get a scoped // LatencyInfoSwapPromiseMonitor. During the life time of the diff --git a/chromium/cc/input/scroll_boundary_behavior.h b/chromium/cc/input/scroll_boundary_behavior.h new file mode 100644 index 00000000000..f3ffa8f1f33 --- /dev/null +++ b/chromium/cc/input/scroll_boundary_behavior.h @@ -0,0 +1,46 @@ +// Copyright (c) 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CC_INPUT_SCROLL_BOUNDARY_BEHAVIOR_H_ +#define CC_INPUT_SCROLL_BOUNDARY_BEHAVIOR_H_ + +#include "cc/cc_export.h" + +namespace cc { + +struct CC_EXPORT ScrollBoundaryBehavior { + enum ScrollBoundaryBehaviorType { + // Allows the default behavior for the user agent. + kScrollBoundaryBehaviorTypeAuto, + // Hint to disable scroll chaining. The user agent may show an appropriate + // overscroll affordance. + kScrollBoundaryBehaviorTypeContain, + // Same as contain but also hint that no overscroll affordance should be + // triggered. + kScrollBoundaryBehaviorTypeNone + }; + + ScrollBoundaryBehavior() + : x(kScrollBoundaryBehaviorTypeAuto), + y(kScrollBoundaryBehaviorTypeAuto) {} + explicit ScrollBoundaryBehavior(ScrollBoundaryBehaviorType type) + : x(type), y(type) {} + ScrollBoundaryBehavior(ScrollBoundaryBehaviorType x_type, + ScrollBoundaryBehaviorType y_type) + : x(x_type), y(y_type) {} + + ScrollBoundaryBehaviorType x; + ScrollBoundaryBehaviorType y; + + bool operator==(const ScrollBoundaryBehavior& a) const { + return (a.x == x) && (a.y == y); + } + bool operator!=(const ScrollBoundaryBehavior& a) const { + return !(*this == a); + } +}; + +} // namespace cc + +#endif // CC_INPUT_SCROLL_BOUNDARY_BEHAVIOR_H_ diff --git a/chromium/cc/input/scroll_elasticity_helper.cc b/chromium/cc/input/scroll_elasticity_helper.cc index 413d64f6bf9..8670b8301c5 100644 --- a/chromium/cc/input/scroll_elasticity_helper.cc +++ b/chromium/cc/input/scroll_elasticity_helper.cc @@ -7,6 +7,7 @@ #include "cc/layers/layer_impl.h" #include "cc/trees/layer_tree_host_impl.h" #include "cc/trees/layer_tree_impl.h" +#include "cc/trees/scroll_node.h" namespace cc { @@ -36,11 +37,11 @@ ScrollElasticityHelperImpl::~ScrollElasticityHelperImpl() { } bool ScrollElasticityHelperImpl::IsUserScrollable() const { - LayerImpl* layer = layer_tree_host_impl_->OuterViewportScrollLayer(); - if (!layer) + const auto* scroll_node = layer_tree_host_impl_->OuterViewportScrollNode(); + if (!scroll_node) return false; - return layer->user_scrollable_horizontal() || - layer->user_scrollable_vertical(); + return scroll_node->user_scrollable_horizontal || + scroll_node->user_scrollable_vertical; } gfx::Vector2dF ScrollElasticityHelperImpl::StretchAmount() const { diff --git a/chromium/cc/input/scroll_state.h b/chromium/cc/input/scroll_state.h index 74823e4ba85..eb0c7fa95be 100644 --- a/chromium/cc/input/scroll_state.h +++ b/chromium/cc/input/scroll_state.h @@ -34,6 +34,10 @@ class CC_EXPORT ScrollState { double delta_x() const { return data_.delta_x; } // Positive when scrolling down. double delta_y() const { return data_.delta_y; } + // Positive when scrolling right. + double delta_x_hint() const { return data_.delta_x_hint; } + // Positive when scrolling down. + double delta_y_hint() const { return data_.delta_y_hint; } // The location associated with this scroll update. For touch, this is the // position of the finger. For mouse, the location of the cursor. int position_x() const { return data_.position_x; } diff --git a/chromium/cc/input/scroll_state_data.cc b/chromium/cc/input/scroll_state_data.cc index 567a02446be..ff2c628f04c 100644 --- a/chromium/cc/input/scroll_state_data.cc +++ b/chromium/cc/input/scroll_state_data.cc @@ -10,6 +10,8 @@ namespace cc { ScrollStateData::ScrollStateData() : delta_x(0), delta_y(0), + delta_x_hint(0), + delta_y_hint(0), position_x(0), position_y(0), velocity_x(0), diff --git a/chromium/cc/input/scroll_state_data.h b/chromium/cc/input/scroll_state_data.h index f3559a89d07..ba33e46626b 100644 --- a/chromium/cc/input/scroll_state_data.h +++ b/chromium/cc/input/scroll_state_data.h @@ -22,6 +22,11 @@ class CC_EXPORT ScrollStateData { // Scroll delta in viewport coordinates (DIP). double delta_x; double delta_y; + // Scroll delta hint in viewport coordinates (DIP). + // Delta hints are equal to deltas of the first gesture scroll update event in + // a scroll sequence and are used for hittesting. + double delta_x_hint; + double delta_y_hint; // Pointer (i.e. cursor/touch point) position in viewport coordinates (DIP). int position_x; int position_y; diff --git a/chromium/cc/input/scrollbar_animation_controller_unittest.cc b/chromium/cc/input/scrollbar_animation_controller_unittest.cc index e7e4926c3e5..19fea257924 100644 --- a/chromium/cc/input/scrollbar_animation_controller_unittest.cc +++ b/chromium/cc/input/scrollbar_animation_controller_unittest.cc @@ -82,7 +82,6 @@ class ScrollbarAnimationControllerAuraOverlayTest : public testing::Test { clip_layer_ = clip.get(); scroll_layer->SetElementId( LayerIdToElementIdForTesting(scroll_layer->id())); - scroll_layer->SetScrollClipLayer(clip_layer_->id()); LayerImpl* scroll_layer_ptr = scroll_layer.get(); const int kTrackStart = 0; @@ -119,8 +118,10 @@ class ScrollbarAnimationControllerAuraOverlayTest : public testing::Test { h_scrollbar_layer_->test_properties()->opacity_can_animate = true; clip_layer_->SetBounds(gfx::Size(100, 100)); + scroll_layer_ptr->SetScrollable(gfx::Size(100, 100)); scroll_layer_ptr->SetBounds(gfx::Size(200, 200)); host_impl_.active_tree()->BuildLayerListAndPropertyTreesForTesting(); + host_impl_.active_tree()->UpdateScrollbarGeometries(); scrollbar_controller_ = ScrollbarAnimationController:: CreateScrollbarAnimationControllerAuraOverlay( @@ -184,11 +185,16 @@ TEST_F(ScrollbarAnimationControllerAuraOverlayTest, AppearOnResize) { // Make the Layer non-scrollable, scrollbar disappears. clip_layer_->SetBounds(gfx::Size(200, 200)); + LayerImpl* scroll_layer = host_impl_.active_tree()->LayerById(1); + scroll_layer->SetScrollable(gfx::Size(200, 200)); + host_impl_.active_tree()->BuildLayerListAndPropertyTreesForTesting(); scrollbar_controller_->DidScrollUpdate(); ExpectScrollbarsOpacity(0); // Make the layer scrollable, scrollbar appears again. clip_layer_->SetBounds(gfx::Size(100, 100)); + scroll_layer->SetScrollable(gfx::Size(100, 100)); + host_impl_.active_tree()->BuildLayerListAndPropertyTreesForTesting(); scrollbar_controller_->DidScrollUpdate(); ExpectScrollbarsOpacity(1); } @@ -205,6 +211,8 @@ TEST_F(ScrollbarAnimationControllerAuraOverlayTest, HideOnResize) { // Shrink along X axis, horizontal scrollbar should appear. clip_layer_->SetBounds(gfx::Size(100, 200)); EXPECT_EQ(gfx::Size(100, 200), clip_layer_->bounds()); + scroll_layer->SetScrollable(gfx::Size(100, 200)); + host_impl_.active_tree()->BuildLayerListAndPropertyTreesForTesting(); scrollbar_controller_->DidScrollBegin(); @@ -217,6 +225,8 @@ TEST_F(ScrollbarAnimationControllerAuraOverlayTest, HideOnResize) { // should disappear. clip_layer_->SetBounds(gfx::Size(200, 100)); EXPECT_EQ(gfx::Size(200, 100), clip_layer_->bounds()); + scroll_layer->SetScrollable(gfx::Size(200, 100)); + host_impl_.active_tree()->BuildLayerListAndPropertyTreesForTesting(); scrollbar_controller_->DidScrollBegin(); @@ -1348,22 +1358,22 @@ class ScrollbarAnimationControllerAndroidTest scrollbar->test_properties()->opacity = 0.0f; scrollbar_layer_ = scrollbar.get(); scrollbar_layer_->test_properties()->opacity_can_animate = true; - std::unique_ptr<LayerImpl> clip = + std::unique_ptr<LayerImpl> root = LayerImpl::Create(host_impl_.active_tree(), 3); - clip_layer_ = clip.get(); + + scroll_layer->SetScrollable(gfx::Size(100, 100)); scroll_layer->SetElementId( LayerIdToElementIdForTesting(scroll_layer->id())); - - scroll_layer->SetScrollClipLayer(clip_layer_->id()); LayerImpl* scroll_layer_ptr = scroll_layer.get(); scroll_layer->test_properties()->AddChild(std::move(scrollbar)); - clip->test_properties()->AddChild(std::move(scroll_layer)); - host_impl_.active_tree()->SetRootLayerForTesting(std::move(clip)); + root->test_properties()->AddChild(std::move(scroll_layer)); + host_impl_.active_tree()->SetRootLayerForTesting(std::move(root)); scrollbar_layer_->SetScrollElementId(scroll_layer_ptr->element_id()); - clip_layer_->SetBounds(gfx::Size(100, 100)); scroll_layer_ptr->SetBounds(gfx::Size(200, 200)); host_impl_.active_tree()->BuildLayerListAndPropertyTreesForTesting(); + DCHECK(host_impl_.active_tree()->ScrollbarGeometriesNeedUpdate()); + host_impl_.active_tree()->UpdateScrollbarGeometries(); scrollbar_controller_ = ScrollbarAnimationController::CreateScrollbarAnimationControllerAndroid( @@ -1378,7 +1388,6 @@ class ScrollbarAnimationControllerAndroidTest TestTaskGraphRunner task_graph_runner_; FakeLayerTreeHostImpl host_impl_; std::unique_ptr<ScrollbarAnimationController> scrollbar_controller_; - LayerImpl* clip_layer_; SolidColorScrollbarLayerImpl* scrollbar_layer_; base::Closure start_fade_; @@ -1444,20 +1453,18 @@ TEST_F(ScrollbarAnimationControllerAndroidTest, HideOnResize) { EXPECT_EQ(HORIZONTAL, scrollbar_layer_->orientation()); // Shrink along X axis, horizontal scrollbar should appear. - clip_layer_->SetBounds(gfx::Size(100, 200)); - EXPECT_EQ(gfx::Size(100, 200), clip_layer_->bounds()); - + scroll_layer->SetScrollable(gfx::Size(100, 200)); + host_impl_.active_tree()->BuildLayerListAndPropertyTreesForTesting(); scrollbar_controller_->DidScrollBegin(); scrollbar_controller_->DidScrollUpdate(); EXPECT_FLOAT_EQ(1.0f, scrollbar_layer_->Opacity()); - scrollbar_controller_->DidScrollEnd(); // Shrink along Y axis and expand along X, horizontal scrollbar // should disappear. - clip_layer_->SetBounds(gfx::Size(200, 100)); - EXPECT_EQ(gfx::Size(200, 100), clip_layer_->bounds()); + scroll_layer->SetScrollable(gfx::Size(200, 100)); + host_impl_.active_tree()->BuildLayerListAndPropertyTreesForTesting(); scrollbar_controller_->DidScrollBegin(); @@ -1475,19 +1482,17 @@ TEST_F(VerticalScrollbarAnimationControllerAndroidTest, HideOnResize) { EXPECT_EQ(VERTICAL, scrollbar_layer_->orientation()); // Shrink along X axis, vertical scrollbar should remain invisible. - clip_layer_->SetBounds(gfx::Size(100, 200)); - EXPECT_EQ(gfx::Size(100, 200), clip_layer_->bounds()); - + scroll_layer->SetScrollable(gfx::Size(100, 200)); + host_impl_.active_tree()->BuildLayerListAndPropertyTreesForTesting(); scrollbar_controller_->DidScrollBegin(); scrollbar_controller_->DidScrollUpdate(); EXPECT_FLOAT_EQ(0.0f, scrollbar_layer_->Opacity()); - scrollbar_controller_->DidScrollEnd(); // Shrink along Y axis and expand along X, vertical scrollbar should appear. - clip_layer_->SetBounds(gfx::Size(200, 100)); - EXPECT_EQ(gfx::Size(200, 100), clip_layer_->bounds()); + scroll_layer->SetScrollable(gfx::Size(200, 100)); + host_impl_.active_tree()->BuildLayerListAndPropertyTreesForTesting(); scrollbar_controller_->DidScrollBegin(); @@ -1502,7 +1507,8 @@ TEST_F(ScrollbarAnimationControllerAndroidTest, HideOnUserNonScrollableHorz) { LayerImpl* scroll_layer = host_impl_.active_tree()->LayerById(1); ASSERT_TRUE(scroll_layer); - scroll_layer->set_user_scrollable_horizontal(false); + scroll_layer->test_properties()->user_scrollable_horizontal = false; + host_impl_.active_tree()->BuildLayerListAndPropertyTreesForTesting(); scrollbar_controller_->DidScrollBegin(); @@ -1517,7 +1523,8 @@ TEST_F(ScrollbarAnimationControllerAndroidTest, ShowOnUserNonScrollableVert) { LayerImpl* scroll_layer = host_impl_.active_tree()->LayerById(1); ASSERT_TRUE(scroll_layer); - scroll_layer->set_user_scrollable_vertical(false); + scroll_layer->test_properties()->user_scrollable_vertical = false; + host_impl_.active_tree()->BuildLayerListAndPropertyTreesForTesting(); scrollbar_controller_->DidScrollBegin(); @@ -1533,7 +1540,8 @@ TEST_F(VerticalScrollbarAnimationControllerAndroidTest, LayerImpl* scroll_layer = host_impl_.active_tree()->LayerById(1); ASSERT_TRUE(scroll_layer); - scroll_layer->set_user_scrollable_vertical(false); + scroll_layer->test_properties()->user_scrollable_vertical = false; + host_impl_.active_tree()->BuildLayerListAndPropertyTreesForTesting(); scrollbar_controller_->DidScrollBegin(); @@ -1549,7 +1557,8 @@ TEST_F(VerticalScrollbarAnimationControllerAndroidTest, LayerImpl* scroll_layer = host_impl_.active_tree()->LayerById(1); ASSERT_TRUE(scroll_layer); - scroll_layer->set_user_scrollable_horizontal(false); + scroll_layer->test_properties()->user_scrollable_horizontal = false; + host_impl_.active_tree()->BuildLayerListAndPropertyTreesForTesting(); scrollbar_controller_->DidScrollBegin(); diff --git a/chromium/cc/input/single_scrollbar_animation_controller_thinning_unittest.cc b/chromium/cc/input/single_scrollbar_animation_controller_thinning_unittest.cc index 0faa8d3265b..970afe66b5e 100644 --- a/chromium/cc/input/single_scrollbar_animation_controller_thinning_unittest.cc +++ b/chromium/cc/input/single_scrollbar_animation_controller_thinning_unittest.cc @@ -70,7 +70,6 @@ class SingleScrollbarAnimationControllerThinningTest : public testing::Test { scroll_layer->SetElementId( LayerIdToElementIdForTesting(scroll_layer->id())); clip_layer_ = clip.get(); - scroll_layer->SetScrollClipLayer(clip_layer_->id()); LayerImpl* scroll_layer_ptr = scroll_layer.get(); const int kId = 2; @@ -96,6 +95,7 @@ class SingleScrollbarAnimationControllerThinningTest : public testing::Test { scrollbar_layer_->test_properties()->opacity_can_animate = true; clip_layer_->SetBounds(gfx::Size(100, 100)); scroll_layer_ptr->SetBounds(gfx::Size(200, 200)); + host_impl_.active_tree()->UpdateScrollbarGeometries(); host_impl_.active_tree()->BuildLayerListAndPropertyTreesForTesting(); scrollbar_controller_ = SingleScrollbarAnimationControllerThinning::Create( diff --git a/chromium/cc/input/touch_action.h b/chromium/cc/input/touch_action.h index 8b11c4c9d7e..83e1b16fdc8 100644 --- a/chromium/cc/input/touch_action.h +++ b/chromium/cc/input/touch_action.h @@ -6,6 +6,9 @@ #define CC_INPUT_TOUCH_ACTION_H_ #include <cstdlib> +#include <string> + +#include "base/logging.h" namespace cc { @@ -51,6 +54,141 @@ inline TouchAction& operator&=(TouchAction& a, TouchAction b) { return a = a & b; } +inline const char* TouchActionToString(TouchAction touch_action) { + switch (static_cast<int>(touch_action)) { + case 0: + return "NONE"; + case 1: + return "PAN_LEFT"; + case 2: + return "PAN_RIGHT"; + case 3: + return "PAN_X"; + case 4: + return "PAN_UP"; + case 5: + return "PAN_LEFT_PAN_UP"; + case 6: + return "PAN_RIGHT_PAN_UP"; + case 7: + return "PAN_X_PAN_UP"; + case 8: + return "PAN_DOWN"; + case 9: + return "PAN_LEFT_PAN_DOWN"; + case 10: + return "PAN_RIGHT_PAN_DOWN"; + case 11: + return "PAN_X_PAN_DOWN"; + case 12: + return "PAN_Y"; + case 13: + return "PAN_LEFT_PAN_Y"; + case 14: + return "PAN_RIGHT_PAN_Y"; + case 15: + return "PAN_X_PAN_Y"; + case 16: + return "PINCH_ZOOM"; + case 17: + return "PAN_LEFT_PINCH_ZOOM"; + case 18: + return "PAN_RIGHT_PINCH_ZOOM"; + case 19: + return "PAN_X_PINCH_ZOOM"; + case 20: + return "PAN_UP_PINCH_ZOOM"; + case 21: + return "PAN_LEFT_PAN_UP_PINCH_ZOOM"; + case 22: + return "PAN_RIGHT_PAN_UP_PINCH_ZOOM"; + case 23: + return "PAN_X_PAN_UP_PINCH_ZOOM"; + case 24: + return "PAN_DOWN_PINCH_ZOOM"; + case 25: + return "PAN_LEFT_PAN_DOWN_PINCH_ZOOM"; + case 26: + return "PAN_RIGHT_PAN_DOWN_PINCH_ZOOM"; + case 27: + return "PAN_X_PAN_DOWN_PINCH_ZOOM"; + case 28: + return "PAN_Y_PINCH_ZOOM"; + case 29: + return "PAN_LEFT_PAN_Y_PINCH_ZOOM"; + case 30: + return "PAN_RIGHT_PAN_Y_PINCH_ZOOM"; + case 31: + return "MANIPULATION"; + case 32: + return "DOUBLE_TAP_ZOOM"; + case 33: + return "PAN_LEFT_DOUBLE_TAP_ZOOM"; + case 34: + return "PAN_RIGHT_DOUBLE_TAP_ZOOM"; + case 35: + return "PAN_X_DOUBLE_TAP_ZOOM"; + case 36: + return "PAN_UP_DOUBLE_TAP_ZOOM"; + case 37: + return "PAN_LEFT_PAN_UP_DOUBLE_TAP_ZOOM"; + case 38: + return "PAN_RIGHT_PAN_UP_DOUBLE_TAP_ZOOM"; + case 39: + return "PAN_X_PAN_UP_DOUBLE_TAP_ZOOM"; + case 40: + return "PAN_DOWN_DOUBLE_TAP_ZOOM"; + case 41: + return "PAN_LEFT_PAN_DOWN_DOUBLE_TAP_ZOOM"; + case 42: + return "PAN_RIGHT_PAN_DOWN_DOUBLE_TAP_ZOOM"; + case 43: + return "PAN_X_PAN_DOWN_DOUBLE_TAP_ZOOM"; + case 44: + return "PAN_Y_DOUBLE_TAP_ZOOM"; + case 45: + return "PAN_LEFT_PAN_Y_DOUBLE_TAP_ZOOM"; + case 46: + return "PAN_RIGHT_PAN_Y_DOUBLE_TAP_ZOOM"; + case 47: + return "PAN_X_PAN_Y_DOUBLE_TAP_ZOOM"; + case 48: + return "PINCH_ZOOM_DOUBLE_TAP_ZOOM"; + case 49: + return "PAN_LEFT_PINCH_ZOOM_DOUBLE_TAP_ZOOM"; + case 50: + return "PAN_RIGHT_PINCH_ZOOM_DOUBLE_TAP_ZOOM"; + case 51: + return "PAN_X_PINCH_ZOOM_DOUBLE_TAP_ZOOM"; + case 52: + return "PAN_UP_PINCH_ZOOM_DOUBLE_TAP_ZOOM"; + case 53: + return "PAN_LEFT_PAN_UP_PINCH_ZOOM_DOUBLE_TAP_ZOOM"; + case 54: + return "PAN_RIGHT_PAN_UP_PINCH_ZOOM_DOUBLE_TAP_ZOOM"; + case 55: + return "PAN_X_PAN_UP_PINCH_ZOOM_DOUBLE_TAP_ZOOM"; + case 56: + return "PAN_DOWN_PINCH_ZOOM_DOUBLE_TAP_ZOOM"; + case 57: + return "PAN_LEFT_PAN_DOWN_PINCH_ZOOM_DOUBLE_TAP_ZOOM"; + case 58: + return "PAN_RIGHT_PAN_DOWN_PINCH_ZOOM_DOUBLE_TAP_ZOOM"; + case 59: + return "PAN_X_PAN_DOWN_PINCH_ZOOM_DOUBLE_TAP_ZOOM"; + case 60: + return "PAN_Y_PINCH_ZOOM_DOUBLE_TAP_ZOOM"; + case 61: + return "PAN_LEFT_PAN_Y_PINCH_ZOOM_DOUBLE_TAP_ZOOM"; + case 62: + return "PAN_RIGHT_PAN_Y_PINCH_ZOOM_DOUBLE_TAP_ZOOM"; + case 63: + return "AUTO"; + } + NOTREACHED(); + return ""; +} + } // namespace cc #endif // CC_INPUT_TOUCH_ACTION_H_ |