OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/renderer/android/synchronous_compositor_proxy.h" | 5 #include "content/renderer/android/synchronous_compositor_proxy.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
10 #include "content/common/android/sync_compositor_messages.h" | 10 #include "content/common/android/sync_compositor_messages.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 } | 121 } |
122 | 122 |
123 void SynchronousCompositorProxy::DidActivatePendingTree() { | 123 void SynchronousCompositorProxy::DidActivatePendingTree() { |
124 ++did_activate_pending_tree_count_; | 124 ++did_activate_pending_tree_count_; |
125 SendAsyncRendererStateIfNeeded(); | 125 SendAsyncRendererStateIfNeeded(); |
126 DeliverMessages(); | 126 DeliverMessages(); |
127 } | 127 } |
128 | 128 |
129 void SynchronousCompositorProxy::DeliverMessages() { | 129 void SynchronousCompositorProxy::DeliverMessages() { |
130 DCHECK(output_surface_); | 130 DCHECK(output_surface_); |
131 std::vector<scoped_ptr<IPC::Message>> messages; | 131 std::vector<std::unique_ptr<IPC::Message>> messages; |
132 output_surface_->GetMessagesToDeliver(&messages); | 132 output_surface_->GetMessagesToDeliver(&messages); |
133 for (auto& msg : messages) { | 133 for (auto& msg : messages) { |
134 Send(msg.release()); | 134 Send(msg.release()); |
135 } | 135 } |
136 } | 136 } |
137 | 137 |
138 void SynchronousCompositorProxy::SendAsyncRendererStateIfNeeded() { | 138 void SynchronousCompositorProxy::SendAsyncRendererStateIfNeeded() { |
139 if (inside_receive_) | 139 if (inside_receive_) |
140 return; | 140 return; |
141 SyncCompositorCommonRendererParams params; | 141 SyncCompositorCommonRendererParams params; |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 begin_frame_source_->SetBeginFrameSourcePaused( | 433 begin_frame_source_->SetBeginFrameSourcePaused( |
434 common_params.begin_frame_source_paused); | 434 common_params.begin_frame_source_paused); |
435 if (output_surface_ && !common_params.ack.resources.empty()) { | 435 if (output_surface_ && !common_params.ack.resources.empty()) { |
436 output_surface_->ReturnResources( | 436 output_surface_->ReturnResources( |
437 common_params.output_surface_id_for_returned_resources, | 437 common_params.output_surface_id_for_returned_resources, |
438 common_params.ack); | 438 common_params.ack); |
439 } | 439 } |
440 } | 440 } |
441 | 441 |
442 } // namespace content | 442 } // namespace content |
OLD | NEW |