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" |
11 #include "cc/animation/animation_events.h" | 11 #include "cc/animation/animation_events.h" |
12 #include "cc/debug/benchmark_instrumentation.h" | 12 #include "cc/debug/benchmark_instrumentation.h" |
13 #include "cc/debug/devtools_instrumentation.h" | 13 #include "cc/debug/devtools_instrumentation.h" |
14 #include "cc/output/compositor_frame_sink.h" | |
14 #include "cc/output/context_provider.h" | 15 #include "cc/output/context_provider.h" |
15 #include "cc/output/output_surface.h" | |
16 #include "cc/quads/draw_quad.h" | 16 #include "cc/quads/draw_quad.h" |
17 #include "cc/resources/ui_resource_manager.h" | 17 #include "cc/resources/ui_resource_manager.h" |
18 #include "cc/scheduler/commit_earlyout_reason.h" | 18 #include "cc/scheduler/commit_earlyout_reason.h" |
19 #include "cc/scheduler/compositor_timing_history.h" | 19 #include "cc/scheduler/compositor_timing_history.h" |
20 #include "cc/scheduler/delay_based_time_source.h" | 20 #include "cc/scheduler/delay_based_time_source.h" |
21 #include "cc/scheduler/scheduler.h" | 21 #include "cc/scheduler/scheduler.h" |
22 #include "cc/trees/layer_tree_host.h" | 22 #include "cc/trees/layer_tree_host.h" |
23 #include "cc/trees/layer_tree_host_common.h" | 23 #include "cc/trees/layer_tree_host_common.h" |
24 #include "cc/trees/layer_tree_host_single_thread_client.h" | 24 #include "cc/trees/layer_tree_host_single_thread_client.h" |
25 #include "cc/trees/layer_tree_impl.h" | 25 #include "cc/trees/layer_tree_impl.h" |
(...skipping 17 matching lines...) Expand all Loading... | |
43 task_runner_provider_(task_runner_provider), | 43 task_runner_provider_(task_runner_provider), |
44 next_frame_is_newly_committed_frame_(false), | 44 next_frame_is_newly_committed_frame_(false), |
45 #if DCHECK_IS_ON() | 45 #if DCHECK_IS_ON() |
46 inside_impl_frame_(false), | 46 inside_impl_frame_(false), |
47 #endif | 47 #endif |
48 inside_draw_(false), | 48 inside_draw_(false), |
49 defer_commits_(false), | 49 defer_commits_(false), |
50 animate_requested_(false), | 50 animate_requested_(false), |
51 commit_requested_(false), | 51 commit_requested_(false), |
52 inside_synchronous_composite_(false), | 52 inside_synchronous_composite_(false), |
53 output_surface_creation_requested_(false), | 53 compositor_frame_sink_creation_requested_(false), |
54 output_surface_lost_(true), | 54 compositor_frame_sink_lost_(true), |
55 weak_factory_(this) { | 55 weak_factory_(this) { |
56 TRACE_EVENT0("cc", "SingleThreadProxy::SingleThreadProxy"); | 56 TRACE_EVENT0("cc", "SingleThreadProxy::SingleThreadProxy"); |
57 DCHECK(task_runner_provider_); | 57 DCHECK(task_runner_provider_); |
58 DCHECK(task_runner_provider_->IsMainThread()); | 58 DCHECK(task_runner_provider_->IsMainThread()); |
59 DCHECK(layer_tree_host); | 59 DCHECK(layer_tree_host); |
60 } | 60 } |
61 | 61 |
62 void SingleThreadProxy::Start( | 62 void SingleThreadProxy::Start( |
63 std::unique_ptr<BeginFrameSource> external_begin_frame_source) { | 63 std::unique_ptr<BeginFrameSource> external_begin_frame_source) { |
64 DebugScopedSetImplThread impl(task_runner_provider_); | 64 DebugScopedSetImplThread impl(task_runner_provider_); |
65 external_begin_frame_source_ = std::move(external_begin_frame_source); | 65 external_begin_frame_source_ = std::move(external_begin_frame_source); |
66 | 66 |
67 const LayerTreeSettings& settings = layer_tree_host_->GetSettings(); | 67 const LayerTreeSettings& settings = layer_tree_host_->GetSettings(); |
68 if (settings.single_thread_proxy_scheduler && !scheduler_on_impl_thread_) { | 68 if (settings.single_thread_proxy_scheduler && !scheduler_on_impl_thread_) { |
69 SchedulerSettings scheduler_settings(settings.ToSchedulerSettings()); | 69 SchedulerSettings scheduler_settings(settings.ToSchedulerSettings()); |
70 scheduler_settings.commit_to_active_tree = CommitToActiveTree(); | 70 scheduler_settings.commit_to_active_tree = CommitToActiveTree(); |
71 | 71 |
72 std::unique_ptr<CompositorTimingHistory> compositor_timing_history( | 72 std::unique_ptr<CompositorTimingHistory> compositor_timing_history( |
73 new CompositorTimingHistory( | 73 new CompositorTimingHistory( |
74 scheduler_settings.using_synchronous_renderer_compositor, | 74 scheduler_settings.using_synchronous_renderer_compositor, |
75 CompositorTimingHistory::BROWSER_UMA, | 75 CompositorTimingHistory::BROWSER_UMA, |
76 layer_tree_host_->rendering_stats_instrumentation())); | 76 layer_tree_host_->rendering_stats_instrumentation())); |
77 | 77 |
78 // TODO(enne): remove these settings. | 78 // TODO(enne): remove these settings. |
79 DCHECK(!settings.use_external_begin_frame_source); | 79 DCHECK(!settings.use_external_begin_frame_source); |
80 DCHECK(settings.use_output_surface_begin_frame_source); | 80 DCHECK(settings.use_compositor_frame_sink_begin_frame_source); |
81 scheduler_on_impl_thread_ = | 81 scheduler_on_impl_thread_ = |
82 Scheduler::Create(this, scheduler_settings, layer_tree_host_->GetId(), | 82 Scheduler::Create(this, scheduler_settings, layer_tree_host_->GetId(), |
83 task_runner_provider_->MainThreadTaskRunner(), | 83 task_runner_provider_->MainThreadTaskRunner(), |
84 external_begin_frame_source_.get(), | 84 external_begin_frame_source_.get(), |
85 std::move(compositor_timing_history)); | 85 std::move(compositor_timing_history)); |
86 } | 86 } |
87 | 87 |
88 layer_tree_host_impl_ = layer_tree_host_->CreateLayerTreeHostImpl(this); | 88 layer_tree_host_impl_ = layer_tree_host_->CreateLayerTreeHostImpl(this); |
89 } | 89 } |
90 | 90 |
(...skipping 18 matching lines...) Expand all Loading... | |
109 void SingleThreadProxy::SetVisible(bool visible) { | 109 void SingleThreadProxy::SetVisible(bool visible) { |
110 TRACE_EVENT1("cc", "SingleThreadProxy::SetVisible", "visible", visible); | 110 TRACE_EVENT1("cc", "SingleThreadProxy::SetVisible", "visible", visible); |
111 DebugScopedSetImplThread impl(task_runner_provider_); | 111 DebugScopedSetImplThread impl(task_runner_provider_); |
112 | 112 |
113 layer_tree_host_impl_->SetVisible(visible); | 113 layer_tree_host_impl_->SetVisible(visible); |
114 | 114 |
115 if (scheduler_on_impl_thread_) | 115 if (scheduler_on_impl_thread_) |
116 scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible()); | 116 scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible()); |
117 } | 117 } |
118 | 118 |
119 void SingleThreadProxy::RequestNewOutputSurface() { | 119 void SingleThreadProxy::RequestNewCompositorFrameSink() { |
120 DCHECK(task_runner_provider_->IsMainThread()); | 120 DCHECK(task_runner_provider_->IsMainThread()); |
121 output_surface_creation_callback_.Cancel(); | 121 compositor_frame_sink_creation_callback_.Cancel(); |
122 if (output_surface_creation_requested_) | 122 if (compositor_frame_sink_creation_requested_) |
123 return; | 123 return; |
124 output_surface_creation_requested_ = true; | 124 compositor_frame_sink_creation_requested_ = true; |
125 layer_tree_host_->RequestNewOutputSurface(); | 125 layer_tree_host_->RequestNewCompositorFrameSink(); |
126 } | 126 } |
127 | 127 |
128 void SingleThreadProxy::ReleaseOutputSurface() { | 128 void SingleThreadProxy::ReleaseCompositorFrameSink() { |
129 output_surface_lost_ = true; | 129 compositor_frame_sink_lost_ = true; |
130 if (scheduler_on_impl_thread_) | 130 if (scheduler_on_impl_thread_) |
131 scheduler_on_impl_thread_->DidLoseOutputSurface(); | 131 scheduler_on_impl_thread_->DidLoseCompositorFrameSink(); |
132 return layer_tree_host_impl_->ReleaseOutputSurface(); | 132 return layer_tree_host_impl_->ReleaseCompositorFrameSink(); |
133 } | 133 } |
134 | 134 |
135 void SingleThreadProxy::SetOutputSurface(OutputSurface* output_surface) { | 135 void SingleThreadProxy::SetCompositorFrameSink( |
136 CompositorFrameSink* compositor_frame_sink) { | |
136 DCHECK(task_runner_provider_->IsMainThread()); | 137 DCHECK(task_runner_provider_->IsMainThread()); |
137 DCHECK(output_surface_creation_requested_); | 138 DCHECK(compositor_frame_sink_creation_requested_); |
138 | 139 |
139 bool success; | 140 bool success; |
140 { | 141 { |
141 DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_); | 142 DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_); |
142 DebugScopedSetImplThread impl(task_runner_provider_); | 143 DebugScopedSetImplThread impl(task_runner_provider_); |
143 success = layer_tree_host_impl_->InitializeRenderer(output_surface); | 144 success = layer_tree_host_impl_->InitializeRenderer(compositor_frame_sink); |
144 } | 145 } |
145 | 146 |
146 if (success) { | 147 if (success) { |
147 layer_tree_host_->DidInitializeOutputSurface(); | 148 layer_tree_host_->DidInitializeCompositorFrameSink(); |
148 if (scheduler_on_impl_thread_) | 149 if (scheduler_on_impl_thread_) |
149 scheduler_on_impl_thread_->DidCreateAndInitializeOutputSurface(); | 150 scheduler_on_impl_thread_->DidCreateAndInitializeCompositorFrameSink(); |
150 else if (!inside_synchronous_composite_) | 151 else if (!inside_synchronous_composite_) |
151 SetNeedsCommit(); | 152 SetNeedsCommit(); |
152 output_surface_creation_requested_ = false; | 153 compositor_frame_sink_creation_requested_ = false; |
153 output_surface_lost_ = false; | 154 compositor_frame_sink_lost_ = false; |
154 } else { | 155 } else { |
155 // DidFailToInitializeOutputSurface is treated as a RequestNewOutputSurface, | 156 // DidFailToInitializeCompositorFrameSink is treated as a |
156 // and so output_surface_creation_requested remains true. | 157 // RequestNewCompositorFrameSink, |
enne (OOO)
2016/09/14 00:35:45
@_@
| |
157 layer_tree_host_->DidFailToInitializeOutputSurface(); | 158 // and so compositor_frame_sink_creation_requested remains true. |
159 layer_tree_host_->DidFailToInitializeCompositorFrameSink(); | |
158 } | 160 } |
159 } | 161 } |
160 | 162 |
161 void SingleThreadProxy::SetNeedsAnimate() { | 163 void SingleThreadProxy::SetNeedsAnimate() { |
162 TRACE_EVENT0("cc", "SingleThreadProxy::SetNeedsAnimate"); | 164 TRACE_EVENT0("cc", "SingleThreadProxy::SetNeedsAnimate"); |
163 DCHECK(task_runner_provider_->IsMainThread()); | 165 DCHECK(task_runner_provider_->IsMainThread()); |
164 client_->RequestScheduleAnimation(); | 166 client_->RequestScheduleAnimation(); |
165 if (animate_requested_) | 167 if (animate_requested_) |
166 return; | 168 return; |
167 animate_requested_ = true; | 169 animate_requested_ = true; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
287 return commit_requested_; | 289 return commit_requested_; |
288 } | 290 } |
289 | 291 |
290 void SingleThreadProxy::Stop() { | 292 void SingleThreadProxy::Stop() { |
291 TRACE_EVENT0("cc", "SingleThreadProxy::stop"); | 293 TRACE_EVENT0("cc", "SingleThreadProxy::stop"); |
292 DCHECK(task_runner_provider_->IsMainThread()); | 294 DCHECK(task_runner_provider_->IsMainThread()); |
293 { | 295 { |
294 DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_); | 296 DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_); |
295 DebugScopedSetImplThread impl(task_runner_provider_); | 297 DebugScopedSetImplThread impl(task_runner_provider_); |
296 | 298 |
297 // Take away the OutputSurface before destroying things so it doesn't try | 299 // Take away the CompositorFrameSink before destroying things so it doesn't |
300 // try | |
enne (OOO)
2016/09/14 00:35:45
@_@
| |
298 // to call into its client mid-shutdown. | 301 // to call into its client mid-shutdown. |
299 layer_tree_host_impl_->ReleaseOutputSurface(); | 302 layer_tree_host_impl_->ReleaseCompositorFrameSink(); |
300 | 303 |
301 BlockingTaskRunner::CapturePostTasks blocked( | 304 BlockingTaskRunner::CapturePostTasks blocked( |
302 task_runner_provider_->blocking_main_thread_task_runner()); | 305 task_runner_provider_->blocking_main_thread_task_runner()); |
303 scheduler_on_impl_thread_ = nullptr; | 306 scheduler_on_impl_thread_ = nullptr; |
304 layer_tree_host_impl_ = nullptr; | 307 layer_tree_host_impl_ = nullptr; |
305 } | 308 } |
306 layer_tree_host_ = NULL; | 309 layer_tree_host_ = NULL; |
307 } | 310 } |
308 | 311 |
309 void SingleThreadProxy::SetMutator(std::unique_ptr<LayerTreeMutator> mutator) { | 312 void SingleThreadProxy::SetMutator(std::unique_ptr<LayerTreeMutator> mutator) { |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
403 void SingleThreadProxy::DidPrepareTiles() { | 406 void SingleThreadProxy::DidPrepareTiles() { |
404 DCHECK(task_runner_provider_->IsImplThread()); | 407 DCHECK(task_runner_provider_->IsImplThread()); |
405 if (scheduler_on_impl_thread_) | 408 if (scheduler_on_impl_thread_) |
406 scheduler_on_impl_thread_->DidPrepareTiles(); | 409 scheduler_on_impl_thread_->DidPrepareTiles(); |
407 } | 410 } |
408 | 411 |
409 void SingleThreadProxy::DidCompletePageScaleAnimationOnImplThread() { | 412 void SingleThreadProxy::DidCompletePageScaleAnimationOnImplThread() { |
410 layer_tree_host_->DidCompletePageScaleAnimation(); | 413 layer_tree_host_->DidCompletePageScaleAnimation(); |
411 } | 414 } |
412 | 415 |
413 void SingleThreadProxy::DidLoseOutputSurfaceOnImplThread() { | 416 void SingleThreadProxy::DidLoseCompositorFrameSinkOnImplThread() { |
414 TRACE_EVENT0("cc", "SingleThreadProxy::DidLoseOutputSurfaceOnImplThread"); | 417 TRACE_EVENT0("cc", |
418 "SingleThreadProxy::DidLoseCompositorFrameSinkOnImplThread"); | |
415 { | 419 { |
416 DebugScopedSetMainThread main(task_runner_provider_); | 420 DebugScopedSetMainThread main(task_runner_provider_); |
417 // This must happen before we notify the scheduler as it may try to recreate | 421 // This must happen before we notify the scheduler as it may try to recreate |
418 // the output surface if already in BEGIN_IMPL_FRAME_STATE_IDLE. | 422 // the output surface if already in BEGIN_IMPL_FRAME_STATE_IDLE. |
419 layer_tree_host_->DidLoseOutputSurface(); | 423 layer_tree_host_->DidLoseCompositorFrameSink(); |
420 } | 424 } |
421 client_->DidAbortSwapBuffers(); | 425 client_->DidAbortSwapBuffers(); |
422 if (scheduler_on_impl_thread_) | 426 if (scheduler_on_impl_thread_) |
423 scheduler_on_impl_thread_->DidLoseOutputSurface(); | 427 scheduler_on_impl_thread_->DidLoseCompositorFrameSink(); |
424 output_surface_lost_ = true; | 428 compositor_frame_sink_lost_ = true; |
425 } | 429 } |
426 | 430 |
427 void SingleThreadProxy::SetBeginFrameSource(BeginFrameSource* source) { | 431 void SingleThreadProxy::SetBeginFrameSource(BeginFrameSource* source) { |
428 DCHECK(layer_tree_host_->GetSettings().single_thread_proxy_scheduler); | 432 DCHECK(layer_tree_host_->GetSettings().single_thread_proxy_scheduler); |
429 // TODO(enne): this overrides any preexisting begin frame source. Those | 433 // TODO(enne): this overrides any preexisting begin frame source. Those |
430 // other sources will eventually be removed and this will be the only path. | 434 // other sources will eventually be removed and this will be the only path. |
431 if (!layer_tree_host_->GetSettings().use_output_surface_begin_frame_source) | 435 if (!layer_tree_host_->GetSettings() |
436 .use_compositor_frame_sink_begin_frame_source) | |
432 return; | 437 return; |
433 if (scheduler_on_impl_thread_) | 438 if (scheduler_on_impl_thread_) |
434 scheduler_on_impl_thread_->SetBeginFrameSource(source); | 439 scheduler_on_impl_thread_->SetBeginFrameSource(source); |
435 } | 440 } |
436 | 441 |
437 void SingleThreadProxy::SetEstimatedParentDrawTime(base::TimeDelta draw_time) { | 442 void SingleThreadProxy::SetEstimatedParentDrawTime(base::TimeDelta draw_time) { |
438 if (scheduler_on_impl_thread_) | 443 if (scheduler_on_impl_thread_) |
439 scheduler_on_impl_thread_->SetEstimatedParentDrawTime(draw_time); | 444 scheduler_on_impl_thread_->SetEstimatedParentDrawTime(draw_time); |
440 } | 445 } |
441 | 446 |
442 void SingleThreadProxy::DidSwapBuffersCompleteOnImplThread() { | 447 void SingleThreadProxy::DidSwapBuffersCompleteOnImplThread() { |
443 TRACE_EVENT0("cc,benchmark", | 448 TRACE_EVENT0("cc,benchmark", |
444 "SingleThreadProxy::DidSwapBuffersCompleteOnImplThread"); | 449 "SingleThreadProxy::DidSwapBuffersCompleteOnImplThread"); |
445 if (scheduler_on_impl_thread_) | 450 if (scheduler_on_impl_thread_) |
446 scheduler_on_impl_thread_->DidSwapBuffersComplete(); | 451 scheduler_on_impl_thread_->DidSwapBuffersComplete(); |
447 layer_tree_host_->DidCompleteSwapBuffers(); | 452 layer_tree_host_->DidCompleteSwapBuffers(); |
448 } | 453 } |
449 | 454 |
450 void SingleThreadProxy::OnDrawForOutputSurface( | 455 void SingleThreadProxy::OnDrawForCompositorFrameSink( |
451 bool resourceless_software_draw) { | 456 bool resourceless_software_draw) { |
452 NOTREACHED() << "Implemented by ThreadProxy for synchronous compositor."; | 457 NOTREACHED() << "Implemented by ThreadProxy for synchronous compositor."; |
453 } | 458 } |
454 | 459 |
455 void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) { | 460 void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) { |
456 TRACE_EVENT0("cc,benchmark", "SingleThreadProxy::CompositeImmediately"); | 461 TRACE_EVENT0("cc,benchmark", "SingleThreadProxy::CompositeImmediately"); |
457 DCHECK(task_runner_provider_->IsMainThread()); | 462 DCHECK(task_runner_provider_->IsMainThread()); |
458 #if DCHECK_IS_ON() | 463 #if DCHECK_IS_ON() |
459 DCHECK(!inside_impl_frame_); | 464 DCHECK(!inside_impl_frame_); |
460 #endif | 465 #endif |
461 base::AutoReset<bool> inside_composite(&inside_synchronous_composite_, true); | 466 base::AutoReset<bool> inside_composite(&inside_synchronous_composite_, true); |
462 | 467 |
463 if (output_surface_lost_) { | 468 if (compositor_frame_sink_lost_) { |
464 RequestNewOutputSurface(); | 469 RequestNewCompositorFrameSink(); |
465 // RequestNewOutputSurface could have synchronously created an output | 470 // RequestNewCompositorFrameSink could have synchronously created an output |
466 // surface, so check again before returning. | 471 // surface, so check again before returning. |
467 if (output_surface_lost_) | 472 if (compositor_frame_sink_lost_) |
468 return; | 473 return; |
469 } | 474 } |
470 | 475 |
471 BeginFrameArgs begin_frame_args(BeginFrameArgs::Create( | 476 BeginFrameArgs begin_frame_args(BeginFrameArgs::Create( |
472 BEGINFRAME_FROM_HERE, frame_begin_time, base::TimeTicks(), | 477 BEGINFRAME_FROM_HERE, frame_begin_time, base::TimeTicks(), |
473 BeginFrameArgs::DefaultInterval(), BeginFrameArgs::NORMAL)); | 478 BeginFrameArgs::DefaultInterval(), BeginFrameArgs::NORMAL)); |
474 | 479 |
475 // Start the impl frame. | 480 // Start the impl frame. |
476 { | 481 { |
477 DebugScopedSetImplThread impl(task_runner_provider_); | 482 DebugScopedSetImplThread impl(task_runner_provider_); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
516 | 521 |
517 bool SingleThreadProxy::SupportsImplScrolling() const { | 522 bool SingleThreadProxy::SupportsImplScrolling() const { |
518 return false; | 523 return false; |
519 } | 524 } |
520 | 525 |
521 bool SingleThreadProxy::ShouldComposite() const { | 526 bool SingleThreadProxy::ShouldComposite() const { |
522 DCHECK(task_runner_provider_->IsImplThread()); | 527 DCHECK(task_runner_provider_->IsImplThread()); |
523 return layer_tree_host_impl_->visible() && layer_tree_host_impl_->CanDraw(); | 528 return layer_tree_host_impl_->visible() && layer_tree_host_impl_->CanDraw(); |
524 } | 529 } |
525 | 530 |
526 void SingleThreadProxy::ScheduleRequestNewOutputSurface() { | 531 void SingleThreadProxy::ScheduleRequestNewCompositorFrameSink() { |
527 if (output_surface_creation_callback_.IsCancelled() && | 532 if (compositor_frame_sink_creation_callback_.IsCancelled() && |
528 !output_surface_creation_requested_) { | 533 !compositor_frame_sink_creation_requested_) { |
529 output_surface_creation_callback_.Reset( | 534 compositor_frame_sink_creation_callback_.Reset( |
530 base::Bind(&SingleThreadProxy::RequestNewOutputSurface, | 535 base::Bind(&SingleThreadProxy::RequestNewCompositorFrameSink, |
531 weak_factory_.GetWeakPtr())); | 536 weak_factory_.GetWeakPtr())); |
532 task_runner_provider_->MainThreadTaskRunner()->PostTask( | 537 task_runner_provider_->MainThreadTaskRunner()->PostTask( |
533 FROM_HERE, output_surface_creation_callback_.callback()); | 538 FROM_HERE, compositor_frame_sink_creation_callback_.callback()); |
534 } | 539 } |
535 } | 540 } |
536 | 541 |
537 DrawResult SingleThreadProxy::DoComposite(LayerTreeHostImpl::FrameData* frame) { | 542 DrawResult SingleThreadProxy::DoComposite(LayerTreeHostImpl::FrameData* frame) { |
538 TRACE_EVENT0("cc", "SingleThreadProxy::DoComposite"); | 543 TRACE_EVENT0("cc", "SingleThreadProxy::DoComposite"); |
539 | 544 |
540 DrawResult draw_result; | 545 DrawResult draw_result; |
541 bool draw_frame; | 546 bool draw_frame; |
542 { | 547 { |
543 DebugScopedSetImplThread impl(task_runner_provider_); | 548 DebugScopedSetImplThread impl(task_runner_provider_); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
718 void SingleThreadProxy::ScheduledActionCommit() { | 723 void SingleThreadProxy::ScheduledActionCommit() { |
719 DebugScopedSetMainThread main(task_runner_provider_); | 724 DebugScopedSetMainThread main(task_runner_provider_); |
720 DoCommit(); | 725 DoCommit(); |
721 } | 726 } |
722 | 727 |
723 void SingleThreadProxy::ScheduledActionActivateSyncTree() { | 728 void SingleThreadProxy::ScheduledActionActivateSyncTree() { |
724 DebugScopedSetImplThread impl(task_runner_provider_); | 729 DebugScopedSetImplThread impl(task_runner_provider_); |
725 layer_tree_host_impl_->ActivateSyncTree(); | 730 layer_tree_host_impl_->ActivateSyncTree(); |
726 } | 731 } |
727 | 732 |
728 void SingleThreadProxy::ScheduledActionBeginOutputSurfaceCreation() { | 733 void SingleThreadProxy::ScheduledActionBeginCompositorFrameSinkCreation() { |
729 DebugScopedSetMainThread main(task_runner_provider_); | 734 DebugScopedSetMainThread main(task_runner_provider_); |
730 DCHECK(scheduler_on_impl_thread_); | 735 DCHECK(scheduler_on_impl_thread_); |
731 // If possible, create the output surface in a post task. Synchronously | 736 // If possible, create the output surface in a post task. Synchronously |
732 // creating the output surface makes tests more awkward since this differs | 737 // creating the output surface makes tests more awkward since this differs |
733 // from the ThreadProxy behavior. However, sometimes there is no | 738 // from the ThreadProxy behavior. However, sometimes there is no |
734 // task runner. | 739 // task runner. |
735 if (task_runner_provider_->MainThreadTaskRunner()) { | 740 if (task_runner_provider_->MainThreadTaskRunner()) { |
736 ScheduleRequestNewOutputSurface(); | 741 ScheduleRequestNewCompositorFrameSink(); |
737 } else { | 742 } else { |
738 RequestNewOutputSurface(); | 743 RequestNewCompositorFrameSink(); |
739 } | 744 } |
740 } | 745 } |
741 | 746 |
742 void SingleThreadProxy::ScheduledActionPrepareTiles() { | 747 void SingleThreadProxy::ScheduledActionPrepareTiles() { |
743 TRACE_EVENT0("cc", "SingleThreadProxy::ScheduledActionPrepareTiles"); | 748 TRACE_EVENT0("cc", "SingleThreadProxy::ScheduledActionPrepareTiles"); |
744 DebugScopedSetImplThread impl(task_runner_provider_); | 749 DebugScopedSetImplThread impl(task_runner_provider_); |
745 layer_tree_host_impl_->PrepareTiles(); | 750 layer_tree_host_impl_->PrepareTiles(); |
746 } | 751 } |
747 | 752 |
748 void SingleThreadProxy::ScheduledActionInvalidateOutputSurface() { | 753 void SingleThreadProxy::ScheduledActionInvalidateCompositorFrameSink() { |
749 NOTREACHED(); | 754 NOTREACHED(); |
750 } | 755 } |
751 | 756 |
752 void SingleThreadProxy::UpdateTopControlsState(TopControlsState constraints, | 757 void SingleThreadProxy::UpdateTopControlsState(TopControlsState constraints, |
753 TopControlsState current, | 758 TopControlsState current, |
754 bool animate) { | 759 bool animate) { |
755 NOTREACHED() << "Top Controls are used only in threaded mode"; | 760 NOTREACHED() << "Top Controls are used only in threaded mode"; |
756 } | 761 } |
757 | 762 |
758 void SingleThreadProxy::DidFinishImplFrame() { | 763 void SingleThreadProxy::DidFinishImplFrame() { |
759 layer_tree_host_impl_->DidFinishImplFrame(); | 764 layer_tree_host_impl_->DidFinishImplFrame(); |
760 #if DCHECK_IS_ON() | 765 #if DCHECK_IS_ON() |
761 DCHECK(inside_impl_frame_) | 766 DCHECK(inside_impl_frame_) |
762 << "DidFinishImplFrame called while not inside an impl frame!"; | 767 << "DidFinishImplFrame called while not inside an impl frame!"; |
763 inside_impl_frame_ = false; | 768 inside_impl_frame_ = false; |
764 #endif | 769 #endif |
765 } | 770 } |
766 | 771 |
767 } // namespace cc | 772 } // namespace cc |
OLD | NEW |