| 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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1814   void WillShutdown() override {} | 1820   void WillShutdown() override {} | 
| 1815   void Animate(base::TimeTicks) override {} | 1821   void Animate(base::TimeTicks) override {} | 
| 1816   void MainThreadHasStoppedFlinging() override {} | 1822   void MainThreadHasStoppedFlinging() override {} | 
| 1817   void UpdateRootLayerStateForSynchronousInputHandler( | 1823   void UpdateRootLayerStateForSynchronousInputHandler( | 
| 1818       const gfx::ScrollOffset& total_scroll_offset, | 1824       const gfx::ScrollOffset& total_scroll_offset, | 
| 1819       const gfx::ScrollOffset& max_scroll_offset, | 1825       const gfx::ScrollOffset& max_scroll_offset, | 
| 1820       const gfx::SizeF& scrollable_size, | 1826       const gfx::SizeF& scrollable_size, | 
| 1821       float page_scale_factor, | 1827       float page_scale_factor, | 
| 1822       float min_page_scale_factor, | 1828       float min_page_scale_factor, | 
| 1823       float max_page_scale_factor) override {} | 1829       float max_page_scale_factor) override {} | 
|  | 1830   void DeliverInputForBeginFrame() override {} | 
| 1824 }; | 1831 }; | 
| 1825 | 1832 | 
| 1826 // This is a regression test, see crbug.com/639046. | 1833 // This is a regression test, see crbug.com/639046. | 
| 1827 class LayerTreeHostScrollTestElasticOverscroll | 1834 class LayerTreeHostScrollTestElasticOverscroll | 
| 1828     : public LayerTreeHostScrollTest { | 1835     : public LayerTreeHostScrollTest { | 
| 1829  public: | 1836  public: | 
| 1830   LayerTreeHostScrollTestElasticOverscroll() | 1837   LayerTreeHostScrollTestElasticOverscroll() | 
| 1831       : num_begin_main_frames_impl_thread_(0), | 1838       : num_begin_main_frames_impl_thread_(0), | 
| 1832         scroll_elasticity_helper_(nullptr), | 1839         scroll_elasticity_helper_(nullptr), | 
| 1833         num_begin_main_frames_main_thread_(0) {} | 1840         num_begin_main_frames_main_thread_(0) {} | 
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2230 | 2237 | 
| 2231   const float initial_page_scale_ = 0.5f; | 2238   const float initial_page_scale_ = 0.5f; | 
| 2232   const float page_scale_update_ = 0.2f; | 2239   const float page_scale_update_ = 0.2f; | 
| 2233 }; | 2240 }; | 
| 2234 | 2241 | 
| 2235 // The reflected deltas are supported in threaded mode only. | 2242 // The reflected deltas are supported in threaded mode only. | 
| 2236 MULTI_THREAD_TEST_F(LayerTreeHostScrollTestAppliesReflectedDeltas); | 2243 MULTI_THREAD_TEST_F(LayerTreeHostScrollTestAppliesReflectedDeltas); | 
| 2237 | 2244 | 
| 2238 }  // namespace | 2245 }  // namespace | 
| 2239 }  // namespace cc | 2246 }  // namespace cc | 
| OLD | NEW | 
|---|