| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering | 139 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering |
| 140 // state. | 140 // state. |
| 141 class CC_EXPORT LayerTreeHostImpl | 141 class CC_EXPORT LayerTreeHostImpl |
| 142 : public InputHandler, | 142 : public InputHandler, |
| 143 public RendererClient, | 143 public RendererClient, |
| 144 public TileManagerClient, | 144 public TileManagerClient, |
| 145 public OutputSurfaceClient, | 145 public OutputSurfaceClient, |
| 146 public TopControlsManagerClient, | 146 public TopControlsManagerClient, |
| 147 public ScrollbarAnimationControllerClient, | 147 public ScrollbarAnimationControllerClient, |
| 148 public VideoFrameControllerClient, | 148 public VideoFrameControllerClient, |
| 149 public LayerTreeMutatorClient, |
| 149 public MutatorHostClient, | 150 public MutatorHostClient, |
| 150 public base::SupportsWeakPtr<LayerTreeHostImpl> { | 151 public base::SupportsWeakPtr<LayerTreeHostImpl> { |
| 151 public: | 152 public: |
| 152 static std::unique_ptr<LayerTreeHostImpl> Create( | 153 static std::unique_ptr<LayerTreeHostImpl> Create( |
| 153 const LayerTreeSettings& settings, | 154 const LayerTreeSettings& settings, |
| 154 LayerTreeHostImplClient* client, | 155 LayerTreeHostImplClient* client, |
| 155 TaskRunnerProvider* task_runner_provider, | 156 TaskRunnerProvider* task_runner_provider, |
| 156 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 157 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
| 157 SharedBitmapManager* shared_bitmap_manager, | 158 SharedBitmapManager* shared_bitmap_manager, |
| 158 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 159 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 void AppendRenderPass(std::unique_ptr<RenderPass> render_pass) override; | 228 void AppendRenderPass(std::unique_ptr<RenderPass> render_pass) override; |
| 228 | 229 |
| 229 private: | 230 private: |
| 230 DISALLOW_COPY_AND_ASSIGN(FrameData); | 231 DISALLOW_COPY_AND_ASSIGN(FrameData); |
| 231 }; | 232 }; |
| 232 | 233 |
| 233 virtual void BeginMainFrameAborted(CommitEarlyOutReason reason); | 234 virtual void BeginMainFrameAborted(CommitEarlyOutReason reason); |
| 234 virtual void BeginCommit(); | 235 virtual void BeginCommit(); |
| 235 virtual void CommitComplete(); | 236 virtual void CommitComplete(); |
| 236 virtual void UpdateAnimationState(bool start_ready_animations); | 237 virtual void UpdateAnimationState(bool start_ready_animations); |
| 238 bool Mutate(base::TimeTicks monotonic_time); |
| 237 void ActivateAnimations(); | 239 void ActivateAnimations(); |
| 238 void Animate(); | 240 void Animate(); |
| 239 void AnimatePendingTreeAfterCommit(); | 241 void AnimatePendingTreeAfterCommit(); |
| 240 void MainThreadHasStoppedFlinging(); | 242 void MainThreadHasStoppedFlinging(); |
| 241 void DidAnimateScrollOffset(); | 243 void DidAnimateScrollOffset(); |
| 242 void SetViewportDamage(const gfx::Rect& damage_rect); | 244 void SetViewportDamage(const gfx::Rect& damage_rect); |
| 243 | 245 |
| 244 void SetTreeLayerFilterMutated(int layer_id, | 246 void SetTreeLayerFilterMutated(int layer_id, |
| 245 LayerTreeImpl* tree, | 247 LayerTreeImpl* tree, |
| 246 const FilterOperations& filters); | 248 const FilterOperations& filters); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 void DidSwapBuffers() override; | 364 void DidSwapBuffers() override; |
| 363 void DidSwapBuffersComplete() override; | 365 void DidSwapBuffersComplete() override; |
| 364 void ReclaimResources(const CompositorFrameAck* ack) override; | 366 void ReclaimResources(const CompositorFrameAck* ack) override; |
| 365 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; | 367 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; |
| 366 void SetTreeActivationCallback(const base::Closure& callback) override; | 368 void SetTreeActivationCallback(const base::Closure& callback) override; |
| 367 void OnDraw(const gfx::Transform& transform, | 369 void OnDraw(const gfx::Transform& transform, |
| 368 const gfx::Rect& viewport, | 370 const gfx::Rect& viewport, |
| 369 const gfx::Rect& clip, | 371 const gfx::Rect& clip, |
| 370 bool resourceless_software_draw) override; | 372 bool resourceless_software_draw) override; |
| 371 | 373 |
| 374 // LayerTreeMutatorClient. |
| 375 void SetNeedsMutate() override; |
| 376 |
| 372 // Called from LayerTreeImpl. | 377 // Called from LayerTreeImpl. |
| 373 void OnCanDrawStateChangedForTree(); | 378 void OnCanDrawStateChangedForTree(); |
| 374 | 379 |
| 375 // Implementation. | 380 // Implementation. |
| 376 int id() const { return id_; } | 381 int id() const { return id_; } |
| 377 bool CanDraw() const; | 382 bool CanDraw() const; |
| 378 OutputSurface* output_surface() const { return output_surface_; } | 383 OutputSurface* output_surface() const { return output_surface_; } |
| 379 void ReleaseOutputSurface(); | 384 void ReleaseOutputSurface(); |
| 380 | 385 |
| 381 std::string LayerTreeAsJson() const; | 386 std::string LayerTreeAsJson() const; |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 InputHandler::ScrollStatus TryScroll(const gfx::PointF& screen_space_point, | 609 InputHandler::ScrollStatus TryScroll(const gfx::PointF& screen_space_point, |
| 605 InputHandler::ScrollInputType type, | 610 InputHandler::ScrollInputType type, |
| 606 const ScrollTree& scroll_tree, | 611 const ScrollTree& scroll_tree, |
| 607 ScrollNode* scroll_node) const; | 612 ScrollNode* scroll_node) const; |
| 608 | 613 |
| 609 // Returns true if a scroll offset animation is created and false if we scroll | 614 // Returns true if a scroll offset animation is created and false if we scroll |
| 610 // by the desired amount without an animation. | 615 // by the desired amount without an animation. |
| 611 bool ScrollAnimationCreate(ScrollNode* scroll_node, | 616 bool ScrollAnimationCreate(ScrollNode* scroll_node, |
| 612 const gfx::Vector2dF& scroll_amount); | 617 const gfx::Vector2dF& scroll_amount); |
| 613 | 618 |
| 614 void SetLayerTreeMutator(LayerTreeMutator* mutator); | 619 void SetLayerTreeMutator(std::unique_ptr<LayerTreeMutator> mutator); |
| 615 LayerTreeMutator* mutator() { return mutator_; } | 620 LayerTreeMutator* mutator() { return mutator_.get(); } |
| 616 | 621 |
| 617 protected: | 622 protected: |
| 618 LayerTreeHostImpl( | 623 LayerTreeHostImpl( |
| 619 const LayerTreeSettings& settings, | 624 const LayerTreeSettings& settings, |
| 620 LayerTreeHostImplClient* client, | 625 LayerTreeHostImplClient* client, |
| 621 TaskRunnerProvider* task_runner_provider, | 626 TaskRunnerProvider* task_runner_provider, |
| 622 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 627 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
| 623 SharedBitmapManager* shared_bitmap_manager, | 628 SharedBitmapManager* shared_bitmap_manager, |
| 624 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 629 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 625 TaskGraphRunner* task_graph_runner, | 630 TaskGraphRunner* task_graph_runner, |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 TaskGraphRunner* task_graph_runner_; | 840 TaskGraphRunner* task_graph_runner_; |
| 836 int id_; | 841 int id_; |
| 837 | 842 |
| 838 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 843 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
| 839 | 844 |
| 840 bool requires_high_res_to_draw_; | 845 bool requires_high_res_to_draw_; |
| 841 bool is_likely_to_require_a_draw_; | 846 bool is_likely_to_require_a_draw_; |
| 842 | 847 |
| 843 std::unique_ptr<Viewport> viewport_; | 848 std::unique_ptr<Viewport> viewport_; |
| 844 | 849 |
| 845 LayerTreeMutator* mutator_; | 850 std::unique_ptr<LayerTreeMutator> mutator_; |
| 846 | 851 |
| 847 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 852 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 848 }; | 853 }; |
| 849 | 854 |
| 850 } // namespace cc | 855 } // namespace cc |
| 851 | 856 |
| 852 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 857 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |