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

Unified Diff: cc/surfaces/display.cc

Issue 1304063014: cc: Plumbing for BeginFrameSource based on Surfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: SurfaceAggregator tests; fix some bugs revealed by tests Created 5 years, 3 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 329575fe4406dd4975fc04bf13c71d20d580e258..79acc399ad29eff68d000bdfad0c5ee925a2f562 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,17 @@ void Display::UpdateRootSurfaceResourcesLocked() {
scheduler_->SetRootSurfaceResourcesLocked(root_surface_resources_locked);
}
+void Display::AddSurface(Surface* surface) {
+ DCHECK(scheduler_);
+ surface->AddBeginFrameSource(scheduler_->begin_frame_source_for_children());
+}
+
+void Display::RemoveSurface(Surface* surface) {
+ DCHECK(scheduler_);
+ surface->RemoveBeginFrameSource(
+ scheduler_->begin_frame_source_for_children());
+}
+
bool Display::DrawAndSwap() {
TRACE_EVENT0("cc", "Display::DrawAndSwap");

Powered by Google App Engine
This is Rietveld 408576698