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

Side by Side Diff: cc/trees/remote_channel_impl.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
« no previous file with comments | « cc/trees/remote_channel_impl.h ('k') | cc/trees/remote_channel_main.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_impl.h" 5 #include "cc/trees/remote_channel_impl.h"
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "cc/animation/animation_events.h" 10 #include "cc/animation/animation_events.h"
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_); 289 DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_);
290 ImplThreadTaskRunner()->PostTask( 290 ImplThreadTaskRunner()->PostTask(
291 FROM_HERE, 291 FROM_HERE,
292 base::Bind(&ProxyImpl::MainFrameWillHappenOnImplForTesting, 292 base::Bind(&ProxyImpl::MainFrameWillHappenOnImplForTesting,
293 proxy_impl_weak_ptr_, &completion, &main_frame_will_happen)); 293 proxy_impl_weak_ptr_, &completion, &main_frame_will_happen));
294 completion.Wait(); 294 completion.Wait();
295 } 295 }
296 return main_frame_will_happen; 296 return main_frame_will_happen;
297 } 297 }
298 298
299 void RemoteChannelImpl::DidCompleteSwapBuffers() { 299 void RemoteChannelImpl::DidReceiveCompositorFrameAck() {
300 DCHECK(task_runner_provider_->IsImplThread()); 300 DCHECK(task_runner_provider_->IsImplThread());
301 MainThreadTaskRunner()->PostTask( 301 MainThreadTaskRunner()->PostTask(
302 FROM_HERE, base::Bind(&RemoteChannelImpl::DidCompleteSwapBuffersOnMain, 302 FROM_HERE,
303 impl().remote_channel_weak_ptr)); 303 base::Bind(&RemoteChannelImpl::DidReceiveCompositorFrameAckOnMain,
304 impl().remote_channel_weak_ptr));
304 } 305 }
305 306
306 void RemoteChannelImpl::BeginMainFrameNotExpectedSoon() {} 307 void RemoteChannelImpl::BeginMainFrameNotExpectedSoon() {}
307 308
308 void RemoteChannelImpl::DidCommitAndDrawFrame() { 309 void RemoteChannelImpl::DidCommitAndDrawFrame() {
309 DCHECK(task_runner_provider_->IsImplThread()); 310 DCHECK(task_runner_provider_->IsImplThread());
310 MainThreadTaskRunner()->PostTask( 311 MainThreadTaskRunner()->PostTask(
311 FROM_HERE, base::Bind(&RemoteChannelImpl::DidCommitAndDrawFrameOnMain, 312 FROM_HERE, base::Bind(&RemoteChannelImpl::DidCommitAndDrawFrameOnMain,
312 impl().remote_channel_weak_ptr)); 313 impl().remote_channel_weak_ptr));
313 } 314 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 void RemoteChannelImpl::SendMessageProto( 364 void RemoteChannelImpl::SendMessageProto(
364 std::unique_ptr<proto::CompositorMessage> proto) { 365 std::unique_ptr<proto::CompositorMessage> proto) {
365 DCHECK(task_runner_provider_->IsImplThread()); 366 DCHECK(task_runner_provider_->IsImplThread());
366 367
367 MainThreadTaskRunner()->PostTask( 368 MainThreadTaskRunner()->PostTask(
368 FROM_HERE, 369 FROM_HERE,
369 base::Bind(&RemoteChannelImpl::SendMessageProtoOnMain, 370 base::Bind(&RemoteChannelImpl::SendMessageProtoOnMain,
370 impl().remote_channel_weak_ptr, base::Passed(&proto))); 371 impl().remote_channel_weak_ptr, base::Passed(&proto)));
371 } 372 }
372 373
373 void RemoteChannelImpl::DidCompleteSwapBuffersOnMain() { 374 void RemoteChannelImpl::DidReceiveCompositorFrameAckOnMain() {
374 DCHECK(task_runner_provider_->IsMainThread()); 375 DCHECK(task_runner_provider_->IsMainThread());
375 main().layer_tree_host->DidCompleteSwapBuffers(); 376 main().layer_tree_host->DidReceiveCompositorFrameAck();
376 } 377 }
377 378
378 void RemoteChannelImpl::DidCommitAndDrawFrameOnMain() { 379 void RemoteChannelImpl::DidCommitAndDrawFrameOnMain() {
379 DCHECK(task_runner_provider_->IsMainThread()); 380 DCHECK(task_runner_provider_->IsMainThread());
380 main().layer_tree_host->DidCommitAndDrawFrame(); 381 main().layer_tree_host->DidCommitAndDrawFrame();
381 } 382 }
382 383
383 void RemoteChannelImpl::DidLoseCompositorFrameSinkOnMain() { 384 void RemoteChannelImpl::DidLoseCompositorFrameSinkOnMain() {
384 DCHECK(task_runner_provider_->IsMainThread()); 385 DCHECK(task_runner_provider_->IsMainThread());
385 386
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 510
510 RemoteChannelImpl::CompositorThreadOnly::CompositorThreadOnly( 511 RemoteChannelImpl::CompositorThreadOnly::CompositorThreadOnly(
511 base::WeakPtr<RemoteChannelImpl> remote_channel_weak_ptr) 512 base::WeakPtr<RemoteChannelImpl> remote_channel_weak_ptr)
512 : proxy_impl(nullptr), 513 : proxy_impl(nullptr),
513 proxy_impl_weak_factory(nullptr), 514 proxy_impl_weak_factory(nullptr),
514 remote_channel_weak_ptr(remote_channel_weak_ptr) {} 515 remote_channel_weak_ptr(remote_channel_weak_ptr) {}
515 516
516 RemoteChannelImpl::CompositorThreadOnly::~CompositorThreadOnly() {} 517 RemoteChannelImpl::CompositorThreadOnly::~CompositorThreadOnly() {}
517 518
518 } // namespace cc 519 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/remote_channel_impl.h ('k') | cc/trees/remote_channel_main.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698