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> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <set> | 12 #include <set> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <unordered_map> | 14 #include <unordered_map> |
| 15 #include <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 #include "base/callback.h" | 17 #include "base/callback.h" |
| 18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
| 20 #include "cc/animation/layer_tree_mutator.h" | 20 #include "cc/animation/layer_tree_mutator.h" |
| 21 #include "cc/base/cc_export.h" | 21 #include "cc/base/cc_export.h" |
| 22 #include "cc/base/synced_property.h" | 22 #include "cc/base/synced_property.h" |
| 23 #include "cc/debug/micro_benchmark_controller_impl.h" | 23 #include "cc/debug/micro_benchmark_controller_impl.h" |
| 24 #include "cc/input/input_handler.h" | 24 #include "cc/input/input_handler.h" |
| 25 #include "cc/input/scrollbar_animation_controller.h" | 25 #include "cc/input/scrollbar_animation_controller.h" |
| 26 #include "cc/input/top_controls_manager_client.h" | 26 #include "cc/input/top_controls_manager_client.h" |
| 27 #include "cc/layers/layer_collections.h" | 27 #include "cc/layers/layer_collections.h" |
| 28 #include "cc/layers/render_pass_sink.h" | 28 #include "cc/layers/render_pass_sink.h" |
| 29 #include "cc/output/begin_frame_args.h" | 29 #include "cc/output/begin_frame_args.h" |
| 30 #include "cc/output/context_cache_controller.h" | |
| 30 #include "cc/output/delegating_renderer.h" | 31 #include "cc/output/delegating_renderer.h" |
| 31 #include "cc/output/managed_memory_policy.h" | 32 #include "cc/output/managed_memory_policy.h" |
| 32 #include "cc/output/output_surface_client.h" | 33 #include "cc/output/output_surface_client.h" |
| 33 #include "cc/quads/render_pass.h" | 34 #include "cc/quads/render_pass.h" |
| 34 #include "cc/resources/resource_provider.h" | 35 #include "cc/resources/resource_provider.h" |
| 35 #include "cc/resources/ui_resource_client.h" | 36 #include "cc/resources/ui_resource_client.h" |
| 36 #include "cc/scheduler/begin_frame_tracker.h" | 37 #include "cc/scheduler/begin_frame_tracker.h" |
| 37 #include "cc/scheduler/commit_earlyout_reason.h" | 38 #include "cc/scheduler/commit_earlyout_reason.h" |
| 38 #include "cc/scheduler/draw_result.h" | 39 #include "cc/scheduler/draw_result.h" |
| 39 #include "cc/scheduler/video_frame_controller.h" | 40 #include "cc/scheduler/video_frame_controller.h" |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 705 void NotifySwapPromiseMonitorsOfSetNeedsRedraw(); | 706 void NotifySwapPromiseMonitorsOfSetNeedsRedraw(); |
| 706 void NotifySwapPromiseMonitorsOfForwardingToMainThread(); | 707 void NotifySwapPromiseMonitorsOfForwardingToMainThread(); |
| 707 | 708 |
| 708 void UpdateRootLayerStateForSynchronousInputHandler(); | 709 void UpdateRootLayerStateForSynchronousInputHandler(); |
| 709 | 710 |
| 710 void ScrollAnimationAbort(LayerImpl* layer_impl); | 711 void ScrollAnimationAbort(LayerImpl* layer_impl); |
| 711 | 712 |
| 712 bool ScrollAnimationUpdateTarget(ScrollNode* scroll_node, | 713 bool ScrollAnimationUpdateTarget(ScrollNode* scroll_node, |
| 713 const gfx::Vector2dF& scroll_delta); | 714 const gfx::Vector2dF& scroll_delta); |
| 714 | 715 |
| 716 void SetMainContextVisibility(bool is_visible); | |
| 717 void SetWorkerContextVisibility(bool is_visible); | |
| 718 | |
| 715 using UIResourceMap = std::unordered_map<UIResourceId, UIResourceData>; | 719 using UIResourceMap = std::unordered_map<UIResourceId, UIResourceData>; |
| 716 UIResourceMap ui_resource_map_; | 720 UIResourceMap ui_resource_map_; |
| 717 | 721 |
| 718 // Resources that were evicted by EvictAllUIResources. Resources are removed | 722 // Resources that were evicted by EvictAllUIResources. Resources are removed |
| 719 // from this when they are touched by a create or destroy from the UI resource | 723 // from this when they are touched by a create or destroy from the UI resource |
| 720 // request queue. | 724 // request queue. |
| 721 std::set<UIResourceId> evicted_ui_resources_; | 725 std::set<UIResourceId> evicted_ui_resources_; |
| 722 | 726 |
| 723 OutputSurface* output_surface_; | 727 OutputSurface* output_surface_; |
| 724 | 728 |
| 729 // The following scoped variables must not outlive the |output_surface_|. | |
| 730 // These should be transfered to | |
| 731 // ContextCacheController::ClientBecameNotVisible | |
|
danakj
2016/08/26 23:49:09
you could say "ContextCacheController's ClientBeca
ericrk
2016/08/29 22:43:23
yup
| |
| 732 // before the output surface is destroyed. | |
| 733 std::unique_ptr<ContextCacheController::ScopedVisibility> | |
| 734 main_context_visibility_; | |
| 735 std::unique_ptr<ContextCacheController::ScopedVisibility> | |
| 736 worker_context_visibility_; | |
| 737 | |
| 725 std::unique_ptr<ResourceProvider> resource_provider_; | 738 std::unique_ptr<ResourceProvider> resource_provider_; |
| 726 bool need_update_gpu_rasterization_status_; | 739 bool need_update_gpu_rasterization_status_; |
| 727 bool content_is_suitable_for_gpu_rasterization_; | 740 bool content_is_suitable_for_gpu_rasterization_; |
| 728 bool has_gpu_rasterization_trigger_; | 741 bool has_gpu_rasterization_trigger_; |
| 729 bool use_gpu_rasterization_; | 742 bool use_gpu_rasterization_; |
| 730 bool use_msaa_; | 743 bool use_msaa_; |
| 731 GpuRasterizationStatus gpu_rasterization_status_; | 744 GpuRasterizationStatus gpu_rasterization_status_; |
| 732 std::unique_ptr<RasterBufferProvider> raster_buffer_provider_; | 745 std::unique_ptr<RasterBufferProvider> raster_buffer_provider_; |
| 733 std::unique_ptr<TileTaskManager> tile_task_manager_; | 746 std::unique_ptr<TileTaskManager> tile_task_manager_; |
| 734 std::unique_ptr<ResourcePool> resource_pool_; | 747 std::unique_ptr<ResourcePool> resource_pool_; |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 840 | 853 |
| 841 std::unique_ptr<PendingTreeDurationHistogramTimer> | 854 std::unique_ptr<PendingTreeDurationHistogramTimer> |
| 842 pending_tree_duration_timer_; | 855 pending_tree_duration_timer_; |
| 843 | 856 |
| 844 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 857 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 845 }; | 858 }; |
| 846 | 859 |
| 847 } // namespace cc | 860 } // namespace cc |
| 848 | 861 |
| 849 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 862 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |