diff options
author | jbauman <jbauman@chromium.org> | 2014-12-10 16:23:08 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-11 00:23:27 +0000 |
commit | 264491f70f7ccfadf6da80a0f443a34d81f62242 (patch) | |
tree | 483c74c413abc5e73bad7894c8e9571b60f04a51 /cc/surfaces/surface_factory.h | |
parent | f93fd5ba755727d30e0d4e82f999feb92405856d (diff) | |
download | chromium_src-264491f70f7ccfadf6da80a0f443a34d81f62242.zip chromium_src-264491f70f7ccfadf6da80a0f443a34d81f62242.tar.gz chromium_src-264491f70f7ccfadf6da80a0f443a34d81f62242.tar.bz2 |
Execute Surface draw callback when Surface is destroyed.
Also add an argument to the callback that's true if the frame was actually drawn, and false otherwise.
BUG=439931, 440827
Review URL: https://codereview.chromium.org/791903002
Cr-Commit-Position: refs/heads/master@{#307802}
Diffstat (limited to 'cc/surfaces/surface_factory.h')
-rw-r--r-- | cc/surfaces/surface_factory.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cc/surfaces/surface_factory.h b/cc/surfaces/surface_factory.h index eba32d2..7abd929 100644 --- a/cc/surfaces/surface_factory.h +++ b/cc/surfaces/surface_factory.h @@ -35,6 +35,10 @@ class SurfaceManager; class CC_SURFACES_EXPORT SurfaceFactory : public base::SupportsWeakPtr<SurfaceFactory> { public: + // This callback is called with true if the frame was drawn, or false if it + // was discarded. + using DrawCallback = base::Callback<void(bool)>; + SurfaceFactory(SurfaceManager* manager, SurfaceFactoryClient* client); ~SurfaceFactory(); @@ -43,10 +47,11 @@ class CC_SURFACES_EXPORT SurfaceFactory void DestroyAll(); // A frame can only be submitted to a surface created by this factory, // although the frame may reference surfaces created by other factories. - // The callback is called the first time this frame is used to draw. + // The callback is called the first time this frame is used to draw, or if + // the frame is discarded. void SubmitFrame(SurfaceId surface_id, scoped_ptr<CompositorFrame> frame, - const base::Closure& callback); + const DrawCallback& callback); void RequestCopyOfSurface(SurfaceId surface_id, scoped_ptr<CopyOutputRequest> copy_request); |