Index: cc/surfaces/display.cc |
diff --git a/cc/surfaces/display.cc b/cc/surfaces/display.cc |
index e3693207031f15a0056d3d9600f33b45476f3d10..ad393b67bd82f2e49b0e475a6104fdbc2057b06d 100644 |
--- a/cc/surfaces/display.cc |
+++ b/cc/surfaces/display.cc |
@@ -95,6 +95,9 @@ void Display::Initialize(DisplayClient* client, |
output_surface_->BindToClient(this); |
InitializeRenderer(); |
+ if (scheduler_) |
+ scheduler_->SetSurfaceManager(surface_manager_); |
+ |
if (auto* context = output_surface_->context_provider()) { |
// This depends on assumptions that Display::Initialize will happen |
// on the same callstack as the ContextProvider being created/initialized |
@@ -368,6 +371,12 @@ bool Display::DrawAndSwap() { |
return true; |
} |
+const SurfaceAggregator::SurfaceIndexMap& |
+Display::GetPreviousContainedSurfaces() { |
+ DCHECK(aggregator_); |
+ return aggregator_->previous_contained_surfaces(); |
+} |
+ |
void Display::DidReceiveSwapBuffersAck() { |
if (scheduler_) |
scheduler_->DidReceiveSwapBuffersAck(); |
@@ -412,6 +421,17 @@ void Display::OnSurfaceDamaged(const SurfaceId& surface_id, bool* changed) { |
void Display::OnSurfaceCreated(const SurfaceInfo& surface_info) {} |
+void Display::OnSurfaceProducerStateChanged(const SurfaceId& surface_id) { |
+ if (!scheduler_) |
+ return; |
+ |
+ if ((aggregator_ && |
+ aggregator_->previous_contained_surfaces().count(surface_id)) || |
+ surface_id == current_surface_id_) { |
+ scheduler_->OnSurfaceProducerStateChanged(surface_id); |
+ } |
+} |
+ |
const SurfaceId& Display::CurrentSurfaceId() { |
return current_surface_id_; |
} |