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

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
« no previous file with comments | « cc/surfaces/display.cc ('k') | cc/surfaces/surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface.h
diff --git a/cc/surfaces/surface.h b/cc/surfaces/surface.h
index 403d2e56baf6f8a575509050152fb4bc90bccbc8..c76530b84699022095357268c2955b00809e2f1d 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.h"
#include "base/containers/hash_tables.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
@@ -26,10 +27,13 @@ class CC_SURFACES_EXPORT Surface {
const gfx::Size& size() const { return size_; }
SurfaceId surface_id() const { return surface_id_; }
- void QueueFrame(scoped_ptr<CompositorFrame> frame);
+ void QueueFrame(scoped_ptr<CompositorFrame> frame,
+ const base::Closure& draw_callback);
// Returns the most recent frame that is eligible to be rendered.
const CompositorFrame* GetEligibleFrame();
+ 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_;
+ base::Closure draw_callback_;
+
DISALLOW_COPY_AND_ASSIGN(Surface);
};
« no previous file with comments | « cc/surfaces/display.cc ('k') | cc/surfaces/surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698