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/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/profiler/scoped_tracker.h" | 9 #include "base/profiler/scoped_tracker.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 TRACE_EVENT1("cc", "SingleThreadProxy::OnCanDrawStateChanged", "can_draw", | 312 TRACE_EVENT1("cc", "SingleThreadProxy::OnCanDrawStateChanged", "can_draw", |
313 can_draw); | 313 can_draw); |
314 DCHECK(task_runner_provider_->IsImplThread()); | 314 DCHECK(task_runner_provider_->IsImplThread()); |
315 if (scheduler_on_impl_thread_) | 315 if (scheduler_on_impl_thread_) |
316 scheduler_on_impl_thread_->SetCanDraw(can_draw); | 316 scheduler_on_impl_thread_->SetCanDraw(can_draw); |
317 } | 317 } |
318 | 318 |
319 void SingleThreadProxy::NotifyReadyToActivate() { | 319 void SingleThreadProxy::NotifyReadyToActivate() { |
320 TRACE_EVENT0("cc", "SingleThreadProxy::NotifyReadyToActivate"); | 320 TRACE_EVENT0("cc", "SingleThreadProxy::NotifyReadyToActivate"); |
321 DebugScopedSetImplThread impl(task_runner_provider_); | 321 DebugScopedSetImplThread impl(task_runner_provider_); |
322 if (scheduler_on_impl_thread_) { | 322 if (scheduler_on_impl_thread_) |
323 // The argument to NotifyReadyToActivate is the pending-tree for computing | 323 scheduler_on_impl_thread_->NotifyReadyToActivate(); |
324 // Activation time in ProxyImpl. However this is not applicable here. | |
325 scheduler_on_impl_thread_->NotifyReadyToActivate(-1); | |
326 } | |
327 } | 324 } |
328 | 325 |
329 void SingleThreadProxy::NotifyReadyToDraw() { | 326 void SingleThreadProxy::NotifyReadyToDraw() { |
330 TRACE_EVENT0("cc", "SingleThreadProxy::NotifyReadyToDraw"); | 327 TRACE_EVENT0("cc", "SingleThreadProxy::NotifyReadyToDraw"); |
331 DebugScopedSetImplThread impl(task_runner_provider_); | 328 DebugScopedSetImplThread impl(task_runner_provider_); |
332 if (scheduler_on_impl_thread_) | 329 if (scheduler_on_impl_thread_) |
333 scheduler_on_impl_thread_->NotifyReadyToDraw(); | 330 scheduler_on_impl_thread_->NotifyReadyToDraw(); |
334 } | 331 } |
335 | 332 |
336 void SingleThreadProxy::SetNeedsRedrawOnImplThread() { | 333 void SingleThreadProxy::SetNeedsRedrawOnImplThread() { |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 if (compositor_frame_sink_lost_) { | 449 if (compositor_frame_sink_lost_) { |
453 RequestNewCompositorFrameSink(); | 450 RequestNewCompositorFrameSink(); |
454 // RequestNewCompositorFrameSink could have synchronously created an output | 451 // RequestNewCompositorFrameSink could have synchronously created an output |
455 // surface, so check again before returning. | 452 // surface, so check again before returning. |
456 if (compositor_frame_sink_lost_) | 453 if (compositor_frame_sink_lost_) |
457 return; | 454 return; |
458 } | 455 } |
459 | 456 |
460 BeginFrameArgs begin_frame_args(BeginFrameArgs::Create( | 457 BeginFrameArgs begin_frame_args(BeginFrameArgs::Create( |
461 BEGINFRAME_FROM_HERE, BeginFrameArgs::kManualSourceId, 1, | 458 BEGINFRAME_FROM_HERE, BeginFrameArgs::kManualSourceId, 1, |
462 BeginFrameArgs::kDefaultSourceFrameNumber, frame_begin_time, | 459 frame_begin_time, base::TimeTicks(), BeginFrameArgs::DefaultInterval(), |
463 base::TimeTicks(), BeginFrameArgs::DefaultInterval(), | |
464 BeginFrameArgs::NORMAL)); | 460 BeginFrameArgs::NORMAL)); |
465 | 461 |
466 // Start the impl frame. | 462 // Start the impl frame. |
467 { | 463 { |
468 DebugScopedSetImplThread impl(task_runner_provider_); | 464 DebugScopedSetImplThread impl(task_runner_provider_); |
469 WillBeginImplFrame(begin_frame_args); | 465 WillBeginImplFrame(begin_frame_args); |
470 } | 466 } |
471 | 467 |
472 // Run the "main thread" and get it to commit. | 468 // Run the "main thread" and get it to commit. |
473 { | 469 { |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 void SingleThreadProxy::DidFinishImplFrame() { | 788 void SingleThreadProxy::DidFinishImplFrame() { |
793 layer_tree_host_impl_->DidFinishImplFrame(); | 789 layer_tree_host_impl_->DidFinishImplFrame(); |
794 #if DCHECK_IS_ON() | 790 #if DCHECK_IS_ON() |
795 DCHECK(inside_impl_frame_) | 791 DCHECK(inside_impl_frame_) |
796 << "DidFinishImplFrame called while not inside an impl frame!"; | 792 << "DidFinishImplFrame called while not inside an impl frame!"; |
797 inside_impl_frame_ = false; | 793 inside_impl_frame_ = false; |
798 #endif | 794 #endif |
799 } | 795 } |
800 | 796 |
801 } // namespace cc | 797 } // namespace cc |
OLD | NEW |