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

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

Issue 683113005: Update from chromium https://crrev.com/302282 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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/layer_tree_host_unittest.cc ('k') | cc/trees/thread_proxy.cc » ('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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/single_thread_proxy.h" 5 #include "cc/trees/single_thread_proxy.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "cc/debug/benchmark_instrumentation.h" 9 #include "cc/debug/benchmark_instrumentation.h"
10 #include "cc/output/context_provider.h" 10 #include "cc/output/context_provider.h"
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 void SingleThreadProxy::DidSwapBuffersCompleteOnImplThread() { 460 void SingleThreadProxy::DidSwapBuffersCompleteOnImplThread() {
461 TRACE_EVENT0("cc", "SingleThreadProxy::DidSwapBuffersCompleteOnImplThread"); 461 TRACE_EVENT0("cc", "SingleThreadProxy::DidSwapBuffersCompleteOnImplThread");
462 if (scheduler_on_impl_thread_) 462 if (scheduler_on_impl_thread_)
463 scheduler_on_impl_thread_->DidSwapBuffersComplete(); 463 scheduler_on_impl_thread_->DidSwapBuffersComplete();
464 layer_tree_host_->DidCompleteSwapBuffers(); 464 layer_tree_host_->DidCompleteSwapBuffers();
465 } 465 }
466 466
467 void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) { 467 void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) {
468 TRACE_EVENT0("cc", "SingleThreadProxy::CompositeImmediately"); 468 TRACE_EVENT0("cc", "SingleThreadProxy::CompositeImmediately");
469 DCHECK(Proxy::IsMainThread()); 469 DCHECK(Proxy::IsMainThread());
470 DCHECK(!layer_tree_host_impl_->settings().impl_side_painting)
471 << "Impl-side painting and synchronous compositing are not supported.";
472 base::AutoReset<bool> inside_composite(&inside_synchronous_composite_, true); 470 base::AutoReset<bool> inside_composite(&inside_synchronous_composite_, true);
473 471
474 if (layer_tree_host_->output_surface_lost()) { 472 if (layer_tree_host_->output_surface_lost()) {
475 RequestNewOutputSurface(); 473 RequestNewOutputSurface();
476 // RequestNewOutputSurface could have synchronously created an output 474 // RequestNewOutputSurface could have synchronously created an output
477 // surface, so check again before returning. 475 // surface, so check again before returning.
478 if (layer_tree_host_->output_surface_lost()) 476 if (layer_tree_host_->output_surface_lost())
479 return; 477 return;
480 } 478 }
481 479
482 { 480 {
483 BeginFrameArgs begin_frame_args( 481 BeginFrameArgs begin_frame_args(
484 BeginFrameArgs::Create(frame_begin_time, 482 BeginFrameArgs::Create(frame_begin_time,
485 base::TimeTicks(), 483 base::TimeTicks(),
486 BeginFrameArgs::DefaultInterval())); 484 BeginFrameArgs::DefaultInterval()));
487 DoBeginMainFrame(begin_frame_args); 485 DoBeginMainFrame(begin_frame_args);
488 DoCommit(); 486 DoCommit();
489 487
490 DCHECK_EQ(0u, layer_tree_host_->num_queued_swap_promises()) 488 DCHECK_EQ(0u, layer_tree_host_->num_queued_swap_promises())
491 << "Commit should always succeed and transfer promises."; 489 << "Commit should always succeed and transfer promises.";
492 } 490 }
493 491
494 { 492 {
495 DebugScopedSetImplThread impl(const_cast<SingleThreadProxy*>(this)); 493 DebugScopedSetImplThread impl(const_cast<SingleThreadProxy*>(this));
494 if (layer_tree_host_impl_->settings().impl_side_painting) {
495 layer_tree_host_impl_->ActivateSyncTree();
496 layer_tree_host_impl_->active_tree()->UpdateDrawProperties();
497 layer_tree_host_impl_->ManageTiles();
498 layer_tree_host_impl_->SynchronouslyInitializeAllTiles();
499 }
500
496 LayerTreeHostImpl::FrameData frame; 501 LayerTreeHostImpl::FrameData frame;
497 DoComposite(frame_begin_time, &frame); 502 DoComposite(frame_begin_time, &frame);
498 503
499 // DoComposite could abort, but because this is a synchronous composite 504 // DoComposite could abort, but because this is a synchronous composite
500 // another draw will never be scheduled, so break remaining promises. 505 // another draw will never be scheduled, so break remaining promises.
501 layer_tree_host_impl_->active_tree()->BreakSwapPromises( 506 layer_tree_host_impl_->active_tree()->BreakSwapPromises(
502 SwapPromise::SWAP_FAILS); 507 SwapPromise::SWAP_FAILS);
503 } 508 }
504 } 509 }
505 510
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 790
786 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() { 791 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() {
787 return timing_history_.CommitToActivateDurationEstimate(); 792 return timing_history_.CommitToActivateDurationEstimate();
788 } 793 }
789 794
790 void SingleThreadProxy::DidBeginImplFrameDeadline() { 795 void SingleThreadProxy::DidBeginImplFrameDeadline() {
791 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); 796 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame();
792 } 797 }
793 798
794 } // namespace cc 799 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698