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

Unified Diff: cc/trees/layer_tree_host_impl.h

Issue 2278283003: Refactor client visibility handling (Closed)
Patch Set: fix compositor_unittests Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_host_impl.h
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h
index 6af8dd9f00fc8e75b34a4f4b0f68ad32a8dcf950..30751f7a4083b8453d2ff13d605ef39d9b214ad0 100644
--- a/cc/trees/layer_tree_host_impl.h
+++ b/cc/trees/layer_tree_host_impl.h
@@ -27,6 +27,7 @@
#include "cc/layers/layer_collections.h"
#include "cc/layers/render_pass_sink.h"
#include "cc/output/begin_frame_args.h"
+#include "cc/output/context_cache_controller.h"
#include "cc/output/delegating_renderer.h"
#include "cc/output/managed_memory_policy.h"
#include "cc/output/output_surface_client.h"
@@ -712,6 +713,9 @@ class CC_EXPORT LayerTreeHostImpl
bool ScrollAnimationUpdateTarget(ScrollNode* scroll_node,
const gfx::Vector2dF& scroll_delta);
+ void SetMainContextVisibility(bool is_visible);
+ void SetWorkerContextVisibility(bool is_visible);
+
using UIResourceMap = std::unordered_map<UIResourceId, UIResourceData>;
UIResourceMap ui_resource_map_;
@@ -722,6 +726,15 @@ class CC_EXPORT LayerTreeHostImpl
OutputSurface* output_surface_;
+ // The following scoped variables must not outlive the |output_surface_|.
+ // These should be transfered to
+ // ContextCacheController::ClientBecameNotVisible
danakj 2016/08/26 23:49:09 you could say "ContextCacheController's ClientBeca
ericrk 2016/08/29 22:43:23 yup
+ // before the output surface is destroyed.
+ std::unique_ptr<ContextCacheController::ScopedVisibility>
+ main_context_visibility_;
+ std::unique_ptr<ContextCacheController::ScopedVisibility>
+ worker_context_visibility_;
+
std::unique_ptr<ResourceProvider> resource_provider_;
bool need_update_gpu_rasterization_status_;
bool content_is_suitable_for_gpu_rasterization_;

Powered by Google App Engine
This is Rietveld 408576698