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

Unified Diff: cc/surfaces/display.cc

Issue 2854163003: [cc] Plumb BeginFrameAcks through SurfaceManager to DisplayScheduler. (Closed)
Patch Set: Track state per surface. 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
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_;
}

Powered by Google App Engine
This is Rietveld 408576698