Index: cc/surfaces/surface_aggregator.cc |
diff --git a/cc/surfaces/surface_aggregator.cc b/cc/surfaces/surface_aggregator.cc |
index 69618ba8b4ca4507f77705db7fa2834e2a07e452..a81f54791db9ffd4faa01ca437a00bb84c66b5ea 100644 |
--- a/cc/surfaces/surface_aggregator.cc |
+++ b/cc/surfaces/surface_aggregator.cc |
@@ -461,8 +461,20 @@ void SurfaceAggregator::RemoveUnreferencedChildren() { |
} |
Surface* surface_ptr = manager_->GetSurfaceForId(surface.first); |
- if (surface_ptr) |
+ if (surface_ptr) { |
surface_ptr->RunDrawCallbacks(SurfaceDrawStatus::DRAW_SKIPPED); |
+ // FIXME(brianderson): Make the aggregator take the display_ object. |
+ surface_ptr->RemoveDisplay(display_); |
+ } |
+ } |
+ } |
+ |
+ for (const auto& surface : contained_surfaces_) { |
+ if (!previous_contained_surfaces_.count(surface.first)) { |
+ Surface* surface_ptr = manager_->GetSurfaceForId(surface.first); |
+ if (surface_ptr) { |
+ surface_ptr->AddDisplay(display_); |
+ } |
} |
} |
} |