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

Unified Diff: cc/surfaces/surface.h

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.h
diff --git a/cc/surfaces/surface.h b/cc/surfaces/surface.h
index 403d2e56baf6f8a575509050152fb4bc90bccbc8..ca4626f16413c223ed1485b3e459f81b6b325d6b 100644
--- a/cc/surfaces/surface.h
+++ b/cc/surfaces/surface.h
@@ -5,6 +5,7 @@
#ifndef CC_SURFACES_SURFACE_H_
#define CC_SURFACES_SURFACE_H_
+#include "base/callback_forward.h"
#include "base/containers/hash_tables.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
@@ -30,6 +31,9 @@ class CC_SURFACES_EXPORT Surface {
// Returns the most recent frame that is eligible to be rendered.
const CompositorFrame* GetEligibleFrame();
+ void AddDrawCallback(const base::Closure& closure);
+ void RunDrawCallbacks();
+
SurfaceFactory* factory() { return factory_; }
private:
@@ -39,6 +43,8 @@ class CC_SURFACES_EXPORT Surface {
// TODO(jamesr): Support multiple frames in flight.
scoped_ptr<CompositorFrame> current_frame_;
+ std::vector<base::Closure> draw_callbacks_;
jamesr 2014/08/22 06:00:12 a surface can only have one active frame at any po
+
DISALLOW_COPY_AND_ASSIGN(Surface);
};
« no previous file with comments | « cc/surfaces/display.cc ('k') | cc/surfaces/surface.cc » ('j') | cc/surfaces/surface.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698