| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 #ifndef CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| 6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering | 143 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering |
| 144 // state. | 144 // state. |
| 145 class CC_EXPORT LayerTreeHostImpl | 145 class CC_EXPORT LayerTreeHostImpl |
| 146 : public InputHandler, | 146 : public InputHandler, |
| 147 public RendererClient, | 147 public RendererClient, |
| 148 public TileManagerClient, | 148 public TileManagerClient, |
| 149 public OutputSurfaceClient, | 149 public OutputSurfaceClient, |
| 150 public TopControlsManagerClient, | 150 public TopControlsManagerClient, |
| 151 public ScrollbarAnimationControllerClient, | 151 public ScrollbarAnimationControllerClient, |
| 152 public VideoFrameControllerClient, | 152 public VideoFrameControllerClient, |
| 153 public LayerTreeMutatorClient, |
| 153 public MutatorHostClient, | 154 public MutatorHostClient, |
| 154 public base::SupportsWeakPtr<LayerTreeHostImpl> { | 155 public base::SupportsWeakPtr<LayerTreeHostImpl> { |
| 155 public: | 156 public: |
| 156 static std::unique_ptr<LayerTreeHostImpl> Create( | 157 static std::unique_ptr<LayerTreeHostImpl> Create( |
| 157 const LayerTreeSettings& settings, | 158 const LayerTreeSettings& settings, |
| 158 LayerTreeHostImplClient* client, | 159 LayerTreeHostImplClient* client, |
| 159 TaskRunnerProvider* task_runner_provider, | 160 TaskRunnerProvider* task_runner_provider, |
| 160 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 161 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
| 161 SharedBitmapManager* shared_bitmap_manager, | 162 SharedBitmapManager* shared_bitmap_manager, |
| 162 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 163 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 void AppendRenderPass(std::unique_ptr<RenderPass> render_pass) override; | 233 void AppendRenderPass(std::unique_ptr<RenderPass> render_pass) override; |
| 233 | 234 |
| 234 private: | 235 private: |
| 235 DISALLOW_COPY_AND_ASSIGN(FrameData); | 236 DISALLOW_COPY_AND_ASSIGN(FrameData); |
| 236 }; | 237 }; |
| 237 | 238 |
| 238 virtual void BeginMainFrameAborted(CommitEarlyOutReason reason); | 239 virtual void BeginMainFrameAborted(CommitEarlyOutReason reason); |
| 239 virtual void BeginCommit(); | 240 virtual void BeginCommit(); |
| 240 virtual void CommitComplete(); | 241 virtual void CommitComplete(); |
| 241 virtual void UpdateAnimationState(bool start_ready_animations); | 242 virtual void UpdateAnimationState(bool start_ready_animations); |
| 243 bool Mutate(base::TimeTicks monotonic_time); |
| 242 void ActivateAnimations(); | 244 void ActivateAnimations(); |
| 243 void Animate(); | 245 void Animate(); |
| 244 void AnimatePendingTreeAfterCommit(); | 246 void AnimatePendingTreeAfterCommit(); |
| 245 void MainThreadHasStoppedFlinging(); | 247 void MainThreadHasStoppedFlinging(); |
| 246 void DidAnimateScrollOffset(); | 248 void DidAnimateScrollOffset(); |
| 247 void SetViewportDamage(const gfx::Rect& damage_rect); | 249 void SetViewportDamage(const gfx::Rect& damage_rect); |
| 248 | 250 |
| 249 void SetTreeLayerFilterMutated(int layer_id, | 251 void SetTreeLayerFilterMutated(int layer_id, |
| 250 LayerTreeImpl* tree, | 252 LayerTreeImpl* tree, |
| 251 const FilterOperations& filters); | 253 const FilterOperations& filters); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 void DidSwapBuffers() override; | 366 void DidSwapBuffers() override; |
| 365 void DidSwapBuffersComplete() override; | 367 void DidSwapBuffersComplete() override; |
| 366 void ReclaimResources(const CompositorFrameAck* ack) override; | 368 void ReclaimResources(const CompositorFrameAck* ack) override; |
| 367 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; | 369 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; |
| 368 void SetTreeActivationCallback(const base::Closure& callback) override; | 370 void SetTreeActivationCallback(const base::Closure& callback) override; |
| 369 void OnDraw(const gfx::Transform& transform, | 371 void OnDraw(const gfx::Transform& transform, |
| 370 const gfx::Rect& viewport, | 372 const gfx::Rect& viewport, |
| 371 const gfx::Rect& clip, | 373 const gfx::Rect& clip, |
| 372 bool resourceless_software_draw) override; | 374 bool resourceless_software_draw) override; |
| 373 | 375 |
| 376 // LayerTreeMutatorClient. |
| 377 void SetNeedsMutate() override; |
| 378 |
| 374 // Called from LayerTreeImpl. | 379 // Called from LayerTreeImpl. |
| 375 void OnCanDrawStateChangedForTree(); | 380 void OnCanDrawStateChangedForTree(); |
| 376 | 381 |
| 377 // Implementation. | 382 // Implementation. |
| 378 int id() const { return id_; } | 383 int id() const { return id_; } |
| 379 bool CanDraw() const; | 384 bool CanDraw() const; |
| 380 OutputSurface* output_surface() const { return output_surface_; } | 385 OutputSurface* output_surface() const { return output_surface_; } |
| 381 void ReleaseOutputSurface(); | 386 void ReleaseOutputSurface(); |
| 382 | 387 |
| 383 std::string LayerTreeAsJson() const; | 388 std::string LayerTreeAsJson() const; |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 InputHandler::ScrollStatus TryScroll(const gfx::PointF& screen_space_point, | 634 InputHandler::ScrollStatus TryScroll(const gfx::PointF& screen_space_point, |
| 630 InputHandler::ScrollInputType type, | 635 InputHandler::ScrollInputType type, |
| 631 const ScrollTree& scroll_tree, | 636 const ScrollTree& scroll_tree, |
| 632 ScrollNode* scroll_node) const; | 637 ScrollNode* scroll_node) const; |
| 633 | 638 |
| 634 // Returns true if a scroll offset animation is created and false if we scroll | 639 // Returns true if a scroll offset animation is created and false if we scroll |
| 635 // by the desired amount without an animation. | 640 // by the desired amount without an animation. |
| 636 bool ScrollAnimationCreate(ScrollNode* scroll_node, | 641 bool ScrollAnimationCreate(ScrollNode* scroll_node, |
| 637 const gfx::Vector2dF& scroll_amount); | 642 const gfx::Vector2dF& scroll_amount); |
| 638 | 643 |
| 639 void SetLayerTreeMutator(LayerTreeMutator* mutator); | 644 void SetLayerTreeMutator(std::unique_ptr<LayerTreeMutator> mutator); |
| 640 LayerTreeMutator* mutator() { return mutator_; } | 645 LayerTreeMutator* mutator() { return mutator_.get(); } |
| 641 | 646 |
| 642 protected: | 647 protected: |
| 643 LayerTreeHostImpl( | 648 LayerTreeHostImpl( |
| 644 const LayerTreeSettings& settings, | 649 const LayerTreeSettings& settings, |
| 645 LayerTreeHostImplClient* client, | 650 LayerTreeHostImplClient* client, |
| 646 TaskRunnerProvider* task_runner_provider, | 651 TaskRunnerProvider* task_runner_provider, |
| 647 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 652 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
| 648 SharedBitmapManager* shared_bitmap_manager, | 653 SharedBitmapManager* shared_bitmap_manager, |
| 649 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 654 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 650 TaskGraphRunner* task_graph_runner, | 655 TaskGraphRunner* task_graph_runner, |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 | 867 |
| 863 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 868 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
| 864 | 869 |
| 865 bool requires_high_res_to_draw_; | 870 bool requires_high_res_to_draw_; |
| 866 bool is_likely_to_require_a_draw_; | 871 bool is_likely_to_require_a_draw_; |
| 867 | 872 |
| 868 std::unique_ptr<FrameTimingTracker> frame_timing_tracker_; | 873 std::unique_ptr<FrameTimingTracker> frame_timing_tracker_; |
| 869 | 874 |
| 870 std::unique_ptr<Viewport> viewport_; | 875 std::unique_ptr<Viewport> viewport_; |
| 871 | 876 |
| 872 LayerTreeMutator* mutator_; | 877 std::unique_ptr<LayerTreeMutator> mutator_; |
| 873 | 878 |
| 874 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 879 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 875 }; | 880 }; |
| 876 | 881 |
| 877 } // namespace cc | 882 } // namespace cc |
| 878 | 883 |
| 879 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 884 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |