Chromium Code Reviews| 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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 has_gpu_rasterization_trigger_ = flag; |
| 408 UpdateGpuRasterizationStatus(); | 408 need_update_gpu_rasterization_status_ = true; |
|
enne (OOO)
2016/08/17 17:48:43
Should this early out if it hasn't changed?
danakj
2016/08/17 18:16:41
Done.
| |
| 409 } | 409 } |
| 410 void SetContentIsSuitableForGpuRasterization(bool flag) { | 410 void SetContentIsSuitableForGpuRasterization(bool flag) { |
| 411 content_is_suitable_for_gpu_rasterization_ = flag; | 411 content_is_suitable_for_gpu_rasterization_ = flag; |
| 412 UpdateGpuRasterizationStatus(); | 412 need_update_gpu_rasterization_status_ = true; |
| 413 } | 413 } |
| 414 bool CanUseGpuRasterization(); | 414 bool CanUseGpuRasterization(); |
| 415 void UpdateTreeResourcesForGpuRasterizationIfNeeded(); | |
| 416 bool use_gpu_rasterization() const { return use_gpu_rasterization_; } | 415 bool use_gpu_rasterization() const { return use_gpu_rasterization_; } |
| 417 bool use_msaa() const { return use_msaa_; } | 416 bool use_msaa() const { return use_msaa_; } |
| 418 | 417 |
| 419 GpuRasterizationStatus gpu_rasterization_status() const { | 418 GpuRasterizationStatus gpu_rasterization_status() const { |
| 420 return gpu_rasterization_status_; | 419 return gpu_rasterization_status_; |
| 421 } | 420 } |
| 422 | 421 |
| 423 bool create_low_res_tiling() const { | 422 bool create_low_res_tiling() const { |
| 424 return settings_.create_low_res_tiling && !use_gpu_rasterization_; | 423 return settings_.create_low_res_tiling && !use_gpu_rasterization_; |
| 425 } | 424 } |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 650 ScrollTree* scroll_tree); | 649 ScrollTree* scroll_tree); |
| 651 | 650 |
| 652 void CreateAndSetRenderer(); | 651 void CreateAndSetRenderer(); |
| 653 void CleanUpTileManagerAndUIResources(); | 652 void CleanUpTileManagerAndUIResources(); |
| 654 void CreateTileManagerResources(); | 653 void CreateTileManagerResources(); |
| 655 void ReleaseTreeResources(); | 654 void ReleaseTreeResources(); |
| 656 void RecreateTreeResources(); | 655 void RecreateTreeResources(); |
| 657 | 656 |
| 658 void AnimateInternal(bool active_tree); | 657 void AnimateInternal(bool active_tree); |
| 659 | 658 |
| 660 void UpdateGpuRasterizationStatus(); | 659 // Returns true if status changed. |
| 660 bool UpdateGpuRasterizationStatus(); | |
| 661 void UpdateTreeResourcesForGpuRasterizationIfNeeded(); | |
| 661 | 662 |
| 662 Viewport* viewport() { return viewport_.get(); } | 663 Viewport* viewport() { return viewport_.get(); } |
| 663 | 664 |
| 664 // Scroll by preferring to move the outer viewport first, only moving the | 665 // Scroll by preferring to move the outer viewport first, only moving the |
| 665 // inner if the outer is at its scroll extents. | 666 // inner if the outer is at its scroll extents. |
| 666 void ScrollViewportBy(gfx::Vector2dF scroll_delta); | 667 void ScrollViewportBy(gfx::Vector2dF scroll_delta); |
| 667 // Scroll by preferring to move the inner viewport first, only moving the | 668 // Scroll by preferring to move the inner viewport first, only moving the |
| 668 // outer if the inner is at its scroll extents. | 669 // outer if the inner is at its scroll extents. |
| 669 void ScrollViewportInnerFirst(gfx::Vector2dF scroll_delta); | 670 void ScrollViewportInnerFirst(gfx::Vector2dF scroll_delta); |
| 670 | 671 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 720 UIResourceMap ui_resource_map_; | 721 UIResourceMap ui_resource_map_; |
| 721 | 722 |
| 722 // Resources that were evicted by EvictAllUIResources. Resources are removed | 723 // 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 | 724 // from this when they are touched by a create or destroy from the UI resource |
| 724 // request queue. | 725 // request queue. |
| 725 std::set<UIResourceId> evicted_ui_resources_; | 726 std::set<UIResourceId> evicted_ui_resources_; |
| 726 | 727 |
| 727 OutputSurface* output_surface_; | 728 OutputSurface* output_surface_; |
| 728 | 729 |
| 729 std::unique_ptr<ResourceProvider> resource_provider_; | 730 std::unique_ptr<ResourceProvider> resource_provider_; |
| 731 bool need_update_gpu_rasterization_status_; | |
| 730 bool content_is_suitable_for_gpu_rasterization_; | 732 bool content_is_suitable_for_gpu_rasterization_; |
| 731 bool has_gpu_rasterization_trigger_; | 733 bool has_gpu_rasterization_trigger_; |
| 732 bool use_gpu_rasterization_; | 734 bool use_gpu_rasterization_; |
| 733 bool use_msaa_; | 735 bool use_msaa_; |
| 734 GpuRasterizationStatus gpu_rasterization_status_; | 736 GpuRasterizationStatus gpu_rasterization_status_; |
| 735 bool tree_resources_for_gpu_rasterization_dirty_; | |
| 736 std::unique_ptr<RasterBufferProvider> raster_buffer_provider_; | 737 std::unique_ptr<RasterBufferProvider> raster_buffer_provider_; |
| 737 std::unique_ptr<TileTaskManager> tile_task_manager_; | 738 std::unique_ptr<TileTaskManager> tile_task_manager_; |
| 738 std::unique_ptr<ResourcePool> resource_pool_; | 739 std::unique_ptr<ResourcePool> resource_pool_; |
| 739 std::unique_ptr<DelegatingRenderer> renderer_; | 740 std::unique_ptr<DelegatingRenderer> renderer_; |
| 740 std::unique_ptr<ImageDecodeController> image_decode_controller_; | 741 std::unique_ptr<ImageDecodeController> image_decode_controller_; |
| 741 | 742 |
| 742 GlobalStateThatImpactsTilePriority global_tile_state_; | 743 GlobalStateThatImpactsTilePriority global_tile_state_; |
| 743 | 744 |
| 744 // Tree currently being drawn. | 745 // Tree currently being drawn. |
| 745 std::unique_ptr<LayerTreeImpl> active_tree_; | 746 std::unique_ptr<LayerTreeImpl> active_tree_; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 844 | 845 |
| 845 std::unique_ptr<PendingTreeDurationHistogramTimer> | 846 std::unique_ptr<PendingTreeDurationHistogramTimer> |
| 846 pending_tree_duration_timer_; | 847 pending_tree_duration_timer_; |
| 847 | 848 |
| 848 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 849 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 849 }; | 850 }; |
| 850 | 851 |
| 851 } // namespace cc | 852 } // namespace cc |
| 852 | 853 |
| 853 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 854 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |