| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 gfx::Point scroll_point = | 682 gfx::Point scroll_point = |
| 683 gfx::ToCeiledPoint(expected_scroll_layer_impl->position() - | 683 gfx::ToCeiledPoint(expected_scroll_layer_impl->position() - |
| 684 gfx::Vector2dF(0.5f, 0.5f)); | 684 gfx::Vector2dF(0.5f, 0.5f)); |
| 685 InputHandler::ScrollStatus status = impl->ScrollBegin( | 685 InputHandler::ScrollStatus status = impl->ScrollBegin( |
| 686 BeginState(scroll_point).get(), InputHandler::TOUCHSCREEN); | 686 BeginState(scroll_point).get(), InputHandler::TOUCHSCREEN); |
| 687 EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD, status.thread); | 687 EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD, status.thread); |
| 688 impl->ScrollBy(UpdateState(gfx::Point(), scroll_amount_).get()); | 688 impl->ScrollBy(UpdateState(gfx::Point(), scroll_amount_).get()); |
| 689 LayerImpl* scrolling_layer = impl->CurrentlyScrollingLayer(); | 689 LayerImpl* scrolling_layer = impl->CurrentlyScrollingLayer(); |
| 690 CHECK(scrolling_layer); | 690 CHECK(scrolling_layer); |
| 691 impl->ScrollEnd(EndState().get()); | 691 impl->ScrollEnd(EndState().get()); |
| 692 impl->ClearCurrentlyScrollingLayerForTesting(); |
| 692 CHECK(!impl->CurrentlyScrollingLayer()); | 693 CHECK(!impl->CurrentlyScrollingLayer()); |
| 693 EXPECT_EQ(scrolling_layer->id(), | 694 EXPECT_EQ(scrolling_layer->id(), |
| 694 impl->active_tree()->LastScrolledLayerId()); | 695 impl->active_tree()->LastScrolledLayerId()); |
| 695 | 696 |
| 696 // Check the scroll is applied as a delta. | 697 // Check the scroll is applied as a delta. |
| 697 EXPECT_VECTOR_EQ(initial_offset_, | 698 EXPECT_VECTOR_EQ(initial_offset_, |
| 698 ScrollTreeForLayer(expected_scroll_layer_impl) | 699 ScrollTreeForLayer(expected_scroll_layer_impl) |
| 699 ->GetScrollOffsetBaseForTesting( | 700 ->GetScrollOffsetBaseForTesting( |
| 700 expected_scroll_layer_impl->id())); | 701 expected_scroll_layer_impl->id())); |
| 701 EXPECT_VECTOR_EQ(scroll_amount_, | 702 EXPECT_VECTOR_EQ(scroll_amount_, |
| (...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1791 int num_impl_commits_; | 1792 int num_impl_commits_; |
| 1792 int num_aborted_commits_; | 1793 int num_aborted_commits_; |
| 1793 int num_impl_scrolls_; | 1794 int num_impl_scrolls_; |
| 1794 int num_draws_; | 1795 int num_draws_; |
| 1795 }; | 1796 }; |
| 1796 | 1797 |
| 1797 MULTI_THREAD_TEST_F(LayerTreeHostScrollTestScrollAbortedCommitMFBA); | 1798 MULTI_THREAD_TEST_F(LayerTreeHostScrollTestScrollAbortedCommitMFBA); |
| 1798 | 1799 |
| 1799 } // namespace | 1800 } // namespace |
| 1800 } // namespace cc | 1801 } // namespace cc |
| OLD | NEW |