Chromium Code Reviews| Index: blimp/client/core/compositor/blimp_compositor.h |
| diff --git a/blimp/client/core/compositor/blimp_compositor.h b/blimp/client/core/compositor/blimp_compositor.h |
| index cf14c64cfae17b9ba522bb774b7ffebf771c1e44..683a7af2c363a11544c48a3046878182de1f1f5c 100644 |
| --- a/blimp/client/core/compositor/blimp_compositor.h |
| +++ b/blimp/client/core/compositor/blimp_compositor.h |
| @@ -36,6 +36,7 @@ class CompositorMessage; |
| class CompositorStateDeserializer; |
| class ContextProvider; |
| +class CopyOutputRequest; |
| class Layer; |
| class LayerTreeHost; |
| class LayerTreeSettings; |
| @@ -90,10 +91,12 @@ class BlimpCompositor : public cc::LayerTreeHostClient, |
| virtual void SetVisible(bool visible); |
| - // Notifies |callback| when all pending commits have been drawn to the screen. |
| - // If this compositor is destroyed or becomes hidden |callback| will be |
| - // notified. |
| - void NotifyWhenDonePendingCommits(base::Closure callback); |
| + // Requests a copy of the compositor frame. |
| + // Setting |flush_pending_update| to true ensures that if a frame update on |
| + // the main thread is pending, then it is drawn before copying from the |
| + // surface. |
| + void RequestCopyOfOutput(std::unique_ptr<cc::CopyOutputRequest> copy_request, |
| + bool flush_pending_update); |
| // Called to forward the compositor message from the remote server |
| // LayerTreeHost of the render widget for this compositor. |
| @@ -109,6 +112,7 @@ class BlimpCompositor : public cc::LayerTreeHostClient, |
| private: |
| friend class BlimpCompositorForTesting; |
| + class FrameTrackingSwapPromise; |
|
aelias_OOO_until_Jul13
2016/11/02 07:02:10
There's no need to put this in the header. Instea
Khushal
2016/11/02 07:24:21
I'm actually calling a private method from that cl
|
| // LayerTreeHostClient implementation. |
| void WillBeginMainFrame() override {} |
| @@ -176,11 +180,6 @@ class BlimpCompositor : public cc::LayerTreeHostClient, |
| // associated state. |
| void DestroyLayerTreeHost(); |
| - // Updates |pending_commit_trackers_|, decrementing the count and, if 0, |
| - // notifying the callback. If |flush| is true, flushes all entries regardless |
| - // of the count. |
| - void CheckPendingCommitCounts(bool flush); |
| - |
| // Acks a submitted CompositorFrame when it has been processed and another |
| // frame should be started. |
| void SubmitCompositorFrameAck(); |
| @@ -193,6 +192,12 @@ class BlimpCompositor : public cc::LayerTreeHostClient, |
| // updates from the engine. |
| const bool use_threaded_layer_tree_host_; |
| + void MakeCopyRequestOnNextSwap( |
| + std::unique_ptr<cc::CopyOutputRequest> copy_request); |
| + |
| + void RequestCopyOfOutputDeprecated( |
| + std::unique_ptr<cc::CopyOutputRequest> copy_request); |
| + |
| BlimpCompositorClient* client_; |
| BlimpCompositorDependencies* compositor_dependencies_; |
| @@ -224,6 +229,9 @@ class BlimpCompositor : public cc::LayerTreeHostClient, |
| // to |render_widget_id_|. |
| cc::RemoteProtoChannel::ProtoReceiver* remote_proto_channel_receiver_; |
| + std::vector<std::unique_ptr<cc::CopyOutputRequest>> |
| + copy_requests_for_next_swap_; |
| + |
| // The number of times a START_COMMIT proto has been received but a call to |
| // DidCommitAndDrawFrame hasn't been seen. This should track the number of |
| // outstanding commits. |
| @@ -233,7 +241,8 @@ class BlimpCompositor : public cc::LayerTreeHostClient, |
| // along with the |callback| into this vector. Each time |
| // DidCommitAndDrawFrame is called these entries get decremented. If they hit |
| // 0 the callback is triggered. |
| - std::vector<std::pair<size_t, base::Closure>> pending_commit_trackers_; |
| + std::vector<std::pair<size_t, std::unique_ptr<cc::CopyOutputRequest>>> |
| + pending_commit_trackers_; |
| // Stores a frame update received from the engine, when a threaded |
| // LayerTreeHost is used. There can only be a single frame in flight at any |