| 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 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1280 const gfx::SizeF& scrollable_size, | 1280 const gfx::SizeF& scrollable_size, |
| 1281 float page_scale_factor, | 1281 float page_scale_factor, |
| 1282 float min_page_scale_factor, | 1282 float min_page_scale_factor, |
| 1283 float max_page_scale_factor) override { | 1283 float max_page_scale_factor) override { |
| 1284 if (!task_runner_->BelongsToCurrentThread()) { | 1284 if (!task_runner_->BelongsToCurrentThread()) { |
| 1285 ADD_FAILURE() << "UpdateRootLayerStateForSynchronousInputHandler called " | 1285 ADD_FAILURE() << "UpdateRootLayerStateForSynchronousInputHandler called " |
| 1286 << " on wrong thread"; | 1286 << " on wrong thread"; |
| 1287 } | 1287 } |
| 1288 } | 1288 } |
| 1289 | 1289 |
| 1290 void DeliverInputForBeginFrame() override { |
| 1291 if (!task_runner_->BelongsToCurrentThread()) { |
| 1292 ADD_FAILURE() << "DeliverInputForBeginFrame called on wrong thread"; |
| 1293 } |
| 1294 } |
| 1295 |
| 1290 private: | 1296 private: |
| 1291 base::SingleThreadTaskRunner* task_runner_; | 1297 base::SingleThreadTaskRunner* task_runner_; |
| 1292 bool* received_stop_flinging_; | 1298 bool* received_stop_flinging_; |
| 1293 }; | 1299 }; |
| 1294 | 1300 |
| 1295 void BindInputHandlerOnCompositorThread( | 1301 void BindInputHandlerOnCompositorThread( |
| 1296 const base::WeakPtr<InputHandler>& input_handler, | 1302 const base::WeakPtr<InputHandler>& input_handler, |
| 1297 ThreadCheckingInputHandlerClient* client) { | 1303 ThreadCheckingInputHandlerClient* client) { |
| 1298 input_handler->BindToClient(client); | 1304 input_handler->BindToClient(client); |
| 1299 } | 1305 } |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1808 void WillShutdown() override {} | 1814 void WillShutdown() override {} |
| 1809 void Animate(base::TimeTicks) override {} | 1815 void Animate(base::TimeTicks) override {} |
| 1810 void MainThreadHasStoppedFlinging() override {} | 1816 void MainThreadHasStoppedFlinging() override {} |
| 1811 void UpdateRootLayerStateForSynchronousInputHandler( | 1817 void UpdateRootLayerStateForSynchronousInputHandler( |
| 1812 const gfx::ScrollOffset& total_scroll_offset, | 1818 const gfx::ScrollOffset& total_scroll_offset, |
| 1813 const gfx::ScrollOffset& max_scroll_offset, | 1819 const gfx::ScrollOffset& max_scroll_offset, |
| 1814 const gfx::SizeF& scrollable_size, | 1820 const gfx::SizeF& scrollable_size, |
| 1815 float page_scale_factor, | 1821 float page_scale_factor, |
| 1816 float min_page_scale_factor, | 1822 float min_page_scale_factor, |
| 1817 float max_page_scale_factor) override {} | 1823 float max_page_scale_factor) override {} |
| 1824 void DeliverInputForBeginFrame() override {} |
| 1818 }; | 1825 }; |
| 1819 | 1826 |
| 1820 // This is a regression test, see crbug.com/639046. | 1827 // This is a regression test, see crbug.com/639046. |
| 1821 class LayerTreeHostScrollTestElasticOverscroll | 1828 class LayerTreeHostScrollTestElasticOverscroll |
| 1822 : public LayerTreeHostScrollTest { | 1829 : public LayerTreeHostScrollTest { |
| 1823 public: | 1830 public: |
| 1824 LayerTreeHostScrollTestElasticOverscroll() | 1831 LayerTreeHostScrollTestElasticOverscroll() |
| 1825 : num_begin_main_frames_impl_thread_(0), | 1832 : num_begin_main_frames_impl_thread_(0), |
| 1826 scroll_elasticity_helper_(nullptr), | 1833 scroll_elasticity_helper_(nullptr), |
| 1827 num_begin_main_frames_main_thread_(0) {} | 1834 num_begin_main_frames_main_thread_(0) {} |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2038 private: | 2045 private: |
| 2039 gfx::ScrollOffset initial_scroll_; | 2046 gfx::ScrollOffset initial_scroll_; |
| 2040 gfx::ScrollOffset second_scroll_; | 2047 gfx::ScrollOffset second_scroll_; |
| 2041 gfx::Vector2dF scroll_amount_; | 2048 gfx::Vector2dF scroll_amount_; |
| 2042 }; | 2049 }; |
| 2043 | 2050 |
| 2044 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostScrollTestPropertyTreeUpdate); | 2051 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostScrollTestPropertyTreeUpdate); |
| 2045 | 2052 |
| 2046 } // namespace | 2053 } // namespace |
| 2047 } // namespace cc | 2054 } // namespace cc |
| OLD | NEW |