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