diff options
author | jbauman <jbauman@chromium.org> | 2014-08-23 15:10:23 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-08-23 22:11:22 +0000 |
commit | 878e9535344a864efec4c5137e3b1363f911f378 (patch) | |
tree | db49794dd511d715d608144356c06c6d19a8faa7 /cc/surfaces/surface_factory.h | |
parent | ef468cde5048721e27faa4265f70f2fd0e424618 (diff) | |
download | chromium_src-878e9535344a864efec4c5137e3b1363f911f378.zip chromium_src-878e9535344a864efec4c5137e3b1363f911f378.tar.gz chromium_src-878e9535344a864efec4c5137e3b1363f911f378.tar.bz2 |
Add callback when queueing frame on Surface to create backpressure.
When a frame is queued on a surface, a callback can queued that will be called when that surface is used to draw a frame. This can be used to create backpressure on renderers or the browser compositor.
BUG=
Review URL: https://codereview.chromium.org/465673003
Cr-Commit-Position: refs/heads/master@{#291605}
Diffstat (limited to 'cc/surfaces/surface_factory.h')
-rw-r--r-- | cc/surfaces/surface_factory.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cc/surfaces/surface_factory.h b/cc/surfaces/surface_factory.h index c74f973..fafa53c54 100644 --- a/cc/surfaces/surface_factory.h +++ b/cc/surfaces/surface_factory.h @@ -5,6 +5,7 @@ #ifndef CC_SURFACES_SURFACE_FACTORY_H_ #define CC_SURFACES_SURFACE_FACTORY_H_ +#include "base/callback_forward.h" #include "base/containers/scoped_ptr_hash_map.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" @@ -37,7 +38,10 @@ class CC_SURFACES_EXPORT SurfaceFactory void Destroy(SurfaceId surface_id); // A frame can only be submitted to a surface created by this factory, // although the frame may reference surfaces created by other factories. - void SubmitFrame(SurfaceId surface_id, scoped_ptr<CompositorFrame> frame); + // The callback is called the first time this frame is used to draw. + void SubmitFrame(SurfaceId surface_id, + scoped_ptr<CompositorFrame> frame, + const base::Closure& callback); SurfaceFactoryClient* client() { return client_; } |