| 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 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1838 FROM_HERE, | 1838 FROM_HERE, |
| 1839 base::Bind(&LayerTreeHostScrollTestElasticOverscroll::BindInputHandler, | 1839 base::Bind(&LayerTreeHostScrollTestElasticOverscroll::BindInputHandler, |
| 1840 base::Unretained(this), | 1840 base::Unretained(this), |
| 1841 layer_tree_host()->GetInputHandler())); | 1841 layer_tree_host()->GetInputHandler())); |
| 1842 PostSetNeedsCommitToMainThread(); | 1842 PostSetNeedsCommitToMainThread(); |
| 1843 } | 1843 } |
| 1844 | 1844 |
| 1845 void BindInputHandler(const base::WeakPtr<InputHandler> input_handler) { | 1845 void BindInputHandler(const base::WeakPtr<InputHandler> input_handler) { |
| 1846 DCHECK(task_runner_provider()->IsImplThread()); | 1846 DCHECK(task_runner_provider()->IsImplThread()); |
| 1847 input_handler->BindToClient(&input_handler_client_); | 1847 input_handler->BindToClient(&input_handler_client_); |
| 1848 scroll_elasticity_helper_ = input_handler->CreateScrollElasticityHelper(); | 1848 scroll_elasticity_helper_ = |
| 1849 input_handler->CreateRootScrollElasticityHelper(); |
| 1849 DCHECK(scroll_elasticity_helper_); | 1850 DCHECK(scroll_elasticity_helper_); |
| 1850 } | 1851 } |
| 1851 | 1852 |
| 1852 void ApplyViewportDeltas(const gfx::Vector2dF& inner_delta, | 1853 void ApplyViewportDeltas(const gfx::Vector2dF& inner_delta, |
| 1853 const gfx::Vector2dF& outer_delta, | 1854 const gfx::Vector2dF& outer_delta, |
| 1854 const gfx::Vector2dF& elastic_overscroll_delta, | 1855 const gfx::Vector2dF& elastic_overscroll_delta, |
| 1855 float scale, | 1856 float scale, |
| 1856 float top_controls_delta) override { | 1857 float top_controls_delta) override { |
| 1857 DCHECK_NE(0, num_begin_main_frames_main_thread_) | 1858 DCHECK_NE(0, num_begin_main_frames_main_thread_) |
| 1858 << "The first BeginMainFrame has no deltas to report"; | 1859 << "The first BeginMainFrame has no deltas to report"; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1973 | 1974 |
| 1974 const gfx::Vector2dF elastic_overscroll_test_cases_[5] = { | 1975 const gfx::Vector2dF elastic_overscroll_test_cases_[5] = { |
| 1975 gfx::Vector2dF(0, 0), gfx::Vector2dF(5, 10), gfx::Vector2dF(5, 5), | 1976 gfx::Vector2dF(0, 0), gfx::Vector2dF(5, 10), gfx::Vector2dF(5, 5), |
| 1976 gfx::Vector2dF(-4, -5), gfx::Vector2dF(0, 0)}; | 1977 gfx::Vector2dF(-4, -5), gfx::Vector2dF(0, 0)}; |
| 1977 }; | 1978 }; |
| 1978 | 1979 |
| 1979 MULTI_THREAD_TEST_F(LayerTreeHostScrollTestElasticOverscroll); | 1980 MULTI_THREAD_TEST_F(LayerTreeHostScrollTestElasticOverscroll); |
| 1980 | 1981 |
| 1981 } // namespace | 1982 } // namespace |
| 1982 } // namespace cc | 1983 } // namespace cc |
| OLD | NEW |