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

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

Issue 2278283003: Refactor client visibility handling (Closed)
Patch Set: feedback 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
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 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 ContextCacheController's
731 // ClientBecameNotVisible() before the output surface is destroyed.
732 std::unique_ptr<ContextCacheController::ScopedVisibility>
733 main_context_visibility_;
734 std::unique_ptr<ContextCacheController::ScopedVisibility>
735 worker_context_visibility_;
736
725 std::unique_ptr<ResourceProvider> resource_provider_; 737 std::unique_ptr<ResourceProvider> resource_provider_;
726 bool need_update_gpu_rasterization_status_; 738 bool need_update_gpu_rasterization_status_;
727 bool content_is_suitable_for_gpu_rasterization_; 739 bool content_is_suitable_for_gpu_rasterization_;
728 bool has_gpu_rasterization_trigger_; 740 bool has_gpu_rasterization_trigger_;
729 bool use_gpu_rasterization_; 741 bool use_gpu_rasterization_;
730 bool use_msaa_; 742 bool use_msaa_;
731 GpuRasterizationStatus gpu_rasterization_status_; 743 GpuRasterizationStatus gpu_rasterization_status_;
732 std::unique_ptr<RasterBufferProvider> raster_buffer_provider_; 744 std::unique_ptr<RasterBufferProvider> raster_buffer_provider_;
733 std::unique_ptr<TileTaskManager> tile_task_manager_; 745 std::unique_ptr<TileTaskManager> tile_task_manager_;
734 std::unique_ptr<ResourcePool> resource_pool_; 746 std::unique_ptr<ResourcePool> resource_pool_;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 852
841 std::unique_ptr<PendingTreeDurationHistogramTimer> 853 std::unique_ptr<PendingTreeDurationHistogramTimer>
842 pending_tree_duration_timer_; 854 pending_tree_duration_timer_;
843 855
844 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); 856 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl);
845 }; 857 };
846 858
847 } // namespace cc 859 } // namespace cc
848 860
849 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ 861 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698