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

Unified Diff: cc/surfaces/surface.cc

Issue 465673003: Add callback when queueing frame on Surface to create backpressure. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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/surface.cc
diff --git a/cc/surfaces/surface.cc b/cc/surfaces/surface.cc
index 55c7392249806d90cb8f81c1b6d030e3043b8632..16a3c297ff1870440e503944691476823e5246ce 100644
--- a/cc/surfaces/surface.cc
+++ b/cc/surfaces/surface.cc
@@ -42,4 +42,17 @@ const CompositorFrame* Surface::GetEligibleFrame() {
return current_frame_.get();
}
+void Surface::AddDrawCallback(const base::Closure& closure) {
jamesr 2014/08/22 06:00:12 nit: this is called 'callback' other places, which
+ draw_callbacks_.push_back(closure);
+}
+
+void Surface::RunDrawCallbacks() {
+ for (std::vector<base::Closure>::iterator it = draw_callbacks_.begin();
+ it != draw_callbacks_.end();
+ ++it) {
+ it->Run();
jamesr 2014/08/22 06:00:12 if one of the callbacks manipulates our callback l
+ }
+ draw_callbacks_.clear();
jamesr 2014/08/22 06:00:12 if a surface is referenced in multiple displays th
+}
+
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698