Index: cc/surfaces/display.cc |
diff --git a/cc/surfaces/display.cc b/cc/surfaces/display.cc |
index dd776fb1bc4d118408d8557c20a7b2eefc75389b..14afd863de7c8858e7db473264c279843768ebf5 100644 |
--- a/cc/surfaces/display.cc |
+++ b/cc/surfaces/display.cc |
@@ -131,8 +131,8 @@ void Display::InitializeRenderer() { |
// overlays. |
bool output_partial_list = renderer_->Capabilities().using_partial_swap && |
!output_surface_->GetOverlayCandidateValidator(); |
- aggregator_.reset(new SurfaceAggregator(manager_, resource_provider_.get(), |
- output_partial_list)); |
+ aggregator_.reset(new SurfaceAggregator( |
+ this, manager_, resource_provider_.get(), output_partial_list)); |
} |
void Display::DidLoseOutputSurface() { |
@@ -150,6 +150,33 @@ void Display::UpdateRootSurfaceResourcesLocked() { |
scheduler_->SetRootSurfaceResourcesLocked(root_surface_resources_locked); |
} |
+void Display::AddSurface(Surface* surface) { |
+ // Checking for the output_surface ensures Display::Initialize has been |
+ // called and that scheduler_ won't change its value. |
+ DCHECK(output_surface_); |
+ |
+ // TODO(brianderson): Make sure all users of Display provide a |
+ // DisplayScheduler. crbug.com/476676 |
mithro-old
2015/10/01 03:00:23
nit: Can you put http:// before this URL so it bec
brianderson
2015/10/07 20:54:48
Done.
|
+ if (!scheduler_) |
+ return; |
+ |
+ surface->AddBeginFrameSource(scheduler_->begin_frame_source_for_children()); |
+} |
+ |
+void Display::RemoveSurface(Surface* surface) { |
+ // Checking for the output_surface ensures Display::Initialize has been |
+ // called and that scheduler_ won't change its value. |
+ DCHECK(output_surface_); |
+ |
+ // TODO(brianderson): Make sure all users of Display provide a |
+ // DisplayScheduler. crbug.com/476676 |
+ if (!scheduler_) |
+ return; |
+ |
+ surface->RemoveBeginFrameSource( |
+ scheduler_->begin_frame_source_for_children()); |
+} |
+ |
bool Display::DrawAndSwap() { |
TRACE_EVENT0("cc", "Display::DrawAndSwap"); |