| OLD | NEW |
| 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/profiler/scoped_tracker.h" | 8 #include "base/profiler/scoped_tracker.h" |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "cc/debug/benchmark_instrumentation.h" | 10 #include "cc/debug/benchmark_instrumentation.h" |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 NOTREACHED() << "Implemented by ThreadProxy for synchronous compositor."; | 507 NOTREACHED() << "Implemented by ThreadProxy for synchronous compositor."; |
| 508 } | 508 } |
| 509 | 509 |
| 510 void SingleThreadProxy::PostFrameTimingEventsOnImplThread( | 510 void SingleThreadProxy::PostFrameTimingEventsOnImplThread( |
| 511 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, | 511 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, |
| 512 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { | 512 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { |
| 513 layer_tree_host_->RecordFrameTimingEvents(composite_events.Pass(), | 513 layer_tree_host_->RecordFrameTimingEvents(composite_events.Pass(), |
| 514 main_frame_events.Pass()); | 514 main_frame_events.Pass()); |
| 515 } | 515 } |
| 516 | 516 |
| 517 void SingleThreadProxy::LayoutAndUpdateLayers() { | |
| 518 if (layer_tree_host_->output_surface_lost()) { | |
| 519 RequestNewOutputSurface(); | |
| 520 // RequestNewOutputSurface could have synchronously created an output | |
| 521 // surface, so check again before returning. | |
| 522 if (layer_tree_host_->output_surface_lost()) | |
| 523 return; | |
| 524 } | |
| 525 | |
| 526 layer_tree_host_->Layout(); | |
| 527 layer_tree_host_->UpdateLayers(); | |
| 528 } | |
| 529 | |
| 530 void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) { | 517 void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) { |
| 531 TRACE_EVENT0("cc,benchmark", "SingleThreadProxy::CompositeImmediately"); | 518 TRACE_EVENT0("cc,benchmark", "SingleThreadProxy::CompositeImmediately"); |
| 532 DCHECK(Proxy::IsMainThread()); | 519 DCHECK(Proxy::IsMainThread()); |
| 533 #if DCHECK_IS_ON() | 520 #if DCHECK_IS_ON() |
| 534 DCHECK(!inside_impl_frame_); | 521 DCHECK(!inside_impl_frame_); |
| 535 #endif | 522 #endif |
| 536 base::AutoReset<bool> inside_composite(&inside_synchronous_composite_, true); | 523 base::AutoReset<bool> inside_composite(&inside_synchronous_composite_, true); |
| 537 | 524 |
| 538 if (layer_tree_host_->output_surface_lost()) { | 525 if (layer_tree_host_->output_surface_lost()) { |
| 539 RequestNewOutputSurface(); | 526 RequestNewOutputSurface(); |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 << "DidFinishImplFrame called while not inside an impl frame!"; | 885 << "DidFinishImplFrame called while not inside an impl frame!"; |
| 899 inside_impl_frame_ = false; | 886 inside_impl_frame_ = false; |
| 900 #endif | 887 #endif |
| 901 } | 888 } |
| 902 | 889 |
| 903 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { | 890 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { |
| 904 layer_tree_host_->SendBeginFramesToChildren(args); | 891 layer_tree_host_->SendBeginFramesToChildren(args); |
| 905 } | 892 } |
| 906 | 893 |
| 907 } // namespace cc | 894 } // namespace cc |
| OLD | NEW |