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

Unified Diff: cc/surfaces/display_scheduler.cc

Issue 1155183004: cc: Properly detect when child Surfaces idle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | cc/surfaces/display_scheduler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/display_scheduler.cc
diff --git a/cc/surfaces/display_scheduler.cc b/cc/surfaces/display_scheduler.cc
index 2ae8f253a7e60266826937198c29976de1c06a57..a9eeadebd4587096dc4a17a10efe2ad391356f50 100644
--- a/cc/surfaces/display_scheduler.cc
+++ b/cc/surfaces/display_scheduler.cc
@@ -106,19 +106,20 @@ void DisplayScheduler::DrawAndSwap() {
if (!success)
return;
- needs_draw_ = false;
- entire_display_damaged_ = false;
- all_active_child_surfaces_ready_to_draw_ = false;
-
- expect_damage_from_root_surface_ = root_surface_damaged_;
- root_surface_damaged_ = false;
-
child_surface_ids_to_expect_damage_from_ =
base::STLSetIntersection<std::vector<SurfaceId>>(
child_surface_ids_damaged_, child_surface_ids_damaged_prev_);
child_surface_ids_damaged_prev_.swap(child_surface_ids_damaged_);
child_surface_ids_damaged_.clear();
+
+ needs_draw_ = false;
+ entire_display_damaged_ = false;
+ all_active_child_surfaces_ready_to_draw_ =
+ child_surface_ids_to_expect_damage_from_.empty();
+
+ expect_damage_from_root_surface_ = root_surface_damaged_;
+ root_surface_damaged_ = false;
}
bool DisplayScheduler::OnBeginFrameMixInDelegate(const BeginFrameArgs& args) {
@@ -257,6 +258,13 @@ void DisplayScheduler::AttemptDrawAndSwap() {
if (pending_swaps_ < max_pending_swaps_ && !root_surface_resources_locked_)
DrawAndSwap();
} else {
+ // We are going idle, so reset expectations.
+ child_surface_ids_to_expect_damage_from_.clear();
+ child_surface_ids_damaged_prev_.clear();
+ child_surface_ids_damaged_.clear();
+ all_active_child_surfaces_ready_to_draw_ = true;
+ expect_damage_from_root_surface_ = false;
+
begin_frame_source_->SetNeedsBeginFrames(false);
}
}
« no previous file with comments | « no previous file | cc/surfaces/display_scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698