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

Unified Diff: cc/surfaces/surface_factory.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_factory.cc
diff --git a/cc/surfaces/surface_factory.cc b/cc/surfaces/surface_factory.cc
index d17e98ecad71cfc138dde54be8ee9e48ecf4e1d5..a6478954608d09e40c7550f00ec84e4a4ec9c117 100644
--- a/cc/surfaces/surface_factory.cc
+++ b/cc/surfaces/surface_factory.cc
@@ -35,11 +35,14 @@ void SurfaceFactory::Destroy(SurfaceId surface_id) {
}
void SurfaceFactory::SubmitFrame(SurfaceId surface_id,
- scoped_ptr<CompositorFrame> frame) {
+ scoped_ptr<CompositorFrame> frame,
+ const base::Closure& callback) {
OwningSurfaceMap::iterator it = surface_map_.find(surface_id);
DCHECK(it != surface_map_.end());
DCHECK(it->second->factory() == this);
it->second->QueueFrame(frame.Pass());
+ if (!callback.is_null())
jamesr 2014/08/22 06:00:12 can we instead just pass this as a parameter to Qu
+ it->second->AddDrawCallback(callback);
manager_->SurfaceModified(surface_id);
}

Powered by Google App Engine
This is Rietveld 408576698