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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 DebugScopedSetImplThread impl(task_runner_provider_); | 345 DebugScopedSetImplThread impl(task_runner_provider_); |
346 | 346 |
347 BlockingTaskRunner::CapturePostTasks blocked( | 347 BlockingTaskRunner::CapturePostTasks blocked( |
348 task_runner_provider_->blocking_main_thread_task_runner()); | 348 task_runner_provider_->blocking_main_thread_task_runner()); |
349 scheduler_on_impl_thread_ = nullptr; | 349 scheduler_on_impl_thread_ = nullptr; |
350 layer_tree_host_impl_ = nullptr; | 350 layer_tree_host_impl_ = nullptr; |
351 } | 351 } |
352 layer_tree_host_ = NULL; | 352 layer_tree_host_ = NULL; |
353 } | 353 } |
354 | 354 |
355 void SingleThreadProxy::OnResourcelessSoftareDrawStateChanged( | |
356 bool resourceless_draw) { | |
357 NOTREACHED(); | |
358 } | |
359 | |
360 void SingleThreadProxy::OnCanDrawStateChanged(bool can_draw) { | 355 void SingleThreadProxy::OnCanDrawStateChanged(bool can_draw) { |
361 TRACE_EVENT1( | 356 TRACE_EVENT1( |
362 "cc", "SingleThreadProxy::OnCanDrawStateChanged", "can_draw", can_draw); | 357 "cc", "SingleThreadProxy::OnCanDrawStateChanged", "can_draw", can_draw); |
363 DCHECK(task_runner_provider_->IsImplThread()); | 358 DCHECK(task_runner_provider_->IsImplThread()); |
364 if (scheduler_on_impl_thread_) | 359 if (scheduler_on_impl_thread_) |
365 scheduler_on_impl_thread_->SetCanDraw(can_draw); | 360 scheduler_on_impl_thread_->SetCanDraw(can_draw); |
366 } | 361 } |
367 | 362 |
368 void SingleThreadProxy::NotifyReadyToActivate() { | 363 void SingleThreadProxy::NotifyReadyToActivate() { |
369 TRACE_EVENT0("cc", "SingleThreadProxy::NotifyReadyToActivate"); | 364 TRACE_EVENT0("cc", "SingleThreadProxy::NotifyReadyToActivate"); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 } | 486 } |
492 | 487 |
493 void SingleThreadProxy::DidSwapBuffersCompleteOnImplThread() { | 488 void SingleThreadProxy::DidSwapBuffersCompleteOnImplThread() { |
494 TRACE_EVENT0("cc,benchmark", | 489 TRACE_EVENT0("cc,benchmark", |
495 "SingleThreadProxy::DidSwapBuffersCompleteOnImplThread"); | 490 "SingleThreadProxy::DidSwapBuffersCompleteOnImplThread"); |
496 if (scheduler_on_impl_thread_) | 491 if (scheduler_on_impl_thread_) |
497 scheduler_on_impl_thread_->DidSwapBuffersComplete(); | 492 scheduler_on_impl_thread_->DidSwapBuffersComplete(); |
498 layer_tree_host_->DidCompleteSwapBuffers(); | 493 layer_tree_host_->DidCompleteSwapBuffers(); |
499 } | 494 } |
500 | 495 |
501 void SingleThreadProxy::OnDrawForOutputSurface() { | 496 void SingleThreadProxy::OnDrawForOutputSurface( |
| 497 bool resourceless_software_draw) { |
502 NOTREACHED() << "Implemented by ThreadProxy for synchronous compositor."; | 498 NOTREACHED() << "Implemented by ThreadProxy for synchronous compositor."; |
503 } | 499 } |
504 | 500 |
505 void SingleThreadProxy::PostFrameTimingEventsOnImplThread( | 501 void SingleThreadProxy::PostFrameTimingEventsOnImplThread( |
506 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, | 502 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, |
507 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { | 503 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { |
508 layer_tree_host_->RecordFrameTimingEvents(std::move(composite_events), | 504 layer_tree_host_->RecordFrameTimingEvents(std::move(composite_events), |
509 std::move(main_frame_events)); | 505 std::move(main_frame_events)); |
510 } | 506 } |
511 | 507 |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 << "DidFinishImplFrame called while not inside an impl frame!"; | 873 << "DidFinishImplFrame called while not inside an impl frame!"; |
878 inside_impl_frame_ = false; | 874 inside_impl_frame_ = false; |
879 #endif | 875 #endif |
880 } | 876 } |
881 | 877 |
882 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { | 878 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { |
883 layer_tree_host_->SendBeginFramesToChildren(args); | 879 layer_tree_host_->SendBeginFramesToChildren(args); |
884 } | 880 } |
885 | 881 |
886 } // namespace cc | 882 } // namespace cc |
OLD | NEW |