Chromium Code Reviews| 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/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "cc/debug/benchmark_instrumentation.h" | 9 #include "cc/debug/benchmark_instrumentation.h" |
| 10 #include "cc/output/context_provider.h" | 10 #include "cc/output/context_provider.h" |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 40 timing_history_(layer_tree_host->rendering_stats_instrumentation()), | 40 timing_history_(layer_tree_host->rendering_stats_instrumentation()), |
| 41 next_frame_is_newly_committed_frame_(false), | 41 next_frame_is_newly_committed_frame_(false), |
| 42 inside_draw_(false), | 42 inside_draw_(false), |
| 43 defer_commits_(false), | 43 defer_commits_(false), |
| 44 commit_was_deferred_(false), | 44 commit_was_deferred_(false), |
| 45 commit_requested_(false), | 45 commit_requested_(false), |
| 46 weak_factory_(this) { | 46 weak_factory_(this) { |
| 47 TRACE_EVENT0("cc", "SingleThreadProxy::SingleThreadProxy"); | 47 TRACE_EVENT0("cc", "SingleThreadProxy::SingleThreadProxy"); |
| 48 DCHECK(Proxy::IsMainThread()); | 48 DCHECK(Proxy::IsMainThread()); |
| 49 DCHECK(layer_tree_host); | 49 DCHECK(layer_tree_host); |
| 50 | |
| 51 // Impl-side painting not supported without threaded compositing. | |
| 52 CHECK(!layer_tree_host->settings().impl_side_painting) | |
| 53 << "Threaded compositing must be enabled to use impl-side painting."; | |
| 54 } | 50 } |
| 55 | 51 |
| 56 void SingleThreadProxy::Start() { | 52 void SingleThreadProxy::Start() { |
| 57 DebugScopedSetImplThread impl(this); | 53 DebugScopedSetImplThread impl(this); |
| 58 layer_tree_host_impl_ = layer_tree_host_->CreateLayerTreeHostImpl(this); | 54 layer_tree_host_impl_ = layer_tree_host_->CreateLayerTreeHostImpl(this); |
| 59 } | 55 } |
| 60 | 56 |
| 61 SingleThreadProxy::~SingleThreadProxy() { | 57 SingleThreadProxy::~SingleThreadProxy() { |
| 62 TRACE_EVENT0("cc", "SingleThreadProxy::~SingleThreadProxy"); | 58 TRACE_EVENT0("cc", "SingleThreadProxy::~SingleThreadProxy"); |
| 63 DCHECK(Proxy::IsMainThread()); | 59 DCHECK(Proxy::IsMainThread()); |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 227 DCHECK(!scroll_info->scrolls.size()); | 223 DCHECK(!scroll_info->scrolls.size()); |
| 228 DCHECK_EQ(1.f, scroll_info->page_scale_delta); | 224 DCHECK_EQ(1.f, scroll_info->page_scale_delta); |
| 229 #endif | 225 #endif |
| 230 | 226 |
| 231 RenderingStatsInstrumentation* stats_instrumentation = | 227 RenderingStatsInstrumentation* stats_instrumentation = |
| 232 layer_tree_host_->rendering_stats_instrumentation(); | 228 layer_tree_host_->rendering_stats_instrumentation(); |
| 233 benchmark_instrumentation::IssueMainThreadRenderingStatsEvent( | 229 benchmark_instrumentation::IssueMainThreadRenderingStatsEvent( |
| 234 stats_instrumentation->main_thread_rendering_stats()); | 230 stats_instrumentation->main_thread_rendering_stats()); |
| 235 stats_instrumentation->AccumulateAndClearMainThreadStats(); | 231 stats_instrumentation->AccumulateAndClearMainThreadStats(); |
| 236 } | 232 } |
| 233 | |
| 234 if (layer_tree_host_->settings().impl_side_painting) { | |
| 235 // TODO(enne): just commit directly to the active tree. | |
| 236 // | |
| 237 // Synchronously activate during commit to satisfy any potential | |
| 238 // SetNextCommitWaitsForActivation calls. Unfortunately, the tree | |
| 239 // might not be ready to draw, so DidActivateSyncTree must set | |
| 240 // the flag to force the tree to not draw until textures are ready. | |
| 241 NotifyReadyToActivate(); | |
|
enne (OOO)
2014/08/27 23:53:38
Unfortunateness #1: This works, but feels unsafe.
danakj
2014/09/03 17:01:32
I'm confused, NotifyReadyToActivate won't cause it
enne (OOO)
2014/09/03 19:41:28
Yes, that's exactly it. NotifyReadyToActivate wil
| |
| 242 } else { | |
| 243 CommitComplete(); | |
| 244 } | |
| 245 } | |
| 246 | |
| 247 void SingleThreadProxy::CommitComplete() { | |
| 248 DebugScopedSetMainThread main(this); | |
| 249 | |
| 237 layer_tree_host_->CommitComplete(); | 250 layer_tree_host_->CommitComplete(); |
| 238 layer_tree_host_->DidBeginMainFrame(); | 251 layer_tree_host_->DidBeginMainFrame(); |
| 239 timing_history_.DidCommit(); | 252 timing_history_.DidCommit(); |
| 240 | 253 |
| 241 next_frame_is_newly_committed_frame_ = true; | 254 next_frame_is_newly_committed_frame_ = true; |
| 242 } | 255 } |
| 243 | 256 |
| 244 void SingleThreadProxy::SetNeedsCommit() { | 257 void SingleThreadProxy::SetNeedsCommit() { |
| 245 DCHECK(Proxy::IsMainThread()); | 258 DCHECK(Proxy::IsMainThread()); |
| 246 DebugScopedSetImplThread impl(this); | 259 DebugScopedSetImplThread impl(this); |
| 247 client_->ScheduleComposite(); | 260 client_->ScheduleComposite(); |
| 248 if (scheduler_on_impl_thread_) | 261 if (scheduler_on_impl_thread_) |
| 249 scheduler_on_impl_thread_->SetNeedsCommit(); | 262 scheduler_on_impl_thread_->SetNeedsCommit(); |
| 250 commit_requested_ = true; | 263 commit_requested_ = true; |
| 251 } | 264 } |
| 252 | 265 |
| 253 void SingleThreadProxy::SetNeedsRedraw(const gfx::Rect& damage_rect) { | 266 void SingleThreadProxy::SetNeedsRedraw(const gfx::Rect& damage_rect) { |
| 254 TRACE_EVENT0("cc", "SingleThreadProxy::SetNeedsRedraw"); | 267 TRACE_EVENT0("cc", "SingleThreadProxy::SetNeedsRedraw"); |
| 255 DCHECK(Proxy::IsMainThread()); | 268 DCHECK(Proxy::IsMainThread()); |
| 256 DebugScopedSetImplThread impl(this); | 269 DebugScopedSetImplThread impl(this); |
| 257 client_->ScheduleComposite(); | 270 client_->ScheduleComposite(); |
| 258 SetNeedsRedrawRectOnImplThread(damage_rect); | 271 SetNeedsRedrawRectOnImplThread(damage_rect); |
| 259 } | 272 } |
| 260 | 273 |
| 261 void SingleThreadProxy::SetNextCommitWaitsForActivation() { | 274 void SingleThreadProxy::SetNextCommitWaitsForActivation() { |
| 262 // There is no activation here other than commit. So do nothing. | 275 // Activation always forced in commit, so nothing to do. |
| 263 DCHECK(Proxy::IsMainThread()); | 276 DCHECK(Proxy::IsMainThread()); |
| 264 } | 277 } |
| 265 | 278 |
| 266 void SingleThreadProxy::SetDeferCommits(bool defer_commits) { | 279 void SingleThreadProxy::SetDeferCommits(bool defer_commits) { |
| 267 DCHECK(Proxy::IsMainThread()); | 280 DCHECK(Proxy::IsMainThread()); |
| 268 // Deferring commits only makes sense if there's a scheduler. | 281 // Deferring commits only makes sense if there's a scheduler. |
| 269 if (!scheduler_on_impl_thread_) | 282 if (!scheduler_on_impl_thread_) |
| 270 return; | 283 return; |
| 271 if (defer_commits_ == defer_commits) | 284 if (defer_commits_ == defer_commits) |
| 272 return; | 285 return; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 320 void SingleThreadProxy::OnCanDrawStateChanged(bool can_draw) { | 333 void SingleThreadProxy::OnCanDrawStateChanged(bool can_draw) { |
| 321 TRACE_EVENT1( | 334 TRACE_EVENT1( |
| 322 "cc", "SingleThreadProxy::OnCanDrawStateChanged", "can_draw", can_draw); | 335 "cc", "SingleThreadProxy::OnCanDrawStateChanged", "can_draw", can_draw); |
| 323 DCHECK(Proxy::IsImplThread()); | 336 DCHECK(Proxy::IsImplThread()); |
| 324 UpdateBackgroundAnimateTicking(); | 337 UpdateBackgroundAnimateTicking(); |
| 325 if (scheduler_on_impl_thread_) | 338 if (scheduler_on_impl_thread_) |
| 326 scheduler_on_impl_thread_->SetCanDraw(can_draw); | 339 scheduler_on_impl_thread_->SetCanDraw(can_draw); |
| 327 } | 340 } |
| 328 | 341 |
| 329 void SingleThreadProxy::NotifyReadyToActivate() { | 342 void SingleThreadProxy::NotifyReadyToActivate() { |
| 330 // Impl-side painting only. | 343 TRACE_EVENT0("cc", "SingleThreadProxy::NotifyReadyToActivate"); |
| 331 NOTREACHED(); | 344 DebugScopedSetImplThread impl(this); |
| 345 if (scheduler_on_impl_thread_) | |
| 346 scheduler_on_impl_thread_->NotifyReadyToActivate(); | |
| 332 } | 347 } |
| 333 | 348 |
| 334 void SingleThreadProxy::SetNeedsRedrawOnImplThread() { | 349 void SingleThreadProxy::SetNeedsRedrawOnImplThread() { |
| 335 client_->ScheduleComposite(); | 350 client_->ScheduleComposite(); |
| 336 if (scheduler_on_impl_thread_) | 351 if (scheduler_on_impl_thread_) |
| 337 scheduler_on_impl_thread_->SetNeedsRedraw(); | 352 scheduler_on_impl_thread_->SetNeedsRedraw(); |
| 338 } | 353 } |
| 339 | 354 |
| 340 void SingleThreadProxy::SetNeedsAnimateOnImplThread() { | 355 void SingleThreadProxy::SetNeedsAnimateOnImplThread() { |
| 341 SetNeedsRedrawOnImplThread(); | 356 SetNeedsRedrawOnImplThread(); |
| 342 } | 357 } |
| 343 | 358 |
| 344 void SingleThreadProxy::SetNeedsManageTilesOnImplThread() { | 359 void SingleThreadProxy::SetNeedsManageTilesOnImplThread() { |
| 345 // Impl-side painting only. | 360 TRACE_EVENT0("cc", "SingleThreadProxy::SetNeedsManageTilesOnImplThread"); |
| 346 NOTREACHED(); | 361 if (scheduler_on_impl_thread_) |
| 362 scheduler_on_impl_thread_->SetNeedsManageTiles(); | |
| 347 } | 363 } |
| 348 | 364 |
| 349 void SingleThreadProxy::SetNeedsRedrawRectOnImplThread( | 365 void SingleThreadProxy::SetNeedsRedrawRectOnImplThread( |
| 350 const gfx::Rect& damage_rect) { | 366 const gfx::Rect& damage_rect) { |
| 351 layer_tree_host_impl_->SetViewportDamage(damage_rect); | 367 layer_tree_host_impl_->SetViewportDamage(damage_rect); |
| 352 SetNeedsRedrawOnImplThread(); | 368 SetNeedsRedrawOnImplThread(); |
| 353 } | 369 } |
| 354 | 370 |
| 355 void SingleThreadProxy::DidInitializeVisibleTileOnImplThread() { | 371 void SingleThreadProxy::DidInitializeVisibleTileOnImplThread() { |
| 356 // Impl-side painting only. | 372 TRACE_EVENT0("cc", "SingleThreadProxy::DidInitializeVisibleTileOnImplThread"); |
| 357 NOTREACHED(); | 373 if (scheduler_on_impl_thread_) |
| 374 scheduler_on_impl_thread_->SetNeedsRedraw(); | |
| 358 } | 375 } |
| 359 | 376 |
| 360 void SingleThreadProxy::SetNeedsCommitOnImplThread() { | 377 void SingleThreadProxy::SetNeedsCommitOnImplThread() { |
| 361 client_->ScheduleComposite(); | 378 client_->ScheduleComposite(); |
| 362 if (scheduler_on_impl_thread_) | 379 if (scheduler_on_impl_thread_) |
| 363 scheduler_on_impl_thread_->SetNeedsCommit(); | 380 scheduler_on_impl_thread_->SetNeedsCommit(); |
| 364 } | 381 } |
| 365 | 382 |
| 366 void SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread( | 383 void SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread( |
| 367 scoped_ptr<AnimationEventsVector> events) { | 384 scoped_ptr<AnimationEventsVector> events) { |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 384 | 401 |
| 385 if (!contents_texture_manager || !resource_provider) | 402 if (!contents_texture_manager || !resource_provider) |
| 386 return false; | 403 return false; |
| 387 | 404 |
| 388 return contents_texture_manager->ReduceMemoryOnImplThread( | 405 return contents_texture_manager->ReduceMemoryOnImplThread( |
| 389 limit_bytes, priority_cutoff, resource_provider); | 406 limit_bytes, priority_cutoff, resource_provider); |
| 390 } | 407 } |
| 391 | 408 |
| 392 bool SingleThreadProxy::IsInsideDraw() { return inside_draw_; } | 409 bool SingleThreadProxy::IsInsideDraw() { return inside_draw_; } |
| 393 | 410 |
| 411 void SingleThreadProxy::RenewTreePriority() { | |
| 412 // TODO(enne): Sync directly to the active tree in the future | |
| 413 // so that there isn't two trees. | |
| 414 if (scheduler_on_impl_thread_) | |
| 415 scheduler_on_impl_thread_->SetSmoothnessTakesPriority(false); | |
|
danakj
2014/09/03 17:01:32
Is there really any need to do this? Should we jus
enne (OOO)
2014/09/03 19:41:28
Done.
| |
| 416 } | |
| 417 | |
| 418 void SingleThreadProxy::DidActivateSyncTree() { | |
| 419 // Non-impl-side painting finishes commit in DoCommit. Impl-side painting | |
| 420 // defers until here to simulate SetNextCommitWaitsForActivation. | |
| 421 if (layer_tree_host_impl_->settings().impl_side_painting) { | |
| 422 // This is required because NotifyReadyToActivate gets called when | |
| 423 // the pending tree is not actually ready in the SingleThreadProxy. | |
| 424 layer_tree_host_impl_->active_tree()->SetRequiresHighResToDraw(); | |
|
danakj
2014/09/03 17:01:32
This is going to be bad when we are OOM? We will s
enne (OOO)
2014/09/03 19:41:28
I think the discussion we had today about raster-o
danakj
2014/09/03 19:49:30
Hm, can you explain how? I can see how that would
enne (OOO)
2014/09/03 20:02:48
Looking at TileManager, we only set RasterOnDemand
| |
| 425 | |
| 426 // Since activation could cause tasks to run, post CommitComplete | |
| 427 // separately so that it runs after these tasks. This is the loose | |
| 428 // equivalent of blocking commit until activation and also running | |
| 429 // all tasks posted during commit/activation before CommitComplete. | |
| 430 MainThreadTaskRunner()->PostTask( | |
|
enne (OOO)
2014/08/27 23:53:39
Unfortunateness #2: Because activation is controll
danakj
2014/09/03 17:01:32
Ya, creating a CaptureTasks and holding it thru th
enne (OOO)
2014/09/03 19:41:28
Done.
| |
| 431 FROM_HERE, | |
| 432 base::Bind(&SingleThreadProxy::CommitComplete, | |
| 433 weak_factory_.GetWeakPtr())); | |
| 434 } | |
| 435 | |
| 436 UpdateBackgroundAnimateTicking(); | |
| 437 timing_history_.DidActivateSyncTree(); | |
| 438 } | |
| 439 | |
| 440 void SingleThreadProxy::DidManageTiles() { | |
| 441 DCHECK(layer_tree_host_impl_->settings().impl_side_painting); | |
| 442 DCHECK(Proxy::IsImplThread()); | |
| 443 if (scheduler_on_impl_thread_) | |
| 444 scheduler_on_impl_thread_->DidManageTiles(); | |
| 445 } | |
| 446 | |
| 394 void SingleThreadProxy::UpdateRendererCapabilitiesOnImplThread() { | 447 void SingleThreadProxy::UpdateRendererCapabilitiesOnImplThread() { |
| 395 DCHECK(IsImplThread()); | 448 DCHECK(IsImplThread()); |
| 396 renderer_capabilities_for_main_thread_ = | 449 renderer_capabilities_for_main_thread_ = |
| 397 layer_tree_host_impl_->GetRendererCapabilities().MainThreadCapabilities(); | 450 layer_tree_host_impl_->GetRendererCapabilities().MainThreadCapabilities(); |
| 398 } | 451 } |
| 399 | 452 |
| 400 void SingleThreadProxy::DidManageTiles() { | |
| 401 // Impl-side painting only. | |
| 402 NOTREACHED(); | |
| 403 } | |
| 404 | |
| 405 void SingleThreadProxy::DidLoseOutputSurfaceOnImplThread() { | 453 void SingleThreadProxy::DidLoseOutputSurfaceOnImplThread() { |
| 406 TRACE_EVENT0("cc", "SingleThreadProxy::DidLoseOutputSurfaceOnImplThread"); | 454 TRACE_EVENT0("cc", "SingleThreadProxy::DidLoseOutputSurfaceOnImplThread"); |
| 407 { | 455 { |
| 408 DebugScopedSetMainThread main(this); | 456 DebugScopedSetMainThread main(this); |
| 409 // This must happen before we notify the scheduler as it may try to recreate | 457 // This must happen before we notify the scheduler as it may try to recreate |
| 410 // the output surface if already in BEGIN_IMPL_FRAME_STATE_IDLE. | 458 // the output surface if already in BEGIN_IMPL_FRAME_STATE_IDLE. |
| 411 layer_tree_host_->DidLoseOutputSurface(); | 459 layer_tree_host_->DidLoseOutputSurface(); |
| 412 } | 460 } |
| 413 client_->DidAbortSwapBuffers(); | 461 client_->DidAbortSwapBuffers(); |
| 414 if (scheduler_on_impl_thread_) | 462 if (scheduler_on_impl_thread_) |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 437 | 485 |
| 438 void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) { | 486 void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) { |
| 439 TRACE_EVENT0("cc", "SingleThreadProxy::CompositeImmediately"); | 487 TRACE_EVENT0("cc", "SingleThreadProxy::CompositeImmediately"); |
| 440 DCHECK(Proxy::IsMainThread()); | 488 DCHECK(Proxy::IsMainThread()); |
| 441 DCHECK(!layer_tree_host_->output_surface_lost()); | 489 DCHECK(!layer_tree_host_->output_surface_lost()); |
| 442 | 490 |
| 443 BeginFrameArgs begin_frame_args = BeginFrameArgs::Create( | 491 BeginFrameArgs begin_frame_args = BeginFrameArgs::Create( |
| 444 frame_begin_time, base::TimeTicks(), BeginFrameArgs::DefaultInterval()); | 492 frame_begin_time, base::TimeTicks(), BeginFrameArgs::DefaultInterval()); |
| 445 DoCommit(begin_frame_args); | 493 DoCommit(begin_frame_args); |
| 446 | 494 |
| 495 DCHECK(!layer_tree_host_impl_->settings().impl_side_painting) | |
| 496 << "Impl-side painting and synchronous compositing are not supported."; | |
| 497 | |
| 447 LayerTreeHostImpl::FrameData frame; | 498 LayerTreeHostImpl::FrameData frame; |
| 448 DoComposite(frame_begin_time, &frame); | 499 DoComposite(frame_begin_time, &frame); |
| 449 } | 500 } |
| 450 | 501 |
| 451 void SingleThreadProxy::AsValueInto(base::debug::TracedValue* state) const { | 502 void SingleThreadProxy::AsValueInto(base::debug::TracedValue* state) const { |
| 452 // The following line casts away const modifiers because it is just | 503 // The following line casts away const modifiers because it is just |
| 453 // setting debug state. We still want the AsValue() function and its | 504 // setting debug state. We still want the AsValue() function and its |
| 454 // call chain to be const throughout. | 505 // call chain to be const throughout. |
| 455 DebugScopedSetImplThread impl(const_cast<SingleThreadProxy*>(this)); | 506 DebugScopedSetImplThread impl(const_cast<SingleThreadProxy*>(this)); |
| 456 | 507 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 637 DoCommit(layer_tree_host_impl_->CurrentBeginFrameArgs()); | 688 DoCommit(layer_tree_host_impl_->CurrentBeginFrameArgs()); |
| 638 } | 689 } |
| 639 | 690 |
| 640 void SingleThreadProxy::ScheduledActionAnimate() { | 691 void SingleThreadProxy::ScheduledActionAnimate() { |
| 641 TRACE_EVENT0("cc", "ScheduledActionAnimate"); | 692 TRACE_EVENT0("cc", "ScheduledActionAnimate"); |
| 642 layer_tree_host_impl_->Animate( | 693 layer_tree_host_impl_->Animate( |
| 643 layer_tree_host_impl_->CurrentBeginFrameArgs().frame_time); | 694 layer_tree_host_impl_->CurrentBeginFrameArgs().frame_time); |
| 644 } | 695 } |
| 645 | 696 |
| 646 void SingleThreadProxy::ScheduledActionUpdateVisibleTiles() { | 697 void SingleThreadProxy::ScheduledActionUpdateVisibleTiles() { |
| 647 // Impl-side painting only. | 698 DebugScopedSetImplThread impl(this); |
| 648 NOTREACHED(); | 699 layer_tree_host_impl_->UpdateVisibleTiles(); |
| 649 } | 700 } |
| 650 | 701 |
| 651 void SingleThreadProxy::ScheduledActionActivateSyncTree() { | 702 void SingleThreadProxy::ScheduledActionActivateSyncTree() { |
| 703 DebugScopedSetImplThread impl(this); | |
| 704 layer_tree_host_impl_->ActivateSyncTree(); | |
| 652 } | 705 } |
| 653 | 706 |
| 654 void SingleThreadProxy::ScheduledActionBeginOutputSurfaceCreation() { | 707 void SingleThreadProxy::ScheduledActionBeginOutputSurfaceCreation() { |
| 655 DebugScopedSetMainThread main(this); | 708 DebugScopedSetMainThread main(this); |
| 656 DCHECK(scheduler_on_impl_thread_); | 709 DCHECK(scheduler_on_impl_thread_); |
| 657 // If possible, create the output surface in a post task. Synchronously | 710 // If possible, create the output surface in a post task. Synchronously |
| 658 // creating the output surface makes tests more awkward since this differs | 711 // creating the output surface makes tests more awkward since this differs |
| 659 // from the ThreadProxy behavior. However, sometimes there is no | 712 // from the ThreadProxy behavior. However, sometimes there is no |
| 660 // task runner. | 713 // task runner. |
| 661 if (Proxy::MainThreadTaskRunner()) { | 714 if (Proxy::MainThreadTaskRunner()) { |
| 662 MainThreadTaskRunner()->PostTask( | 715 MainThreadTaskRunner()->PostTask( |
| 663 FROM_HERE, | 716 FROM_HERE, |
| 664 base::Bind(&SingleThreadProxy::CreateAndInitializeOutputSurface, | 717 base::Bind(&SingleThreadProxy::CreateAndInitializeOutputSurface, |
| 665 weak_factory_.GetWeakPtr())); | 718 weak_factory_.GetWeakPtr())); |
| 666 } else { | 719 } else { |
| 667 CreateAndInitializeOutputSurface(); | 720 CreateAndInitializeOutputSurface(); |
| 668 } | 721 } |
| 669 } | 722 } |
| 670 | 723 |
| 671 void SingleThreadProxy::ScheduledActionManageTiles() { | 724 void SingleThreadProxy::ScheduledActionManageTiles() { |
| 672 // Impl-side painting only. | 725 TRACE_EVENT0("cc", "SingleThreadProxy::ScheduledActionManageTiles"); |
| 673 NOTREACHED(); | 726 DCHECK(layer_tree_host_impl_->settings().impl_side_painting); |
| 727 DebugScopedSetImplThread impl(this); | |
| 728 layer_tree_host_impl_->ManageTiles(); | |
| 674 } | 729 } |
| 675 | 730 |
| 676 void SingleThreadProxy::DidAnticipatedDrawTimeChange(base::TimeTicks time) { | 731 void SingleThreadProxy::DidAnticipatedDrawTimeChange(base::TimeTicks time) { |
| 677 } | 732 } |
| 678 | 733 |
| 679 base::TimeDelta SingleThreadProxy::DrawDurationEstimate() { | 734 base::TimeDelta SingleThreadProxy::DrawDurationEstimate() { |
| 680 return timing_history_.DrawDurationEstimate(); | 735 return timing_history_.DrawDurationEstimate(); |
| 681 } | 736 } |
| 682 | 737 |
| 683 base::TimeDelta SingleThreadProxy::BeginMainFrameToCommitDurationEstimate() { | 738 base::TimeDelta SingleThreadProxy::BeginMainFrameToCommitDurationEstimate() { |
| 684 return timing_history_.BeginMainFrameToCommitDurationEstimate(); | 739 return timing_history_.BeginMainFrameToCommitDurationEstimate(); |
| 685 } | 740 } |
| 686 | 741 |
| 687 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() { | 742 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() { |
| 688 return timing_history_.CommitToActivateDurationEstimate(); | 743 return timing_history_.CommitToActivateDurationEstimate(); |
| 689 } | 744 } |
| 690 | 745 |
| 691 void SingleThreadProxy::DidBeginImplFrameDeadline() { | 746 void SingleThreadProxy::DidBeginImplFrameDeadline() { |
| 692 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); | 747 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); |
| 693 } | 748 } |
| 694 | 749 |
| 695 } // namespace cc | 750 } // namespace cc |
| OLD | NEW |