Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(868)

Side by Side Diff: cc/trees/layer_tree_host_impl.h

Issue 2278283003: Refactor client visibility handling (Closed)
Patch Set: more fixes Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/test/test_in_process_context_provider.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 void NotifySwapPromiseMonitorsOfSetNeedsRedraw(); 707 void NotifySwapPromiseMonitorsOfSetNeedsRedraw();
707 void NotifySwapPromiseMonitorsOfForwardingToMainThread(); 708 void NotifySwapPromiseMonitorsOfForwardingToMainThread();
708 709
709 void UpdateRootLayerStateForSynchronousInputHandler(); 710 void UpdateRootLayerStateForSynchronousInputHandler();
710 711
711 void ScrollAnimationAbort(LayerImpl* layer_impl); 712 void ScrollAnimationAbort(LayerImpl* layer_impl);
712 713
713 bool ScrollAnimationUpdateTarget(ScrollNode* scroll_node, 714 bool ScrollAnimationUpdateTarget(ScrollNode* scroll_node,
714 const gfx::Vector2dF& scroll_delta); 715 const gfx::Vector2dF& scroll_delta);
715 716
717 void SetCompositorContextVisibility(bool is_visible);
718 void SetWorkerContextVisibility(bool is_visible);
719
716 using UIResourceMap = std::unordered_map<UIResourceId, UIResourceData>; 720 using UIResourceMap = std::unordered_map<UIResourceId, UIResourceData>;
717 UIResourceMap ui_resource_map_; 721 UIResourceMap ui_resource_map_;
718 722
719 // Resources that were evicted by EvictAllUIResources. Resources are removed 723 // Resources that were evicted by EvictAllUIResources. Resources are removed
720 // 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
721 // request queue. 725 // request queue.
722 std::set<UIResourceId> evicted_ui_resources_; 726 std::set<UIResourceId> evicted_ui_resources_;
723 727
724 OutputSurface* output_surface_; 728 OutputSurface* output_surface_;
725 729
730 // The following scoped variables must not outlive the |output_surface_|.
731 // These should be transfered to ContextCacheController's
732 // ClientBecameNotVisible() before the output surface is destroyed.
733 std::unique_ptr<ContextCacheController::ScopedVisibility>
734 compositor_context_visibility_;
735 std::unique_ptr<ContextCacheController::ScopedVisibility>
736 worker_context_visibility_;
737
726 std::unique_ptr<ResourceProvider> resource_provider_; 738 std::unique_ptr<ResourceProvider> resource_provider_;
727 bool need_update_gpu_rasterization_status_; 739 bool need_update_gpu_rasterization_status_;
728 bool content_is_suitable_for_gpu_rasterization_; 740 bool content_is_suitable_for_gpu_rasterization_;
729 bool has_gpu_rasterization_trigger_; 741 bool has_gpu_rasterization_trigger_;
730 bool use_gpu_rasterization_; 742 bool use_gpu_rasterization_;
731 bool use_msaa_; 743 bool use_msaa_;
732 GpuRasterizationStatus gpu_rasterization_status_; 744 GpuRasterizationStatus gpu_rasterization_status_;
733 std::unique_ptr<RasterBufferProvider> raster_buffer_provider_; 745 std::unique_ptr<RasterBufferProvider> raster_buffer_provider_;
734 std::unique_ptr<TileTaskManager> tile_task_manager_; 746 std::unique_ptr<TileTaskManager> tile_task_manager_;
735 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
841 853
842 std::unique_ptr<PendingTreeDurationHistogramTimer> 854 std::unique_ptr<PendingTreeDurationHistogramTimer>
843 pending_tree_duration_timer_; 855 pending_tree_duration_timer_;
844 856
845 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); 857 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl);
846 }; 858 };
847 859
848 } // namespace cc 860 } // namespace cc
849 861
850 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ 862 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « cc/test/test_in_process_context_provider.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698