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; |
48 class LayerTreeImpl; | 49 class LayerTreeImpl; |
49 class MemoryHistory; | 50 class MemoryHistory; |
50 class PageScaleAnimation; | 51 class PageScaleAnimation; |
51 class PaintTimeCounter; | 52 class PaintTimeCounter; |
52 class PictureLayerImpl; | 53 class PictureLayerImpl; |
53 class RasterTilePriorityQueue; | 54 class RasterTilePriorityQueue; |
54 class RasterWorkerPool; | 55 class RasterWorkerPool; |
55 class RenderPassDrawQuad; | 56 class RenderPassDrawQuad; |
56 class RenderingStatsInstrumentation; | 57 class RenderingStatsInstrumentation; |
57 class ResourcePool; | 58 class ResourcePool; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 void AppendRenderPass(scoped_ptr<RenderPass> render_pass) override; | 182 void AppendRenderPass(scoped_ptr<RenderPass> render_pass) override; |
182 }; | 183 }; |
183 | 184 |
184 virtual void BeginMainFrameAborted(bool did_handle); | 185 virtual void BeginMainFrameAborted(bool did_handle); |
185 virtual void BeginCommit(); | 186 virtual void BeginCommit(); |
186 virtual void CommitComplete(); | 187 virtual void CommitComplete(); |
187 virtual void Animate(base::TimeTicks monotonic_time); | 188 virtual void Animate(base::TimeTicks monotonic_time); |
188 virtual void UpdateAnimationState(bool start_ready_animations); | 189 virtual void UpdateAnimationState(bool start_ready_animations); |
189 void ActivateAnimations(); | 190 void ActivateAnimations(); |
190 void MainThreadHasStoppedFlinging(); | 191 void MainThreadHasStoppedFlinging(); |
| 192 void UpdateBackgroundAnimateTicking(bool should_background_tick); |
191 void DidAnimateScrollOffset(); | 193 void DidAnimateScrollOffset(); |
192 void SetViewportDamage(const gfx::Rect& damage_rect); | 194 void SetViewportDamage(const gfx::Rect& damage_rect); |
193 | 195 |
194 virtual void ManageTiles(); | 196 virtual void ManageTiles(); |
195 | 197 |
196 // Returns DRAW_SUCCESS unless problems occured preparing the frame, and we | 198 // Returns DRAW_SUCCESS unless problems occured preparing the frame, and we |
197 // should try to avoid displaying the frame. If PrepareToDraw is called, | 199 // should try to avoid displaying the frame. If PrepareToDraw is called, |
198 // DidDrawAllLayers must also be called, regardless of whether DrawLayers is | 200 // DidDrawAllLayers must also be called, regardless of whether DrawLayers is |
199 // called between the two. | 201 // called between the two. |
200 virtual DrawResult PrepareToDraw(FrameData* frame); | 202 virtual DrawResult PrepareToDraw(FrameData* frame); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 return scroll_affects_scroll_handler_; | 323 return scroll_affects_scroll_handler_; |
322 } | 324 } |
323 void QueueSwapPromiseForMainThreadScrollUpdate( | 325 void QueueSwapPromiseForMainThreadScrollUpdate( |
324 scoped_ptr<SwapPromise> swap_promise); | 326 scoped_ptr<SwapPromise> swap_promise); |
325 | 327 |
326 bool IsActivelyScrolling() const; | 328 bool IsActivelyScrolling() const; |
327 | 329 |
328 virtual void SetVisible(bool visible); | 330 virtual void SetVisible(bool visible); |
329 bool visible() const { return visible_; } | 331 bool visible() const { return visible_; } |
330 | 332 |
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 |
510 const AnimationRegistrar::AnimationControllerMap& | 512 const AnimationRegistrar::AnimationControllerMap& |
511 active_animation_controllers() const { | 513 active_animation_controllers() const { |
512 return animation_registrar_->active_animation_controllers(); | 514 return animation_registrar_->active_animation_controllers(); |
513 } | 515 } |
514 | 516 |
515 bool manage_tiles_needed() const { return tile_priorities_dirty_; } | 517 bool manage_tiles_needed() const { return tile_priorities_dirty_; } |
516 | 518 |
517 LayerTreeHostImplClient* client_; | 519 LayerTreeHostImplClient* client_; |
518 Proxy* proxy_; | 520 Proxy* proxy_; |
519 | 521 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 gfx::Vector2dF accumulated_root_overscroll_; | 640 gfx::Vector2dF accumulated_root_overscroll_; |
639 | 641 |
640 bool pinch_gesture_active_; | 642 bool pinch_gesture_active_; |
641 bool pinch_gesture_end_should_clear_scrolling_layer_; | 643 bool pinch_gesture_end_should_clear_scrolling_layer_; |
642 gfx::Point previous_pinch_anchor_; | 644 gfx::Point previous_pinch_anchor_; |
643 | 645 |
644 scoped_ptr<TopControlsManager> top_controls_manager_; | 646 scoped_ptr<TopControlsManager> top_controls_manager_; |
645 | 647 |
646 scoped_ptr<PageScaleAnimation> page_scale_animation_; | 648 scoped_ptr<PageScaleAnimation> page_scale_animation_; |
647 | 649 |
| 650 // This is used for ticking animations slowly when hidden. |
| 651 scoped_ptr<LayerTreeHostImplTimeSourceAdapter> time_source_client_adapter_; |
| 652 |
648 scoped_ptr<FrameRateCounter> fps_counter_; | 653 scoped_ptr<FrameRateCounter> fps_counter_; |
649 scoped_ptr<PaintTimeCounter> paint_time_counter_; | 654 scoped_ptr<PaintTimeCounter> paint_time_counter_; |
650 scoped_ptr<MemoryHistory> memory_history_; | 655 scoped_ptr<MemoryHistory> memory_history_; |
651 scoped_ptr<DebugRectHistory> debug_rect_history_; | 656 scoped_ptr<DebugRectHistory> debug_rect_history_; |
652 | 657 |
653 scoped_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; | 658 scoped_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; |
654 | 659 |
655 // The maximum memory that would be used by the prioritized resource | 660 // The maximum memory that would be used by the prioritized resource |
656 // manager, if there were no limit on memory usage. | 661 // manager, if there were no limit on memory usage. |
657 size_t max_memory_needed_bytes_; | 662 size_t max_memory_needed_bytes_; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; | 718 std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; |
714 | 719 |
715 bool requires_high_res_to_draw_; | 720 bool requires_high_res_to_draw_; |
716 | 721 |
717 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 722 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
718 }; | 723 }; |
719 | 724 |
720 } // namespace cc | 725 } // namespace cc |
721 | 726 |
722 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 727 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |