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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <bitset> | 10 #include <bitset> |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 OutputSurface* output_surface() const { return output_surface_; } | 396 OutputSurface* output_surface() const { return output_surface_; } |
397 void ReleaseOutputSurface(); | 397 void ReleaseOutputSurface(); |
398 | 398 |
399 std::string LayerTreeAsJson() const; | 399 std::string LayerTreeAsJson() const; |
400 | 400 |
401 int RequestedMSAASampleCount() const; | 401 int RequestedMSAASampleCount() const; |
402 | 402 |
403 virtual bool InitializeRenderer(OutputSurface* output_surface); | 403 virtual bool InitializeRenderer(OutputSurface* output_surface); |
404 TileManager* tile_manager() { return &tile_manager_; } | 404 TileManager* tile_manager() { return &tile_manager_; } |
405 | 405 |
406 void SetHasGpuRasterizationTrigger(bool flag) { | 406 void SetHasGpuRasterizationTrigger(bool flag); |
407 has_gpu_rasterization_trigger_ = flag; | 407 void SetContentIsSuitableForGpuRasterization(bool flag); |
408 UpdateGpuRasterizationStatus(); | |
409 } | |
410 void SetContentIsSuitableForGpuRasterization(bool flag) { | |
411 content_is_suitable_for_gpu_rasterization_ = flag; | |
412 UpdateGpuRasterizationStatus(); | |
413 } | |
414 bool CanUseGpuRasterization(); | 408 bool CanUseGpuRasterization(); |
415 void UpdateTreeResourcesForGpuRasterizationIfNeeded(); | |
416 bool use_gpu_rasterization() const { return use_gpu_rasterization_; } | 409 bool use_gpu_rasterization() const { return use_gpu_rasterization_; } |
417 bool use_msaa() const { return use_msaa_; } | 410 bool use_msaa() const { return use_msaa_; } |
418 | 411 |
419 GpuRasterizationStatus gpu_rasterization_status() const { | 412 GpuRasterizationStatus gpu_rasterization_status() const { |
420 return gpu_rasterization_status_; | 413 return gpu_rasterization_status_; |
421 } | 414 } |
422 | 415 |
423 bool create_low_res_tiling() const { | 416 bool create_low_res_tiling() const { |
424 return settings_.create_low_res_tiling && !use_gpu_rasterization_; | 417 return settings_.create_low_res_tiling && !use_gpu_rasterization_; |
425 } | 418 } |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 ScrollTree* scroll_tree); | 643 ScrollTree* scroll_tree); |
651 | 644 |
652 void CreateAndSetRenderer(); | 645 void CreateAndSetRenderer(); |
653 void CleanUpTileManagerAndUIResources(); | 646 void CleanUpTileManagerAndUIResources(); |
654 void CreateTileManagerResources(); | 647 void CreateTileManagerResources(); |
655 void ReleaseTreeResources(); | 648 void ReleaseTreeResources(); |
656 void RecreateTreeResources(); | 649 void RecreateTreeResources(); |
657 | 650 |
658 void AnimateInternal(bool active_tree); | 651 void AnimateInternal(bool active_tree); |
659 | 652 |
660 void UpdateGpuRasterizationStatus(); | 653 // Returns true if status changed. |
| 654 bool UpdateGpuRasterizationStatus(); |
| 655 void UpdateTreeResourcesForGpuRasterizationIfNeeded(); |
661 | 656 |
662 Viewport* viewport() { return viewport_.get(); } | 657 Viewport* viewport() { return viewport_.get(); } |
663 | 658 |
664 // Scroll by preferring to move the outer viewport first, only moving the | 659 // Scroll by preferring to move the outer viewport first, only moving the |
665 // inner if the outer is at its scroll extents. | 660 // inner if the outer is at its scroll extents. |
666 void ScrollViewportBy(gfx::Vector2dF scroll_delta); | 661 void ScrollViewportBy(gfx::Vector2dF scroll_delta); |
667 // Scroll by preferring to move the inner viewport first, only moving the | 662 // Scroll by preferring to move the inner viewport first, only moving the |
668 // outer if the inner is at its scroll extents. | 663 // outer if the inner is at its scroll extents. |
669 void ScrollViewportInnerFirst(gfx::Vector2dF scroll_delta); | 664 void ScrollViewportInnerFirst(gfx::Vector2dF scroll_delta); |
670 | 665 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 UIResourceMap ui_resource_map_; | 715 UIResourceMap ui_resource_map_; |
721 | 716 |
722 // Resources that were evicted by EvictAllUIResources. Resources are removed | 717 // Resources that were evicted by EvictAllUIResources. Resources are removed |
723 // from this when they are touched by a create or destroy from the UI resource | 718 // from this when they are touched by a create or destroy from the UI resource |
724 // request queue. | 719 // request queue. |
725 std::set<UIResourceId> evicted_ui_resources_; | 720 std::set<UIResourceId> evicted_ui_resources_; |
726 | 721 |
727 OutputSurface* output_surface_; | 722 OutputSurface* output_surface_; |
728 | 723 |
729 std::unique_ptr<ResourceProvider> resource_provider_; | 724 std::unique_ptr<ResourceProvider> resource_provider_; |
| 725 bool need_update_gpu_rasterization_status_; |
730 bool content_is_suitable_for_gpu_rasterization_; | 726 bool content_is_suitable_for_gpu_rasterization_; |
731 bool has_gpu_rasterization_trigger_; | 727 bool has_gpu_rasterization_trigger_; |
732 bool use_gpu_rasterization_; | 728 bool use_gpu_rasterization_; |
733 bool use_msaa_; | 729 bool use_msaa_; |
734 GpuRasterizationStatus gpu_rasterization_status_; | 730 GpuRasterizationStatus gpu_rasterization_status_; |
735 bool tree_resources_for_gpu_rasterization_dirty_; | |
736 std::unique_ptr<RasterBufferProvider> raster_buffer_provider_; | 731 std::unique_ptr<RasterBufferProvider> raster_buffer_provider_; |
737 std::unique_ptr<TileTaskManager> tile_task_manager_; | 732 std::unique_ptr<TileTaskManager> tile_task_manager_; |
738 std::unique_ptr<ResourcePool> resource_pool_; | 733 std::unique_ptr<ResourcePool> resource_pool_; |
739 std::unique_ptr<DelegatingRenderer> renderer_; | 734 std::unique_ptr<DelegatingRenderer> renderer_; |
740 std::unique_ptr<ImageDecodeController> image_decode_controller_; | 735 std::unique_ptr<ImageDecodeController> image_decode_controller_; |
741 | 736 |
742 GlobalStateThatImpactsTilePriority global_tile_state_; | 737 GlobalStateThatImpactsTilePriority global_tile_state_; |
743 | 738 |
744 // Tree currently being drawn. | 739 // Tree currently being drawn. |
745 std::unique_ptr<LayerTreeImpl> active_tree_; | 740 std::unique_ptr<LayerTreeImpl> active_tree_; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 | 839 |
845 std::unique_ptr<PendingTreeDurationHistogramTimer> | 840 std::unique_ptr<PendingTreeDurationHistogramTimer> |
846 pending_tree_duration_timer_; | 841 pending_tree_duration_timer_; |
847 | 842 |
848 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 843 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
849 }; | 844 }; |
850 | 845 |
851 } // namespace cc | 846 } // namespace cc |
852 | 847 |
853 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 848 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |