Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(322)

Side by Side Diff: cc/trees/remote_channel_main.cc

Issue 2409923002: cc: Rename SwapBuffers on CompositorFrameSink to SubmitCompositorFrame (Closed)
Patch Set: swap-to-submit: rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 proto::CompositorMessageToImpl::SET_NEEDS_REDRAW); 122 proto::CompositorMessageToImpl::SET_NEEDS_REDRAW);
123 proto::SetNeedsRedraw* set_needs_redraw_message = 123 proto::SetNeedsRedraw* set_needs_redraw_message =
124 to_impl_proto->mutable_set_needs_redraw_message(); 124 to_impl_proto->mutable_set_needs_redraw_message();
125 RectToProto(damage_rect, set_needs_redraw_message->mutable_damaged_rect()); 125 RectToProto(damage_rect, set_needs_redraw_message->mutable_damaged_rect());
126 126
127 VLOG(1) << "Sending redraw request to client."; 127 VLOG(1) << "Sending redraw request to client.";
128 SendMessageProto(proto); 128 SendMessageProto(proto);
129 129
130 // The client will not inform us when the frame buffers are swapped. 130 // The client will not inform us when the frame buffers are swapped.
131 MainThreadTaskRunner()->PostTask( 131 MainThreadTaskRunner()->PostTask(
132 FROM_HERE, base::Bind(&RemoteChannelMain::DidCompleteSwapBuffers, 132 FROM_HERE, base::Bind(&RemoteChannelMain::DidReceiveCompositorFrameAck,
133 weak_factory_.GetWeakPtr())); 133 weak_factory_.GetWeakPtr()));
134 } 134 }
135 135
136 void RemoteChannelMain::SetNeedsCommitOnImpl() { 136 void RemoteChannelMain::SetNeedsCommitOnImpl() {
137 TRACE_EVENT0("cc.remote", "RemoteChannelMain::SetNeedsCommitOnImpl"); 137 TRACE_EVENT0("cc.remote", "RemoteChannelMain::SetNeedsCommitOnImpl");
138 proto::CompositorMessage proto; 138 proto::CompositorMessage proto;
139 proto::CompositorMessageToImpl* to_impl_proto = proto.mutable_to_impl(); 139 proto::CompositorMessageToImpl* to_impl_proto = proto.mutable_to_impl();
140 to_impl_proto->set_message_type( 140 to_impl_proto->set_message_type(
141 proto::CompositorMessageToImpl::SET_NEEDS_COMMIT); 141 proto::CompositorMessageToImpl::SET_NEEDS_COMMIT);
142 142
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 begin_main_frame_state.reset(new BeginMainFrameAndCommitState); 257 begin_main_frame_state.reset(new BeginMainFrameAndCommitState);
258 begin_main_frame_state->FromProtobuf( 258 begin_main_frame_state->FromProtobuf(
259 begin_main_frame_message.begin_main_frame_state()); 259 begin_main_frame_message.begin_main_frame_state());
260 proxy_main_->BeginMainFrame(std::move(begin_main_frame_state)); 260 proxy_main_->BeginMainFrame(std::move(begin_main_frame_state));
261 } break; 261 } break;
262 } 262 }
263 } 263 }
264 264
265 void RemoteChannelMain::DidCommitAndDrawFrame() { 265 void RemoteChannelMain::DidCommitAndDrawFrame() {
266 proxy_main_->DidCommitAndDrawFrame(); 266 proxy_main_->DidCommitAndDrawFrame();
267 DidCompleteSwapBuffers(); 267 DidReceiveCompositorFrameAck();
268 } 268 }
269 269
270 void RemoteChannelMain::DidCompleteSwapBuffers() { 270 void RemoteChannelMain::DidReceiveCompositorFrameAck() {
271 proxy_main_->DidCompleteSwapBuffers(); 271 proxy_main_->DidReceiveCompositorFrameAck();
272 } 272 }
273 273
274 base::SingleThreadTaskRunner* RemoteChannelMain::MainThreadTaskRunner() const { 274 base::SingleThreadTaskRunner* RemoteChannelMain::MainThreadTaskRunner() const {
275 return task_runner_provider_->MainThreadTaskRunner(); 275 return task_runner_provider_->MainThreadTaskRunner();
276 } 276 }
277 277
278 } // namespace cc 278 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698