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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 void SetLayerTransformMutated(int layer_id, | 258 void SetLayerTransformMutated(int layer_id, |
259 LayerTreeType tree_type, | 259 LayerTreeType tree_type, |
260 const gfx::Transform& transform) override; | 260 const gfx::Transform& transform) override; |
261 void SetLayerScrollOffsetMutated( | 261 void SetLayerScrollOffsetMutated( |
262 int layer_id, | 262 int layer_id, |
263 LayerTreeType tree_type, | 263 LayerTreeType tree_type, |
264 const gfx::ScrollOffset& scroll_offset) override; | 264 const gfx::ScrollOffset& scroll_offset) override; |
265 void ScrollOffsetAnimationFinished() override; | 265 void ScrollOffsetAnimationFinished() override; |
266 gfx::ScrollOffset GetScrollOffsetForAnimation(int layer_id) const override; | 266 gfx::ScrollOffset GetScrollOffsetForAnimation(int layer_id) const override; |
267 | 267 |
268 virtual void PrepareTiles(); | 268 virtual bool PrepareTiles(); |
269 | 269 |
270 // Returns DRAW_SUCCESS unless problems occured preparing the frame, and we | 270 // Returns DRAW_SUCCESS unless problems occured preparing the frame, and we |
271 // should try to avoid displaying the frame. If PrepareToDraw is called, | 271 // should try to avoid displaying the frame. If PrepareToDraw is called, |
272 // DidDrawAllLayers must also be called, regardless of whether DrawLayers is | 272 // DidDrawAllLayers must also be called, regardless of whether DrawLayers is |
273 // called between the two. | 273 // called between the two. |
274 virtual DrawResult PrepareToDraw(FrameData* frame); | 274 virtual DrawResult PrepareToDraw(FrameData* frame); |
275 virtual void DrawLayers(FrameData* frame); | 275 virtual void DrawLayers(FrameData* frame); |
276 // Must be called if and only if PrepareToDraw was called. | 276 // Must be called if and only if PrepareToDraw was called. |
277 void DidDrawAllLayers(const FrameData& frame); | 277 void DidDrawAllLayers(const FrameData& frame); |
278 | 278 |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 | 610 |
611 BeginFrameTracker current_begin_frame_tracker_; | 611 BeginFrameTracker current_begin_frame_tracker_; |
612 | 612 |
613 private: | 613 private: |
614 gfx::Vector2dF ScrollLayerWithViewportSpaceDelta( | 614 gfx::Vector2dF ScrollLayerWithViewportSpaceDelta( |
615 LayerImpl* layer_impl, | 615 LayerImpl* layer_impl, |
616 const gfx::PointF& viewport_point, | 616 const gfx::PointF& viewport_point, |
617 const gfx::Vector2dF& viewport_delta); | 617 const gfx::Vector2dF& viewport_delta); |
618 | 618 |
619 void CreateAndSetRenderer(); | 619 void CreateAndSetRenderer(); |
620 void CreateAndSetTileManager(); | 620 void CleanUpTileManager(); |
621 void DestroyTileManager(); | 621 void CreateTileManagerResources(); |
622 void ReleaseTreeResources(); | 622 void ReleaseTreeResources(); |
623 void RecreateTreeResources(); | 623 void RecreateTreeResources(); |
624 | 624 |
625 void UpdateGpuRasterizationStatus(); | 625 void UpdateGpuRasterizationStatus(); |
626 | 626 |
627 bool IsSynchronousSingleThreaded() const; | 627 bool IsSynchronousSingleThreaded() const; |
628 | 628 |
629 Viewport* viewport() { return viewport_.get(); } | 629 Viewport* viewport() { return viewport_.get(); } |
630 | 630 |
631 // Scroll by preferring to move the outer viewport first, only moving the | 631 // Scroll by preferring to move the outer viewport first, only moving the |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 UIResourceMap ui_resource_map_; | 693 UIResourceMap ui_resource_map_; |
694 | 694 |
695 // Resources that were evicted by EvictAllUIResources. Resources are removed | 695 // Resources that were evicted by EvictAllUIResources. Resources are removed |
696 // from this when they are touched by a create or destroy from the UI resource | 696 // from this when they are touched by a create or destroy from the UI resource |
697 // request queue. | 697 // request queue. |
698 std::set<UIResourceId> evicted_ui_resources_; | 698 std::set<UIResourceId> evicted_ui_resources_; |
699 | 699 |
700 scoped_ptr<OutputSurface> output_surface_; | 700 scoped_ptr<OutputSurface> output_surface_; |
701 | 701 |
702 scoped_ptr<ResourceProvider> resource_provider_; | 702 scoped_ptr<ResourceProvider> resource_provider_; |
703 scoped_ptr<TileManager> tile_manager_; | |
704 bool content_is_suitable_for_gpu_rasterization_; | 703 bool content_is_suitable_for_gpu_rasterization_; |
705 bool has_gpu_rasterization_trigger_; | 704 bool has_gpu_rasterization_trigger_; |
706 bool use_gpu_rasterization_; | 705 bool use_gpu_rasterization_; |
707 bool use_msaa_; | 706 bool use_msaa_; |
708 GpuRasterizationStatus gpu_rasterization_status_; | 707 GpuRasterizationStatus gpu_rasterization_status_; |
709 bool tree_resources_for_gpu_rasterization_dirty_; | 708 bool tree_resources_for_gpu_rasterization_dirty_; |
710 scoped_ptr<TileTaskWorkerPool> tile_task_worker_pool_; | 709 scoped_ptr<TileTaskWorkerPool> tile_task_worker_pool_; |
711 scoped_ptr<ResourcePool> resource_pool_; | 710 scoped_ptr<ResourcePool> resource_pool_; |
712 scoped_ptr<ResourcePool> staging_resource_pool_; | 711 scoped_ptr<ResourcePool> staging_resource_pool_; |
713 scoped_ptr<Renderer> renderer_; | 712 scoped_ptr<Renderer> renderer_; |
(...skipping 27 matching lines...) Expand all Loading... |
741 | 740 |
742 // The optional delegate for the root layer scroll offset. | 741 // The optional delegate for the root layer scroll offset. |
743 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; | 742 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; |
744 LayerScrollOffsetDelegate::AnimationCallback root_layer_animation_callback_; | 743 LayerScrollOffsetDelegate::AnimationCallback root_layer_animation_callback_; |
745 | 744 |
746 const LayerTreeSettings settings_; | 745 const LayerTreeSettings settings_; |
747 LayerTreeDebugState debug_state_; | 746 LayerTreeDebugState debug_state_; |
748 bool visible_; | 747 bool visible_; |
749 ManagedMemoryPolicy cached_managed_memory_policy_; | 748 ManagedMemoryPolicy cached_managed_memory_policy_; |
750 | 749 |
| 750 scoped_ptr<TileManager> tile_manager_; |
| 751 |
751 gfx::Vector2dF accumulated_root_overscroll_; | 752 gfx::Vector2dF accumulated_root_overscroll_; |
752 | 753 |
753 bool pinch_gesture_active_; | 754 bool pinch_gesture_active_; |
754 bool pinch_gesture_end_should_clear_scrolling_layer_; | 755 bool pinch_gesture_end_should_clear_scrolling_layer_; |
755 | 756 |
756 scoped_ptr<TopControlsManager> top_controls_manager_; | 757 scoped_ptr<TopControlsManager> top_controls_manager_; |
757 | 758 |
758 scoped_ptr<PageScaleAnimation> page_scale_animation_; | 759 scoped_ptr<PageScaleAnimation> page_scale_animation_; |
759 | 760 |
760 scoped_ptr<FrameRateCounter> fps_counter_; | 761 scoped_ptr<FrameRateCounter> fps_counter_; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; | 819 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; |
819 | 820 |
820 scoped_ptr<Viewport> viewport_; | 821 scoped_ptr<Viewport> viewport_; |
821 | 822 |
822 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 823 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
823 }; | 824 }; |
824 | 825 |
825 } // namespace cc | 826 } // namespace cc |
826 | 827 |
827 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 828 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |