| 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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 DebugScopedSetImplThread impl(this); | 347 DebugScopedSetImplThread impl(this); |
| 348 | 348 |
| 349 BlockingTaskRunner::CapturePostTasks blocked( | 349 BlockingTaskRunner::CapturePostTasks blocked( |
| 350 blocking_main_thread_task_runner()); | 350 blocking_main_thread_task_runner()); |
| 351 scheduler_on_impl_thread_ = nullptr; | 351 scheduler_on_impl_thread_ = nullptr; |
| 352 layer_tree_host_impl_ = nullptr; | 352 layer_tree_host_impl_ = nullptr; |
| 353 } | 353 } |
| 354 layer_tree_host_ = NULL; | 354 layer_tree_host_ = NULL; |
| 355 } | 355 } |
| 356 | 356 |
| 357 void SingleThreadProxy::OnResourcelessSoftareDrawStateChanged( | |
| 358 bool resourceless_draw) { | |
| 359 NOTREACHED(); | |
| 360 } | |
| 361 | |
| 362 void SingleThreadProxy::OnCanDrawStateChanged(bool can_draw) { | 357 void SingleThreadProxy::OnCanDrawStateChanged(bool can_draw) { |
| 363 TRACE_EVENT1( | 358 TRACE_EVENT1( |
| 364 "cc", "SingleThreadProxy::OnCanDrawStateChanged", "can_draw", can_draw); | 359 "cc", "SingleThreadProxy::OnCanDrawStateChanged", "can_draw", can_draw); |
| 365 DCHECK(Proxy::IsImplThread()); | 360 DCHECK(Proxy::IsImplThread()); |
| 366 if (scheduler_on_impl_thread_) | 361 if (scheduler_on_impl_thread_) |
| 367 scheduler_on_impl_thread_->SetCanDraw(can_draw); | 362 scheduler_on_impl_thread_->SetCanDraw(can_draw); |
| 368 } | 363 } |
| 369 | 364 |
| 370 void SingleThreadProxy::NotifyReadyToActivate() { | 365 void SingleThreadProxy::NotifyReadyToActivate() { |
| 371 TRACE_EVENT0("cc", "SingleThreadProxy::NotifyReadyToActivate"); | 366 TRACE_EVENT0("cc", "SingleThreadProxy::NotifyReadyToActivate"); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 } | 491 } |
| 497 | 492 |
| 498 void SingleThreadProxy::DidSwapBuffersCompleteOnImplThread() { | 493 void SingleThreadProxy::DidSwapBuffersCompleteOnImplThread() { |
| 499 TRACE_EVENT0("cc,benchmark", | 494 TRACE_EVENT0("cc,benchmark", |
| 500 "SingleThreadProxy::DidSwapBuffersCompleteOnImplThread"); | 495 "SingleThreadProxy::DidSwapBuffersCompleteOnImplThread"); |
| 501 if (scheduler_on_impl_thread_) | 496 if (scheduler_on_impl_thread_) |
| 502 scheduler_on_impl_thread_->DidSwapBuffersComplete(); | 497 scheduler_on_impl_thread_->DidSwapBuffersComplete(); |
| 503 layer_tree_host_->DidCompleteSwapBuffers(); | 498 layer_tree_host_->DidCompleteSwapBuffers(); |
| 504 } | 499 } |
| 505 | 500 |
| 506 void SingleThreadProxy::OnDrawForOutputSurface() { | 501 void SingleThreadProxy::OnDrawForOutputSurface( |
| 502 bool resourceless_software_draw) { |
| 507 NOTREACHED() << "Implemented by ThreadProxy for synchronous compositor."; | 503 NOTREACHED() << "Implemented by ThreadProxy for synchronous compositor."; |
| 508 } | 504 } |
| 509 | 505 |
| 510 void SingleThreadProxy::PostFrameTimingEventsOnImplThread( | 506 void SingleThreadProxy::PostFrameTimingEventsOnImplThread( |
| 511 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, | 507 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, |
| 512 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { | 508 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { |
| 513 layer_tree_host_->RecordFrameTimingEvents(composite_events.Pass(), | 509 layer_tree_host_->RecordFrameTimingEvents(composite_events.Pass(), |
| 514 main_frame_events.Pass()); | 510 main_frame_events.Pass()); |
| 515 } | 511 } |
| 516 | 512 |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 << "DidFinishImplFrame called while not inside an impl frame!"; | 881 << "DidFinishImplFrame called while not inside an impl frame!"; |
| 886 inside_impl_frame_ = false; | 882 inside_impl_frame_ = false; |
| 887 #endif | 883 #endif |
| 888 } | 884 } |
| 889 | 885 |
| 890 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { | 886 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { |
| 891 layer_tree_host_->SendBeginFramesToChildren(args); | 887 layer_tree_host_->SendBeginFramesToChildren(args); |
| 892 } | 888 } |
| 893 | 889 |
| 894 } // namespace cc | 890 } // namespace cc |
| OLD | NEW |