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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 2905533002: cc : Store surface layer ids on LayerTreeHost and push them at commit (Closed)
Patch Set: initialize Created 3 years, 7 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
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 8db96130c74303927c5712016310f894d3d87349..374770987d2c4d16a3a65a21aa471a231c23a1dd 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -317,6 +317,7 @@ void LayerTreeHost::FinishCommitOnImplThread(
PushPropertyTreesTo(sync_tree);
sync_tree->lifecycle().AdvanceTo(LayerTreeLifecycle::kSyncedPropertyTrees);
+ PushSurfaceIdsTo(sync_tree);
TreeSynchronizer::PushLayerProperties(this, sync_tree);
sync_tree->lifecycle().AdvanceTo(
LayerTreeLifecycle::kSyncedLayerProperties);
@@ -1092,6 +1093,20 @@ bool LayerTreeHost::PaintContent(const LayerList& update_layer_list,
return did_paint_content;
}
+void LayerTreeHost::AddSurfaceLayerId(const SurfaceId& surface_id) {
+ surface_layer_ids_.insert(surface_id);
+ needs_surface_ids_sync_ = true;
+}
+
+void LayerTreeHost::RemoveSurfaceLayerId(const SurfaceId& surface_id) {
+ surface_layer_ids_.erase(surface_id);
+ needs_surface_ids_sync_ = true;
+}
+
+const base::flat_set<SurfaceId>& LayerTreeHost::SurfaceLayerIds() const {
+ return surface_layer_ids_;
+}
+
void LayerTreeHost::AddLayerShouldPushProperties(Layer* layer) {
layers_that_should_push_properties_.insert(layer);
}
@@ -1223,6 +1238,15 @@ void LayerTreeHost::PushLayerTreePropertiesTo(LayerTreeImpl* tree_impl) {
tree_impl->set_has_ever_been_drawn(false);
}
+void LayerTreeHost::PushSurfaceIdsTo(LayerTreeImpl* tree_impl) {
+ if (needs_surface_ids_sync()) {
+ tree_impl->ClearSurfaceLayerIds();
+ tree_impl->SetSurfaceLayerIds(SurfaceLayerIds());
+ // Reset for next update
+ set_needs_surface_ids_sync(false);
+ }
+}
+
void LayerTreeHost::PushLayerTreeHostPropertiesTo(
LayerTreeHostImpl* host_impl) {
host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_);
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698