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.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.h')
-rw-r--r-- | cc/surfaces/surface.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cc/surfaces/surface.h b/cc/surfaces/surface.h index ed0061d..96152a0 100644 --- a/cc/surfaces/surface.h +++ b/cc/surfaces/surface.h @@ -34,13 +34,15 @@ class SurfaceResourceHolder; class CC_SURFACES_EXPORT Surface { public: + using DrawCallback = base::Callback<void(bool)>; + Surface(SurfaceId id, SurfaceFactory* factory); ~Surface(); SurfaceId surface_id() const { return surface_id_; } void QueueFrame(scoped_ptr<CompositorFrame> frame, - const base::Closure& draw_callback); + const DrawCallback& draw_callback); void RequestCopyOfOutput(scoped_ptr<CopyOutputRequest> copy_request); // Adds each CopyOutputRequest in the current frame to copy_requests. The // caller takes ownership of them. @@ -79,7 +81,7 @@ class CC_SURFACES_EXPORT Surface { int frame_index_; std::vector<SurfaceSequence> destruction_dependencies_; - base::Closure draw_callback_; + DrawCallback draw_callback_; DISALLOW_COPY_AND_ASSIGN(Surface); }; |