| 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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 scheduler_on_impl_thread_->NotifyReadyToActivate(); | 430 scheduler_on_impl_thread_->NotifyReadyToActivate(); |
| 431 } | 431 } |
| 432 | 432 |
| 433 void SingleThreadProxy::NotifyReadyToDraw() { | 433 void SingleThreadProxy::NotifyReadyToDraw() { |
| 434 TRACE_EVENT0("cc", "SingleThreadProxy::NotifyReadyToDraw"); | 434 TRACE_EVENT0("cc", "SingleThreadProxy::NotifyReadyToDraw"); |
| 435 DebugScopedSetImplThread impl(this); | 435 DebugScopedSetImplThread impl(this); |
| 436 if (scheduler_on_impl_thread_) | 436 if (scheduler_on_impl_thread_) |
| 437 scheduler_on_impl_thread_->NotifyReadyToDraw(); | 437 scheduler_on_impl_thread_->NotifyReadyToDraw(); |
| 438 } | 438 } |
| 439 | 439 |
| 440 void SingleThreadProxy::SetRequiresHighResToDraw(bool required) { |
| 441 if (scheduler_on_impl_thread_) |
| 442 scheduler_on_impl_thread_->SetRequiresHighResToDraw(required); |
| 443 } |
| 444 |
| 440 void SingleThreadProxy::SetNeedsRedrawOnImplThread() { | 445 void SingleThreadProxy::SetNeedsRedrawOnImplThread() { |
| 441 client_->ScheduleComposite(); | 446 client_->ScheduleComposite(); |
| 442 if (scheduler_on_impl_thread_) | 447 if (scheduler_on_impl_thread_) |
| 443 scheduler_on_impl_thread_->SetNeedsRedraw(); | 448 scheduler_on_impl_thread_->SetNeedsRedraw(); |
| 444 } | 449 } |
| 445 | 450 |
| 446 void SingleThreadProxy::SetNeedsAnimateOnImplThread() { | 451 void SingleThreadProxy::SetNeedsAnimateOnImplThread() { |
| 447 client_->ScheduleComposite(); | 452 client_->ScheduleComposite(); |
| 448 if (scheduler_on_impl_thread_) | 453 if (scheduler_on_impl_thread_) |
| 449 scheduler_on_impl_thread_->SetNeedsAnimate(); | 454 scheduler_on_impl_thread_->SetNeedsAnimate(); |
| 450 } | 455 } |
| 451 | 456 |
| 452 void SingleThreadProxy::SetNeedsPrepareTilesOnImplThread() { | 457 void SingleThreadProxy::SetNeedsPrepareTilesOnImplThread(bool for_commit) { |
| 453 TRACE_EVENT0("cc", "SingleThreadProxy::SetNeedsPrepareTilesOnImplThread"); | 458 TRACE_EVENT0("cc", "SingleThreadProxy::SetNeedsPrepareTilesOnImplThread"); |
| 454 if (scheduler_on_impl_thread_) | 459 if (scheduler_on_impl_thread_) |
| 455 scheduler_on_impl_thread_->SetNeedsPrepareTiles(); | 460 scheduler_on_impl_thread_->SetNeedsPrepareTiles(for_commit); |
| 456 } | 461 } |
| 457 | 462 |
| 458 void SingleThreadProxy::SetNeedsRedrawRectOnImplThread( | 463 void SingleThreadProxy::SetNeedsRedrawRectOnImplThread( |
| 459 const gfx::Rect& damage_rect) { | 464 const gfx::Rect& damage_rect) { |
| 460 layer_tree_host_impl_->SetViewportDamage(damage_rect); | 465 layer_tree_host_impl_->SetViewportDamage(damage_rect); |
| 461 SetNeedsRedrawOnImplThread(); | 466 SetNeedsRedrawOnImplThread(); |
| 462 } | 467 } |
| 463 | 468 |
| 464 void SingleThreadProxy::SetNeedsCommitOnImplThread() { | 469 void SingleThreadProxy::SetNeedsCommitOnImplThread() { |
| 465 client_->ScheduleComposite(); | 470 client_->ScheduleComposite(); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 | 519 |
| 515 // Synchronously call to CommitComplete. Resetting | 520 // Synchronously call to CommitComplete. Resetting |
| 516 // |commit_blocking_task_runner| would make sure all tasks posted during | 521 // |commit_blocking_task_runner| would make sure all tasks posted during |
| 517 // commit/activation before CommitComplete. | 522 // commit/activation before CommitComplete. |
| 518 CommitComplete(); | 523 CommitComplete(); |
| 519 } | 524 } |
| 520 | 525 |
| 521 timing_history_.DidActivateSyncTree(); | 526 timing_history_.DidActivateSyncTree(); |
| 522 } | 527 } |
| 523 | 528 |
| 524 void SingleThreadProxy::DidPrepareTiles() { | |
| 525 DCHECK(layer_tree_host_impl_->settings().impl_side_painting); | |
| 526 DCHECK(Proxy::IsImplThread()); | |
| 527 if (scheduler_on_impl_thread_) | |
| 528 scheduler_on_impl_thread_->DidPrepareTiles(); | |
| 529 } | |
| 530 | |
| 531 void SingleThreadProxy::DidCompletePageScaleAnimationOnImplThread() { | 529 void SingleThreadProxy::DidCompletePageScaleAnimationOnImplThread() { |
| 532 layer_tree_host_->DidCompletePageScaleAnimation(); | 530 layer_tree_host_->DidCompletePageScaleAnimation(); |
| 533 } | 531 } |
| 534 | 532 |
| 535 void SingleThreadProxy::UpdateRendererCapabilitiesOnImplThread() { | 533 void SingleThreadProxy::UpdateRendererCapabilitiesOnImplThread() { |
| 536 DCHECK(IsImplThread()); | 534 DCHECK(IsImplThread()); |
| 537 renderer_capabilities_for_main_thread_ = | 535 renderer_capabilities_for_main_thread_ = |
| 538 layer_tree_host_impl_->GetRendererCapabilities().MainThreadCapabilities(); | 536 layer_tree_host_impl_->GetRendererCapabilities().MainThreadCapabilities(); |
| 539 } | 537 } |
| 540 | 538 |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 995 << "DidFinishImplFrame called while not inside an impl frame!"; | 993 << "DidFinishImplFrame called while not inside an impl frame!"; |
| 996 inside_impl_frame_ = false; | 994 inside_impl_frame_ = false; |
| 997 #endif | 995 #endif |
| 998 } | 996 } |
| 999 | 997 |
| 1000 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { | 998 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { |
| 1001 layer_tree_host_->SendBeginFramesToChildren(args); | 999 layer_tree_host_->SendBeginFramesToChildren(args); |
| 1002 } | 1000 } |
| 1003 | 1001 |
| 1004 } // namespace cc | 1002 } // namespace cc |
| OLD | NEW |