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 <bitset> | 10 #include <bitset> |
(...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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 void DidSwapBuffers() override; | 365 void DidSwapBuffers() override; |
364 void DidSwapBuffersComplete() override; | 366 void DidSwapBuffersComplete() override; |
365 void ReclaimResources(const CompositorFrameAck* ack) override; | 367 void ReclaimResources(const CompositorFrameAck* ack) override; |
366 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; | 368 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; |
367 void SetTreeActivationCallback(const base::Closure& callback) override; | 369 void SetTreeActivationCallback(const base::Closure& callback) override; |
368 void OnDraw(const gfx::Transform& transform, | 370 void OnDraw(const gfx::Transform& transform, |
369 const gfx::Rect& viewport, | 371 const gfx::Rect& viewport, |
370 const gfx::Rect& clip, | 372 const gfx::Rect& clip, |
371 bool resourceless_software_draw) override; | 373 bool resourceless_software_draw) override; |
372 | 374 |
| 375 // LayerTreeMutatorClient. |
| 376 void SetNeedsMutate() override; |
| 377 |
373 // Called from LayerTreeImpl. | 378 // Called from LayerTreeImpl. |
374 void OnCanDrawStateChangedForTree(); | 379 void OnCanDrawStateChangedForTree(); |
375 | 380 |
376 // Implementation. | 381 // Implementation. |
377 int id() const { return id_; } | 382 int id() const { return id_; } |
378 bool CanDraw() const; | 383 bool CanDraw() const; |
379 OutputSurface* output_surface() const { return output_surface_; } | 384 OutputSurface* output_surface() const { return output_surface_; } |
380 void ReleaseOutputSurface(); | 385 void ReleaseOutputSurface(); |
381 | 386 |
382 std::string LayerTreeAsJson() const; | 387 std::string LayerTreeAsJson() const; |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 InputHandler::ScrollStatus TryScroll(const gfx::PointF& screen_space_point, | 604 InputHandler::ScrollStatus TryScroll(const gfx::PointF& screen_space_point, |
600 InputHandler::ScrollInputType type, | 605 InputHandler::ScrollInputType type, |
601 const ScrollTree& scroll_tree, | 606 const ScrollTree& scroll_tree, |
602 ScrollNode* scroll_node) const; | 607 ScrollNode* scroll_node) const; |
603 | 608 |
604 // Returns true if a scroll offset animation is created and false if we scroll | 609 // Returns true if a scroll offset animation is created and false if we scroll |
605 // by the desired amount without an animation. | 610 // by the desired amount without an animation. |
606 bool ScrollAnimationCreate(ScrollNode* scroll_node, | 611 bool ScrollAnimationCreate(ScrollNode* scroll_node, |
607 const gfx::Vector2dF& scroll_amount); | 612 const gfx::Vector2dF& scroll_amount); |
608 | 613 |
609 void SetLayerTreeMutator(LayerTreeMutator* mutator); | 614 void SetLayerTreeMutator(std::unique_ptr<LayerTreeMutator> mutator); |
610 LayerTreeMutator* mutator() { return mutator_; } | 615 LayerTreeMutator* mutator() { return mutator_.get(); } |
611 | 616 |
612 void set_fixed_raster_scale_has_blurry_content() { | 617 void set_fixed_raster_scale_has_blurry_content() { |
613 has_fixed_raster_scale_blurry_content_ = true; | 618 has_fixed_raster_scale_blurry_content_ = true; |
614 } | 619 } |
615 bool has_fixed_raster_scale_blurry_content() const { | 620 bool has_fixed_raster_scale_blurry_content() const { |
616 return has_fixed_raster_scale_blurry_content_; | 621 return has_fixed_raster_scale_blurry_content_; |
617 } | 622 } |
618 | 623 |
619 bool HasFixedRasterScalePotentialPerformanceRegression() const; | 624 bool HasFixedRasterScalePotentialPerformanceRegression() const; |
620 void SetFixedRasterScaleAttemptedToChangeScale(); | 625 void SetFixedRasterScaleAttemptedToChangeScale(); |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 TaskGraphRunner* task_graph_runner_; | 846 TaskGraphRunner* task_graph_runner_; |
842 int id_; | 847 int id_; |
843 | 848 |
844 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 849 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
845 | 850 |
846 bool requires_high_res_to_draw_; | 851 bool requires_high_res_to_draw_; |
847 bool is_likely_to_require_a_draw_; | 852 bool is_likely_to_require_a_draw_; |
848 | 853 |
849 std::unique_ptr<Viewport> viewport_; | 854 std::unique_ptr<Viewport> viewport_; |
850 | 855 |
851 LayerTreeMutator* mutator_; | 856 std::unique_ptr<LayerTreeMutator> mutator_; |
852 | 857 |
853 bool has_fixed_raster_scale_blurry_content_; | 858 bool has_fixed_raster_scale_blurry_content_; |
854 std::bitset<kFixedRasterScaleAttemptedScaleChangeHistoryCount> | 859 std::bitset<kFixedRasterScaleAttemptedScaleChangeHistoryCount> |
855 fixed_raster_scale_attempted_scale_change_history_; | 860 fixed_raster_scale_attempted_scale_change_history_; |
856 std::unique_ptr<PendingTreeDurationHistogramTimer> | 861 std::unique_ptr<PendingTreeDurationHistogramTimer> |
857 pending_tree_duration_timer_; | 862 pending_tree_duration_timer_; |
858 | 863 |
859 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 864 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
860 }; | 865 }; |
861 | 866 |
862 } // namespace cc | 867 } // namespace cc |
863 | 868 |
864 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 869 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |