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 <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 virtual void SetNeedsCommitOnImplThread() = 0; | 96 virtual void SetNeedsCommitOnImplThread() = 0; |
97 virtual void SetNeedsPrepareTilesOnImplThread() = 0; | 97 virtual void SetNeedsPrepareTilesOnImplThread() = 0; |
98 virtual void PostAnimationEventsToMainThreadOnImplThread( | 98 virtual void PostAnimationEventsToMainThreadOnImplThread( |
99 scoped_ptr<AnimationEventsVector> events) = 0; | 99 scoped_ptr<AnimationEventsVector> events) = 0; |
100 // Returns true if resources were deleted by this call. | 100 // Returns true if resources were deleted by this call. |
101 virtual bool ReduceContentsTextureMemoryOnImplThread( | 101 virtual bool ReduceContentsTextureMemoryOnImplThread( |
102 size_t limit_bytes, | 102 size_t limit_bytes, |
103 int priority_cutoff) = 0; | 103 int priority_cutoff) = 0; |
104 virtual bool IsInsideDraw() = 0; | 104 virtual bool IsInsideDraw() = 0; |
105 virtual void RenewTreePriority() = 0; | 105 virtual void RenewTreePriority() = 0; |
106 virtual void PostDelayedScrollbarFadeOnImplThread( | 106 virtual void PostDelayedAnimationTaskOnImplThread(const base::Closure& task, |
107 const base::Closure& start_fade, | 107 base::TimeDelta delay) = 0; |
108 base::TimeDelta delay) = 0; | |
109 virtual void DidActivateSyncTree() = 0; | 108 virtual void DidActivateSyncTree() = 0; |
110 virtual void DidPrepareTiles() = 0; | 109 virtual void DidPrepareTiles() = 0; |
111 | 110 |
112 // Called when page scale animation has completed on the impl thread. | 111 // Called when page scale animation has completed on the impl thread. |
113 virtual void DidCompletePageScaleAnimationOnImplThread() = 0; | 112 virtual void DidCompletePageScaleAnimationOnImplThread() = 0; |
114 | 113 |
115 protected: | 114 protected: |
116 virtual ~LayerTreeHostImplClient() {} | 115 virtual ~LayerTreeHostImplClient() {} |
117 }; | 116 }; |
118 | 117 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 void NotifyReadyToDraw() override; | 250 void NotifyReadyToDraw() override; |
252 void NotifyTileStateChanged(const Tile* tile) override; | 251 void NotifyTileStateChanged(const Tile* tile) override; |
253 scoped_ptr<RasterTilePriorityQueue> BuildRasterQueue( | 252 scoped_ptr<RasterTilePriorityQueue> BuildRasterQueue( |
254 TreePriority tree_priority, | 253 TreePriority tree_priority, |
255 RasterTilePriorityQueue::Type type) override; | 254 RasterTilePriorityQueue::Type type) override; |
256 scoped_ptr<EvictionTilePriorityQueue> BuildEvictionQueue( | 255 scoped_ptr<EvictionTilePriorityQueue> BuildEvictionQueue( |
257 TreePriority tree_priority) override; | 256 TreePriority tree_priority) override; |
258 void SetIsLikelyToRequireADraw(bool is_likely_to_require_a_draw) override; | 257 void SetIsLikelyToRequireADraw(bool is_likely_to_require_a_draw) override; |
259 | 258 |
260 // ScrollbarAnimationControllerClient implementation. | 259 // ScrollbarAnimationControllerClient implementation. |
261 void PostDelayedScrollbarFade(const base::Closure& start_fade, | 260 void StartAnimatingScrollbarAnimationController( |
262 base::TimeDelta delay) override; | 261 ScrollbarAnimationController* controller) override; |
263 void SetNeedsScrollbarAnimationFrame() override; | 262 void StopAnimatingScrollbarAnimationController( |
| 263 ScrollbarAnimationController* controller) override; |
| 264 void PostDelayedScrollbarAnimationTask(const base::Closure& task, |
| 265 base::TimeDelta delay) override; |
| 266 void SetNeedsRedrawForScrollbarAnimation() override; |
264 | 267 |
265 // OutputSurfaceClient implementation. | 268 // OutputSurfaceClient implementation. |
266 void DeferredInitialize() override; | 269 void DeferredInitialize() override; |
267 void ReleaseGL() override; | 270 void ReleaseGL() override; |
268 void CommitVSyncParameters(base::TimeTicks timebase, | 271 void CommitVSyncParameters(base::TimeTicks timebase, |
269 base::TimeDelta interval) override; | 272 base::TimeDelta interval) override; |
270 void SetNeedsRedrawRect(const gfx::Rect& rect) override; | 273 void SetNeedsRedrawRect(const gfx::Rect& rect) override; |
271 void SetExternalDrawConstraints( | 274 void SetExternalDrawConstraints( |
272 const gfx::Transform& transform, | 275 const gfx::Transform& transform, |
273 const gfx::Rect& viewport, | 276 const gfx::Rect& viewport, |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 LayerTreeHostImplClient* client, | 528 LayerTreeHostImplClient* client, |
526 Proxy* proxy, | 529 Proxy* proxy, |
527 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 530 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
528 SharedBitmapManager* shared_bitmap_manager, | 531 SharedBitmapManager* shared_bitmap_manager, |
529 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 532 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
530 int id); | 533 int id); |
531 | 534 |
532 | 535 |
533 // Virtual for testing. | 536 // Virtual for testing. |
534 virtual void AnimateLayers(base::TimeTicks monotonic_time); | 537 virtual void AnimateLayers(base::TimeTicks monotonic_time); |
535 const AnimationRegistrar::AnimationControllerMap& | |
536 active_animation_controllers() const { | |
537 return animation_registrar_->active_animation_controllers(); | |
538 } | |
539 | 538 |
540 LayerTreeHostImplClient* client_; | 539 LayerTreeHostImplClient* client_; |
541 Proxy* proxy_; | 540 Proxy* proxy_; |
542 | 541 |
543 private: | 542 private: |
544 void CreateAndSetRenderer(); | 543 void CreateAndSetRenderer(); |
545 void CreateAndSetTileManager(); | 544 void CreateAndSetTileManager(); |
546 void DestroyTileManager(); | 545 void DestroyTileManager(); |
547 void ReleaseTreeResources(); | 546 void ReleaseTreeResources(); |
548 void RecreateTreeResources(); | 547 void RecreateTreeResources(); |
(...skipping 28 matching lines...) Expand all Loading... |
577 // This function should only be called from PrepareToDraw, as DidDrawAllLayers | 576 // This function should only be called from PrepareToDraw, as DidDrawAllLayers |
578 // must be called if this helper function is called. Returns DRAW_SUCCESS if | 577 // must be called if this helper function is called. Returns DRAW_SUCCESS if |
579 // the frame should be drawn. | 578 // the frame should be drawn. |
580 DrawResult CalculateRenderPasses(FrameData* frame); | 579 DrawResult CalculateRenderPasses(FrameData* frame); |
581 | 580 |
582 void ClearCurrentlyScrollingLayer(); | 581 void ClearCurrentlyScrollingLayer(); |
583 | 582 |
584 bool HandleMouseOverScrollbar(LayerImpl* layer_impl, | 583 bool HandleMouseOverScrollbar(LayerImpl* layer_impl, |
585 const gfx::PointF& device_viewport_point); | 584 const gfx::PointF& device_viewport_point); |
586 | 585 |
587 void AnimateScrollbarsRecursive(LayerImpl* layer, | |
588 base::TimeTicks time); | |
589 | |
590 LayerImpl* FindScrollLayerForDeviceViewportPoint( | 586 LayerImpl* FindScrollLayerForDeviceViewportPoint( |
591 const gfx::PointF& device_viewport_point, | 587 const gfx::PointF& device_viewport_point, |
592 InputHandler::ScrollInputType type, | 588 InputHandler::ScrollInputType type, |
593 LayerImpl* layer_hit_by_point, | 589 LayerImpl* layer_hit_by_point, |
594 bool* scroll_on_main_thread, | 590 bool* scroll_on_main_thread, |
595 bool* optional_has_ancestor_scroll_handler) const; | 591 bool* optional_has_ancestor_scroll_handler) const; |
596 float DeviceSpaceDistanceToLayer(const gfx::PointF& device_viewport_point, | 592 float DeviceSpaceDistanceToLayer(const gfx::PointF& device_viewport_point, |
597 LayerImpl* layer_impl); | 593 LayerImpl* layer_impl); |
598 void StartScrollbarFadeRecursive(LayerImpl* layer); | 594 void StartScrollbarFadeRecursive(LayerImpl* layer); |
599 void SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy, | 595 void SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy, |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 bool resourceless_software_draw_; | 705 bool resourceless_software_draw_; |
710 | 706 |
711 gfx::Rect viewport_damage_rect_; | 707 gfx::Rect viewport_damage_rect_; |
712 | 708 |
713 BeginFrameArgs current_begin_frame_args_; | 709 BeginFrameArgs current_begin_frame_args_; |
714 | 710 |
715 // Expected time between two begin impl frame calls. | 711 // Expected time between two begin impl frame calls. |
716 base::TimeDelta begin_impl_frame_interval_; | 712 base::TimeDelta begin_impl_frame_interval_; |
717 | 713 |
718 scoped_ptr<AnimationRegistrar> animation_registrar_; | 714 scoped_ptr<AnimationRegistrar> animation_registrar_; |
| 715 std::set<ScrollbarAnimationController*> scrollbar_animation_controllers_; |
719 | 716 |
720 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 717 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
721 MicroBenchmarkControllerImpl micro_benchmark_controller_; | 718 MicroBenchmarkControllerImpl micro_benchmark_controller_; |
722 scoped_ptr<TaskGraphRunner> single_thread_synchronous_task_graph_runner_; | 719 scoped_ptr<TaskGraphRunner> single_thread_synchronous_task_graph_runner_; |
723 | 720 |
724 // Optional callback to notify of new tree activations. | 721 // Optional callback to notify of new tree activations. |
725 base::Closure tree_activation_callback_; | 722 base::Closure tree_activation_callback_; |
726 | 723 |
727 SharedBitmapManager* shared_bitmap_manager_; | 724 SharedBitmapManager* shared_bitmap_manager_; |
728 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; | 725 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
729 int id_; | 726 int id_; |
730 | 727 |
731 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 728 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
732 std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; | 729 std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; |
733 | 730 |
734 bool requires_high_res_to_draw_; | 731 bool requires_high_res_to_draw_; |
735 bool is_likely_to_require_a_draw_; | 732 bool is_likely_to_require_a_draw_; |
736 | 733 |
737 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; | 734 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; |
738 | 735 |
739 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 736 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
740 }; | 737 }; |
741 | 738 |
742 } // namespace cc | 739 } // namespace cc |
743 | 740 |
744 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 741 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |