| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/trees/remote_channel_main.h" | 5 #include "cc/trees/remote_channel_main.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "cc/proto/base_conversions.h" | 10 #include "cc/proto/base_conversions.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 proto::CompositorMessageToImpl* to_impl_proto = proto.mutable_to_impl(); | 148 proto::CompositorMessageToImpl* to_impl_proto = proto.mutable_to_impl(); |
| 149 to_impl_proto->set_message_type( | 149 to_impl_proto->set_message_type( |
| 150 proto::CompositorMessageToImpl::SET_NEEDS_COMMIT); | 150 proto::CompositorMessageToImpl::SET_NEEDS_COMMIT); |
| 151 | 151 |
| 152 VLOG(1) << "Sending commit request to client."; | 152 VLOG(1) << "Sending commit request to client."; |
| 153 SendMessageProto(proto); | 153 SendMessageProto(proto); |
| 154 } | 154 } |
| 155 | 155 |
| 156 void RemoteChannelMain::BeginMainFrameAbortedOnImpl( | 156 void RemoteChannelMain::BeginMainFrameAbortedOnImpl( |
| 157 CommitEarlyOutReason reason, | 157 CommitEarlyOutReason reason, |
| 158 base::TimeTicks main_thread_start_time) { | 158 base::TimeTicks main_thread_start_time, |
| 159 std::vector<std::unique_ptr<SwapPromise>> swap_promises) { |
| 159 TRACE_EVENT1("cc.remote", "RemoteChannelMain::BeginMainFrameAbortedOnImpl", | 160 TRACE_EVENT1("cc.remote", "RemoteChannelMain::BeginMainFrameAbortedOnImpl", |
| 160 "reason", CommitEarlyOutReasonToString(reason)); | 161 "reason", CommitEarlyOutReasonToString(reason)); |
| 161 proto::CompositorMessage proto; | 162 proto::CompositorMessage proto; |
| 162 proto::CompositorMessageToImpl* to_impl_proto = proto.mutable_to_impl(); | 163 proto::CompositorMessageToImpl* to_impl_proto = proto.mutable_to_impl(); |
| 163 to_impl_proto->set_message_type( | 164 to_impl_proto->set_message_type( |
| 164 proto::CompositorMessageToImpl::BEGIN_MAIN_FRAME_ABORTED); | 165 proto::CompositorMessageToImpl::BEGIN_MAIN_FRAME_ABORTED); |
| 165 proto::BeginMainFrameAborted* begin_main_frame_aborted_message = | 166 proto::BeginMainFrameAborted* begin_main_frame_aborted_message = |
| 166 to_impl_proto->mutable_begin_main_frame_aborted_message(); | 167 to_impl_proto->mutable_begin_main_frame_aborted_message(); |
| 167 CommitEarlyOutReasonToProtobuf( | 168 CommitEarlyOutReasonToProtobuf( |
| 168 reason, begin_main_frame_aborted_message->mutable_reason()); | 169 reason, begin_main_frame_aborted_message->mutable_reason()); |
| 169 | 170 |
| 170 VLOG(1) << "Sending BeginMainFrameAborted message to client with reason: " | 171 VLOG(1) << "Sending BeginMainFrameAborted message to client with reason: " |
| 171 << CommitEarlyOutReasonToString(reason); | 172 << CommitEarlyOutReasonToString(reason); |
| 172 SendMessageProto(proto); | 173 SendMessageProto(proto); |
| 174 |
| 175 // Notify swap promises that commit had no updates. In the local compositor |
| 176 // case this goes to the impl thread to be queued up in case we have an |
| 177 // activation pending but that never happens for remote compositor. |
| 178 for (const auto& swap_promise : swap_promises) |
| 179 swap_promise->DidNotSwap(SwapPromise::COMMIT_NO_UPDATE); |
| 173 } | 180 } |
| 174 | 181 |
| 175 void RemoteChannelMain::NotifyReadyToCommitOnImpl( | 182 void RemoteChannelMain::NotifyReadyToCommitOnImpl( |
| 176 CompletionEvent* completion, | 183 CompletionEvent* completion, |
| 177 LayerTreeHost* layer_tree_host, | 184 LayerTreeHost* layer_tree_host, |
| 178 base::TimeTicks main_thread_start_time, | 185 base::TimeTicks main_thread_start_time, |
| 179 bool hold_commit_for_activation) { | 186 bool hold_commit_for_activation) { |
| 180 TRACE_EVENT0("cc.remote", "RemoteChannelMain::NotifyReadyToCommitOnImpl"); | 187 TRACE_EVENT0("cc.remote", "RemoteChannelMain::NotifyReadyToCommitOnImpl"); |
| 181 proto::CompositorMessage proto; | 188 proto::CompositorMessage proto; |
| 182 proto::CompositorMessageToImpl* to_impl_proto = proto.mutable_to_impl(); | 189 proto::CompositorMessageToImpl* to_impl_proto = proto.mutable_to_impl(); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 | 296 |
| 290 void RemoteChannelMain::DidCompleteSwapBuffers() { | 297 void RemoteChannelMain::DidCompleteSwapBuffers() { |
| 291 proxy_main_->DidCompleteSwapBuffers(); | 298 proxy_main_->DidCompleteSwapBuffers(); |
| 292 } | 299 } |
| 293 | 300 |
| 294 base::SingleThreadTaskRunner* RemoteChannelMain::MainThreadTaskRunner() const { | 301 base::SingleThreadTaskRunner* RemoteChannelMain::MainThreadTaskRunner() const { |
| 295 return task_runner_provider_->MainThreadTaskRunner(); | 302 return task_runner_provider_->MainThreadTaskRunner(); |
| 296 } | 303 } |
| 297 | 304 |
| 298 } // namespace cc | 305 } // namespace cc |
| OLD | NEW |