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

Unified Diff: cc/surfaces/display.cc

Issue 2854163003: [cc] Plumb BeginFrameAcks through SurfaceManager to DisplayScheduler. (Closed)
Patch Set: track state in DisplayScheduler rather than 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..198fe3024fc9b921ae591df93e6122d60b1567c7 100644
--- a/cc/surfaces/display.cc
+++ b/cc/surfaces/display.cc
@@ -61,6 +61,7 @@ Display::Display(SharedBitmapManager* bitmap_manager,
Display::~Display() {
// Only do this if Initialize() happened.
if (client_) {
+ scheduler_->SetSurfaceManager(nullptr);
if (auto* context = output_surface_->context_provider())
context->SetLostContextCallback(base::Closure());
if (begin_frame_source_)
@@ -95,6 +96,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 +372,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();
@@ -410,7 +420,26 @@ void Display::OnSurfaceDamaged(const SurfaceId& surface_id, bool* changed) {
UpdateRootSurfaceResourcesLocked();
}
-void Display::OnSurfaceCreated(const SurfaceInfo& surface_info) {}
+void Display::OnSurfaceCreated(const SurfaceInfo& surface_info) {
+ if (scheduler_)
+ scheduler_->SurfaceCreated(surface_info);
+}
+
+void Display::OnSurfaceDestroyed(const SurfaceId& surface_id) {
+ if (scheduler_)
+ scheduler_->SurfaceDestroyed(surface_id);
+}
+
+void Display::OnSurfaceReceivedBeginFrame(const SurfaceId& surface_id,
+ const BeginFrameArgs& args) {
+ if (scheduler_)
+ scheduler_->SurfaceReceivedBeginFrame(surface_id, args);
+}
+void Display::OnSurfaceFinishedBeginFrame(const SurfaceId& surface_id,
+ const BeginFrameAck& ack) {
+ if (scheduler_)
+ scheduler_->SurfaceFinishedBeginFrame(surface_id, ack);
+}
const SurfaceId& Display::CurrentSurfaceId() {
return current_surface_id_;

Powered by Google App Engine
This is Rietveld 408576698