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 <list> | 8 #include <list> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 27 matching lines...) Expand all Loading... |
38 #include "ui/gfx/geometry/rect.h" | 38 #include "ui/gfx/geometry/rect.h" |
39 | 39 |
40 namespace cc { | 40 namespace cc { |
41 | 41 |
42 class CompletionEvent; | 42 class CompletionEvent; |
43 class CompositorFrameMetadata; | 43 class CompositorFrameMetadata; |
44 class DebugRectHistory; | 44 class DebugRectHistory; |
45 class EvictionTilePriorityQueue; | 45 class EvictionTilePriorityQueue; |
46 class FrameRateCounter; | 46 class FrameRateCounter; |
47 class LayerImpl; | 47 class LayerImpl; |
48 class LayerTreeHostImplTimeSourceAdapter; | |
49 class LayerTreeImpl; | 48 class LayerTreeImpl; |
50 class MemoryHistory; | 49 class MemoryHistory; |
51 class PageScaleAnimation; | 50 class PageScaleAnimation; |
52 class PaintTimeCounter; | 51 class PaintTimeCounter; |
53 class PictureLayerImpl; | 52 class PictureLayerImpl; |
54 class RasterTilePriorityQueue; | 53 class RasterTilePriorityQueue; |
55 class RasterWorkerPool; | 54 class RasterWorkerPool; |
56 class RenderPassDrawQuad; | 55 class RenderPassDrawQuad; |
57 class RenderingStatsInstrumentation; | 56 class RenderingStatsInstrumentation; |
58 class ResourcePool; | 57 class ResourcePool; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 void AppendRenderPass(scoped_ptr<RenderPass> render_pass) override; | 181 void AppendRenderPass(scoped_ptr<RenderPass> render_pass) override; |
183 }; | 182 }; |
184 | 183 |
185 virtual void BeginMainFrameAborted(bool did_handle); | 184 virtual void BeginMainFrameAborted(bool did_handle); |
186 virtual void BeginCommit(); | 185 virtual void BeginCommit(); |
187 virtual void CommitComplete(); | 186 virtual void CommitComplete(); |
188 virtual void Animate(base::TimeTicks monotonic_time); | 187 virtual void Animate(base::TimeTicks monotonic_time); |
189 virtual void UpdateAnimationState(bool start_ready_animations); | 188 virtual void UpdateAnimationState(bool start_ready_animations); |
190 void ActivateAnimations(); | 189 void ActivateAnimations(); |
191 void MainThreadHasStoppedFlinging(); | 190 void MainThreadHasStoppedFlinging(); |
192 void UpdateBackgroundAnimateTicking(bool should_background_tick); | |
193 void DidAnimateScrollOffset(); | 191 void DidAnimateScrollOffset(); |
194 void SetViewportDamage(const gfx::Rect& damage_rect); | 192 void SetViewportDamage(const gfx::Rect& damage_rect); |
195 | 193 |
196 virtual void ManageTiles(); | 194 virtual void ManageTiles(); |
197 | 195 |
198 // Returns DRAW_SUCCESS unless problems occured preparing the frame, and we | 196 // Returns DRAW_SUCCESS unless problems occured preparing the frame, and we |
199 // should try to avoid displaying the frame. If PrepareToDraw is called, | 197 // should try to avoid displaying the frame. If PrepareToDraw is called, |
200 // DidDrawAllLayers must also be called, regardless of whether DrawLayers is | 198 // DidDrawAllLayers must also be called, regardless of whether DrawLayers is |
201 // called between the two. | 199 // called between the two. |
202 virtual DrawResult PrepareToDraw(FrameData* frame); | 200 virtual DrawResult PrepareToDraw(FrameData* frame); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 return scroll_affects_scroll_handler_; | 321 return scroll_affects_scroll_handler_; |
324 } | 322 } |
325 void QueueSwapPromiseForMainThreadScrollUpdate( | 323 void QueueSwapPromiseForMainThreadScrollUpdate( |
326 scoped_ptr<SwapPromise> swap_promise); | 324 scoped_ptr<SwapPromise> swap_promise); |
327 | 325 |
328 bool IsActivelyScrolling() const; | 326 bool IsActivelyScrolling() const; |
329 | 327 |
330 virtual void SetVisible(bool visible); | 328 virtual void SetVisible(bool visible); |
331 bool visible() const { return visible_; } | 329 bool visible() const { return visible_; } |
332 | 330 |
| 331 bool AnimationsAreVisible() { return visible() && CanDraw(); } |
| 332 |
333 void SetNeedsCommit() { client_->SetNeedsCommitOnImplThread(); } | 333 void SetNeedsCommit() { client_->SetNeedsCommitOnImplThread(); } |
334 void SetNeedsRedraw(); | 334 void SetNeedsRedraw(); |
335 | 335 |
336 ManagedMemoryPolicy ActualManagedMemoryPolicy() const; | 336 ManagedMemoryPolicy ActualManagedMemoryPolicy() const; |
337 | 337 |
338 size_t memory_allocation_limit_bytes() const; | 338 size_t memory_allocation_limit_bytes() const; |
339 int memory_allocation_priority_cutoff() const; | 339 int memory_allocation_priority_cutoff() const; |
340 | 340 |
341 void SetViewportSize(const gfx::Size& device_viewport_size); | 341 void SetViewportSize(const gfx::Size& device_viewport_size); |
342 gfx::Size device_viewport_size() const { return device_viewport_size_; } | 342 gfx::Size device_viewport_size() const { return device_viewport_size_; } |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 Proxy* proxy, | 500 Proxy* proxy, |
501 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 501 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
502 SharedBitmapManager* shared_bitmap_manager, | 502 SharedBitmapManager* shared_bitmap_manager, |
503 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 503 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
504 int id); | 504 int id); |
505 | 505 |
506 void UpdateViewportContainerSizes(); | 506 void UpdateViewportContainerSizes(); |
507 | 507 |
508 // Virtual for testing. | 508 // Virtual for testing. |
509 virtual void AnimateLayers(base::TimeTicks monotonic_time); | 509 virtual void AnimateLayers(base::TimeTicks monotonic_time); |
510 virtual base::TimeDelta LowFrequencyAnimationInterval() const; | |
511 | |
512 const AnimationRegistrar::AnimationControllerMap& | 510 const AnimationRegistrar::AnimationControllerMap& |
513 active_animation_controllers() const { | 511 active_animation_controllers() const { |
514 return animation_registrar_->active_animation_controllers(); | 512 return animation_registrar_->active_animation_controllers(); |
515 } | 513 } |
516 | 514 |
517 bool manage_tiles_needed() const { return tile_priorities_dirty_; } | 515 bool manage_tiles_needed() const { return tile_priorities_dirty_; } |
518 | 516 |
519 LayerTreeHostImplClient* client_; | 517 LayerTreeHostImplClient* client_; |
520 Proxy* proxy_; | 518 Proxy* proxy_; |
521 | 519 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 gfx::Vector2dF accumulated_root_overscroll_; | 638 gfx::Vector2dF accumulated_root_overscroll_; |
641 | 639 |
642 bool pinch_gesture_active_; | 640 bool pinch_gesture_active_; |
643 bool pinch_gesture_end_should_clear_scrolling_layer_; | 641 bool pinch_gesture_end_should_clear_scrolling_layer_; |
644 gfx::Point previous_pinch_anchor_; | 642 gfx::Point previous_pinch_anchor_; |
645 | 643 |
646 scoped_ptr<TopControlsManager> top_controls_manager_; | 644 scoped_ptr<TopControlsManager> top_controls_manager_; |
647 | 645 |
648 scoped_ptr<PageScaleAnimation> page_scale_animation_; | 646 scoped_ptr<PageScaleAnimation> page_scale_animation_; |
649 | 647 |
650 // This is used for ticking animations slowly when hidden. | |
651 scoped_ptr<LayerTreeHostImplTimeSourceAdapter> time_source_client_adapter_; | |
652 | |
653 scoped_ptr<FrameRateCounter> fps_counter_; | 648 scoped_ptr<FrameRateCounter> fps_counter_; |
654 scoped_ptr<PaintTimeCounter> paint_time_counter_; | 649 scoped_ptr<PaintTimeCounter> paint_time_counter_; |
655 scoped_ptr<MemoryHistory> memory_history_; | 650 scoped_ptr<MemoryHistory> memory_history_; |
656 scoped_ptr<DebugRectHistory> debug_rect_history_; | 651 scoped_ptr<DebugRectHistory> debug_rect_history_; |
657 | 652 |
658 scoped_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; | 653 scoped_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; |
659 | 654 |
660 // The maximum memory that would be used by the prioritized resource | 655 // The maximum memory that would be used by the prioritized resource |
661 // manager, if there were no limit on memory usage. | 656 // manager, if there were no limit on memory usage. |
662 size_t max_memory_needed_bytes_; | 657 size_t max_memory_needed_bytes_; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; | 713 std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; |
719 | 714 |
720 bool requires_high_res_to_draw_; | 715 bool requires_high_res_to_draw_; |
721 | 716 |
722 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 717 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
723 }; | 718 }; |
724 | 719 |
725 } // namespace cc | 720 } // namespace cc |
726 | 721 |
727 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 722 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |