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/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <stack> | 8 #include <stack> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 scoped_ptr<LayerTreeHost> LayerTreeHost::CreateThreaded( | 62 scoped_ptr<LayerTreeHost> LayerTreeHost::CreateThreaded( |
63 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, | 63 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
64 InitParams* params) { | 64 InitParams* params) { |
65 DCHECK(params->main_task_runner.get()); | 65 DCHECK(params->main_task_runner.get()); |
66 DCHECK(impl_task_runner.get()); | 66 DCHECK(impl_task_runner.get()); |
67 DCHECK(params->settings); | 67 DCHECK(params->settings); |
68 scoped_ptr<LayerTreeHost> layer_tree_host(new LayerTreeHost(params)); | 68 scoped_ptr<LayerTreeHost> layer_tree_host(new LayerTreeHost(params)); |
69 layer_tree_host->InitializeThreaded( | 69 layer_tree_host->InitializeThreaded( |
70 params->main_task_runner, impl_task_runner, | 70 params->main_task_runner, impl_task_runner, |
71 params->external_begin_frame_source.Pass()); | 71 std::move(params->external_begin_frame_source)); |
72 return layer_tree_host.Pass(); | 72 return layer_tree_host; |
73 } | 73 } |
74 | 74 |
75 scoped_ptr<LayerTreeHost> LayerTreeHost::CreateSingleThreaded( | 75 scoped_ptr<LayerTreeHost> LayerTreeHost::CreateSingleThreaded( |
76 LayerTreeHostSingleThreadClient* single_thread_client, | 76 LayerTreeHostSingleThreadClient* single_thread_client, |
77 InitParams* params) { | 77 InitParams* params) { |
78 DCHECK(params->settings); | 78 DCHECK(params->settings); |
79 scoped_ptr<LayerTreeHost> layer_tree_host(new LayerTreeHost(params)); | 79 scoped_ptr<LayerTreeHost> layer_tree_host(new LayerTreeHost(params)); |
80 layer_tree_host->InitializeSingleThreaded( | 80 layer_tree_host->InitializeSingleThreaded( |
81 single_thread_client, params->main_task_runner, | 81 single_thread_client, params->main_task_runner, |
82 params->external_begin_frame_source.Pass()); | 82 std::move(params->external_begin_frame_source)); |
83 return layer_tree_host.Pass(); | 83 return layer_tree_host; |
84 } | 84 } |
85 | 85 |
86 LayerTreeHost::LayerTreeHost(InitParams* params) | 86 LayerTreeHost::LayerTreeHost(InitParams* params) |
87 : micro_benchmark_controller_(this), | 87 : micro_benchmark_controller_(this), |
88 next_ui_resource_id_(1), | 88 next_ui_resource_id_(1), |
89 needs_full_tree_sync_(true), | 89 needs_full_tree_sync_(true), |
90 needs_meta_info_recomputation_(true), | 90 needs_meta_info_recomputation_(true), |
91 client_(params->client), | 91 client_(params->client), |
92 source_frame_number_(0), | 92 source_frame_number_(0), |
93 meta_information_sequence_number_(1), | 93 meta_information_sequence_number_(1), |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 debug_state_.RecordRenderingStats()); | 133 debug_state_.RecordRenderingStats()); |
134 } | 134 } |
135 | 135 |
136 void LayerTreeHost::InitializeThreaded( | 136 void LayerTreeHost::InitializeThreaded( |
137 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 137 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
138 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, | 138 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
139 scoped_ptr<BeginFrameSource> external_begin_frame_source) { | 139 scoped_ptr<BeginFrameSource> external_begin_frame_source) { |
140 task_runner_provider_ = | 140 task_runner_provider_ = |
141 TaskRunnerProvider::Create(main_task_runner, impl_task_runner); | 141 TaskRunnerProvider::Create(main_task_runner, impl_task_runner); |
142 InitializeProxy(ThreadProxy::Create(this, task_runner_provider_.get(), | 142 InitializeProxy(ThreadProxy::Create(this, task_runner_provider_.get(), |
143 external_begin_frame_source.Pass())); | 143 std::move(external_begin_frame_source))); |
144 } | 144 } |
145 | 145 |
146 void LayerTreeHost::InitializeSingleThreaded( | 146 void LayerTreeHost::InitializeSingleThreaded( |
147 LayerTreeHostSingleThreadClient* single_thread_client, | 147 LayerTreeHostSingleThreadClient* single_thread_client, |
148 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 148 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
149 scoped_ptr<BeginFrameSource> external_begin_frame_source) { | 149 scoped_ptr<BeginFrameSource> external_begin_frame_source) { |
150 task_runner_provider_ = TaskRunnerProvider::Create(main_task_runner, nullptr); | 150 task_runner_provider_ = TaskRunnerProvider::Create(main_task_runner, nullptr); |
151 InitializeProxy(SingleThreadProxy::Create( | 151 InitializeProxy(SingleThreadProxy::Create( |
152 this, single_thread_client, task_runner_provider_.get(), | 152 this, single_thread_client, task_runner_provider_.get(), |
153 external_begin_frame_source.Pass())); | 153 std::move(external_begin_frame_source))); |
154 } | 154 } |
155 | 155 |
156 void LayerTreeHost::InitializeForTesting( | 156 void LayerTreeHost::InitializeForTesting( |
157 scoped_ptr<TaskRunnerProvider> task_runner_provider, | 157 scoped_ptr<TaskRunnerProvider> task_runner_provider, |
158 scoped_ptr<Proxy> proxy_for_testing) { | 158 scoped_ptr<Proxy> proxy_for_testing) { |
159 task_runner_provider_ = task_runner_provider.Pass(); | 159 task_runner_provider_ = std::move(task_runner_provider); |
160 InitializeProxy(proxy_for_testing.Pass()); | 160 InitializeProxy(std::move(proxy_for_testing)); |
161 } | 161 } |
162 | 162 |
163 void LayerTreeHost::InitializeProxy(scoped_ptr<Proxy> proxy) { | 163 void LayerTreeHost::InitializeProxy(scoped_ptr<Proxy> proxy) { |
164 TRACE_EVENT0("cc", "LayerTreeHost::InitializeForReal"); | 164 TRACE_EVENT0("cc", "LayerTreeHost::InitializeForReal"); |
165 | 165 |
166 proxy_ = proxy.Pass(); | 166 proxy_ = std::move(proxy); |
167 proxy_->Start(); | 167 proxy_->Start(); |
168 if (settings_.accelerated_animation_enabled) { | 168 if (settings_.accelerated_animation_enabled) { |
169 if (animation_host_) | 169 if (animation_host_) |
170 animation_host_->SetSupportsScrollAnimations( | 170 animation_host_->SetSupportsScrollAnimations( |
171 proxy_->SupportsImplScrolling()); | 171 proxy_->SupportsImplScrolling()); |
172 else | 172 else |
173 animation_registrar_->set_supports_scroll_animations( | 173 animation_registrar_->set_supports_scroll_animations( |
174 proxy_->SupportsImplScrolling()); | 174 proxy_->SupportsImplScrolling()); |
175 } | 175 } |
176 } | 176 } |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 | 314 |
315 host_impl->SetViewportSize(device_viewport_size_); | 315 host_impl->SetViewportSize(device_viewport_size_); |
316 // TODO(senorblanco): Move this up so that it happens before GPU rasterization | 316 // TODO(senorblanco): Move this up so that it happens before GPU rasterization |
317 // properties are set, since those trigger an update of GPU rasterization | 317 // properties are set, since those trigger an update of GPU rasterization |
318 // status, which depends on the device scale factor. (crbug.com/535700) | 318 // status, which depends on the device scale factor. (crbug.com/535700) |
319 sync_tree->SetDeviceScaleFactor(device_scale_factor_); | 319 sync_tree->SetDeviceScaleFactor(device_scale_factor_); |
320 sync_tree->set_painted_device_scale_factor(painted_device_scale_factor_); | 320 sync_tree->set_painted_device_scale_factor(painted_device_scale_factor_); |
321 host_impl->SetDebugState(debug_state_); | 321 host_impl->SetDebugState(debug_state_); |
322 if (pending_page_scale_animation_) { | 322 if (pending_page_scale_animation_) { |
323 sync_tree->SetPendingPageScaleAnimation( | 323 sync_tree->SetPendingPageScaleAnimation( |
324 pending_page_scale_animation_.Pass()); | 324 std::move(pending_page_scale_animation_)); |
325 } | 325 } |
326 | 326 |
327 if (!ui_resource_request_queue_.empty()) { | 327 if (!ui_resource_request_queue_.empty()) { |
328 sync_tree->set_ui_resource_request_queue(ui_resource_request_queue_); | 328 sync_tree->set_ui_resource_request_queue(ui_resource_request_queue_); |
329 ui_resource_request_queue_.clear(); | 329 ui_resource_request_queue_.clear(); |
330 } | 330 } |
331 | 331 |
332 DCHECK(!sync_tree->ViewportSizeInvalid()); | 332 DCHECK(!sync_tree->ViewportSizeInvalid()); |
333 | 333 |
334 sync_tree->set_has_ever_been_drawn(false); | 334 sync_tree->set_has_ever_been_drawn(false); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 did_complete_scale_animation_ = false; | 380 did_complete_scale_animation_ = false; |
381 } | 381 } |
382 } | 382 } |
383 | 383 |
384 void LayerTreeHost::SetOutputSurface(scoped_ptr<OutputSurface> surface) { | 384 void LayerTreeHost::SetOutputSurface(scoped_ptr<OutputSurface> surface) { |
385 TRACE_EVENT0("cc", "LayerTreeHost::SetOutputSurface"); | 385 TRACE_EVENT0("cc", "LayerTreeHost::SetOutputSurface"); |
386 DCHECK(output_surface_lost_); | 386 DCHECK(output_surface_lost_); |
387 DCHECK(surface); | 387 DCHECK(surface); |
388 | 388 |
389 DCHECK(!new_output_surface_); | 389 DCHECK(!new_output_surface_); |
390 new_output_surface_ = surface.Pass(); | 390 new_output_surface_ = std::move(surface); |
391 proxy_->SetOutputSurface(new_output_surface_.get()); | 391 proxy_->SetOutputSurface(new_output_surface_.get()); |
392 } | 392 } |
393 | 393 |
394 scoped_ptr<OutputSurface> LayerTreeHost::ReleaseOutputSurface() { | 394 scoped_ptr<OutputSurface> LayerTreeHost::ReleaseOutputSurface() { |
395 DCHECK(!visible_); | 395 DCHECK(!visible_); |
396 DCHECK(!output_surface_lost_); | 396 DCHECK(!output_surface_lost_); |
397 | 397 |
398 DidLoseOutputSurface(); | 398 DidLoseOutputSurface(); |
399 proxy_->ReleaseOutputSurface(); | 399 proxy_->ReleaseOutputSurface(); |
400 return current_output_surface_.Pass(); | 400 return std::move(current_output_surface_); |
401 } | 401 } |
402 | 402 |
403 void LayerTreeHost::RequestNewOutputSurface() { | 403 void LayerTreeHost::RequestNewOutputSurface() { |
404 client_->RequestNewOutputSurface(); | 404 client_->RequestNewOutputSurface(); |
405 } | 405 } |
406 | 406 |
407 void LayerTreeHost::DidInitializeOutputSurface() { | 407 void LayerTreeHost::DidInitializeOutputSurface() { |
408 DCHECK(new_output_surface_); | 408 DCHECK(new_output_surface_); |
409 output_surface_lost_ = false; | 409 output_surface_lost_ = false; |
410 current_output_surface_ = new_output_surface_.Pass(); | 410 current_output_surface_ = std::move(new_output_surface_); |
411 client_->DidInitializeOutputSurface(); | 411 client_->DidInitializeOutputSurface(); |
412 } | 412 } |
413 | 413 |
414 void LayerTreeHost::DidFailToInitializeOutputSurface() { | 414 void LayerTreeHost::DidFailToInitializeOutputSurface() { |
415 DCHECK(output_surface_lost_); | 415 DCHECK(output_surface_lost_); |
416 DCHECK(new_output_surface_); | 416 DCHECK(new_output_surface_); |
417 // Note: It is safe to drop all output surface references here as | 417 // Note: It is safe to drop all output surface references here as |
418 // LayerTreeHostImpl will not keep a pointer to either the old or | 418 // LayerTreeHostImpl will not keep a pointer to either the old or |
419 // new output surface after failing to initialize the new one. | 419 // new output surface after failing to initialize the new one. |
420 current_output_surface_ = nullptr; | 420 current_output_surface_ = nullptr; |
421 new_output_surface_ = nullptr; | 421 new_output_surface_ = nullptr; |
422 client_->DidFailToInitializeOutputSurface(); | 422 client_->DidFailToInitializeOutputSurface(); |
423 } | 423 } |
424 | 424 |
425 scoped_ptr<LayerTreeHostImpl> LayerTreeHost::CreateLayerTreeHostImpl( | 425 scoped_ptr<LayerTreeHostImpl> LayerTreeHost::CreateLayerTreeHostImpl( |
426 LayerTreeHostImplClient* client) { | 426 LayerTreeHostImplClient* client) { |
427 DCHECK(task_runner_provider_->IsImplThread()); | 427 DCHECK(task_runner_provider_->IsImplThread()); |
428 scoped_ptr<LayerTreeHostImpl> host_impl = LayerTreeHostImpl::Create( | 428 scoped_ptr<LayerTreeHostImpl> host_impl = LayerTreeHostImpl::Create( |
429 settings_, client, task_runner_provider_.get(), | 429 settings_, client, task_runner_provider_.get(), |
430 rendering_stats_instrumentation_.get(), shared_bitmap_manager_, | 430 rendering_stats_instrumentation_.get(), shared_bitmap_manager_, |
431 gpu_memory_buffer_manager_, task_graph_runner_, id_); | 431 gpu_memory_buffer_manager_, task_graph_runner_, id_); |
432 host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_); | 432 host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_); |
433 host_impl->SetContentIsSuitableForGpuRasterization( | 433 host_impl->SetContentIsSuitableForGpuRasterization( |
434 content_is_suitable_for_gpu_rasterization_); | 434 content_is_suitable_for_gpu_rasterization_); |
435 shared_bitmap_manager_ = NULL; | 435 shared_bitmap_manager_ = NULL; |
436 gpu_memory_buffer_manager_ = NULL; | 436 gpu_memory_buffer_manager_ = NULL; |
437 task_graph_runner_ = NULL; | 437 task_graph_runner_ = NULL; |
438 input_handler_weak_ptr_ = host_impl->AsWeakPtr(); | 438 input_handler_weak_ptr_ = host_impl->AsWeakPtr(); |
439 return host_impl.Pass(); | 439 return host_impl; |
440 } | 440 } |
441 | 441 |
442 void LayerTreeHost::DidLoseOutputSurface() { | 442 void LayerTreeHost::DidLoseOutputSurface() { |
443 TRACE_EVENT0("cc", "LayerTreeHost::DidLoseOutputSurface"); | 443 TRACE_EVENT0("cc", "LayerTreeHost::DidLoseOutputSurface"); |
444 DCHECK(task_runner_provider_->IsMainThread()); | 444 DCHECK(task_runner_provider_->IsMainThread()); |
445 | 445 |
446 if (output_surface_lost_) | 446 if (output_surface_lost_) |
447 return; | 447 return; |
448 | 448 |
449 output_surface_lost_ = true; | 449 output_surface_lost_ = true; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 | 530 |
531 void LayerTreeHost::SetNextCommitForcesRedraw() { | 531 void LayerTreeHost::SetNextCommitForcesRedraw() { |
532 next_commit_forces_redraw_ = true; | 532 next_commit_forces_redraw_ = true; |
533 proxy_->SetNeedsUpdateLayers(); | 533 proxy_->SetNeedsUpdateLayers(); |
534 } | 534 } |
535 | 535 |
536 void LayerTreeHost::SetAnimationEvents( | 536 void LayerTreeHost::SetAnimationEvents( |
537 scoped_ptr<AnimationEventsVector> events) { | 537 scoped_ptr<AnimationEventsVector> events) { |
538 DCHECK(task_runner_provider_->IsMainThread()); | 538 DCHECK(task_runner_provider_->IsMainThread()); |
539 if (animation_host_) | 539 if (animation_host_) |
540 animation_host_->SetAnimationEvents(events.Pass()); | 540 animation_host_->SetAnimationEvents(std::move(events)); |
541 else | 541 else |
542 animation_registrar_->SetAnimationEvents(events.Pass()); | 542 animation_registrar_->SetAnimationEvents(std::move(events)); |
543 } | 543 } |
544 | 544 |
545 void LayerTreeHost::SetRootLayer(scoped_refptr<Layer> root_layer) { | 545 void LayerTreeHost::SetRootLayer(scoped_refptr<Layer> root_layer) { |
546 if (root_layer_.get() == root_layer.get()) | 546 if (root_layer_.get() == root_layer.get()) |
547 return; | 547 return; |
548 | 548 |
549 if (root_layer_.get()) | 549 if (root_layer_.get()) |
550 root_layer_->SetLayerTreeHost(NULL); | 550 root_layer_->SetLayerTreeHost(NULL); |
551 root_layer_ = root_layer; | 551 root_layer_ = root_layer; |
552 if (root_layer_.get()) { | 552 if (root_layer_.get()) { |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 return did_paint_content; | 813 return did_paint_content; |
814 } | 814 } |
815 | 815 |
816 void LayerTreeHost::ApplyScrollAndScale(ScrollAndScaleSet* info) { | 816 void LayerTreeHost::ApplyScrollAndScale(ScrollAndScaleSet* info) { |
817 for (auto& swap_promise : info->swap_promises) { | 817 for (auto& swap_promise : info->swap_promises) { |
818 TRACE_EVENT_WITH_FLOW1("input,benchmark", | 818 TRACE_EVENT_WITH_FLOW1("input,benchmark", |
819 "LatencyInfo.Flow", | 819 "LatencyInfo.Flow", |
820 TRACE_ID_DONT_MANGLE(swap_promise->TraceId()), | 820 TRACE_ID_DONT_MANGLE(swap_promise->TraceId()), |
821 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, | 821 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, |
822 "step", "Main thread scroll update"); | 822 "step", "Main thread scroll update"); |
823 QueueSwapPromise(swap_promise.Pass()); | 823 QueueSwapPromise(std::move(swap_promise)); |
824 } | 824 } |
825 | 825 |
826 gfx::Vector2dF inner_viewport_scroll_delta; | 826 gfx::Vector2dF inner_viewport_scroll_delta; |
827 gfx::Vector2dF outer_viewport_scroll_delta; | 827 gfx::Vector2dF outer_viewport_scroll_delta; |
828 | 828 |
829 if (root_layer_.get()) { | 829 if (root_layer_.get()) { |
830 for (size_t i = 0; i < info->scrolls.size(); ++i) { | 830 for (size_t i = 0; i < info->scrolls.size(); ++i) { |
831 Layer* layer = LayerTreeHostCommon::FindLayerInSubtree( | 831 Layer* layer = LayerTreeHostCommon::FindLayerInSubtree( |
832 root_layer_.get(), info->scrolls[i].layer_id); | 832 root_layer_.get(), info->scrolls[i].layer_id); |
833 if (!layer) | 833 if (!layer) |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 return; | 992 return; |
993 | 993 |
994 selection_ = selection; | 994 selection_ = selection; |
995 SetNeedsCommit(); | 995 SetNeedsCommit(); |
996 } | 996 } |
997 | 997 |
998 int LayerTreeHost::ScheduleMicroBenchmark( | 998 int LayerTreeHost::ScheduleMicroBenchmark( |
999 const std::string& benchmark_name, | 999 const std::string& benchmark_name, |
1000 scoped_ptr<base::Value> value, | 1000 scoped_ptr<base::Value> value, |
1001 const MicroBenchmark::DoneCallback& callback) { | 1001 const MicroBenchmark::DoneCallback& callback) { |
1002 return micro_benchmark_controller_.ScheduleRun( | 1002 return micro_benchmark_controller_.ScheduleRun(benchmark_name, |
1003 benchmark_name, value.Pass(), callback); | 1003 std::move(value), callback); |
1004 } | 1004 } |
1005 | 1005 |
1006 bool LayerTreeHost::SendMessageToMicroBenchmark(int id, | 1006 bool LayerTreeHost::SendMessageToMicroBenchmark(int id, |
1007 scoped_ptr<base::Value> value) { | 1007 scoped_ptr<base::Value> value) { |
1008 return micro_benchmark_controller_.SendMessage(id, value.Pass()); | 1008 return micro_benchmark_controller_.SendMessage(id, std::move(value)); |
1009 } | 1009 } |
1010 | 1010 |
1011 void LayerTreeHost::InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor) { | 1011 void LayerTreeHost::InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor) { |
1012 swap_promise_monitor_.insert(monitor); | 1012 swap_promise_monitor_.insert(monitor); |
1013 } | 1013 } |
1014 | 1014 |
1015 void LayerTreeHost::RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor) { | 1015 void LayerTreeHost::RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor) { |
1016 swap_promise_monitor_.erase(monitor); | 1016 swap_promise_monitor_.erase(monitor); |
1017 } | 1017 } |
1018 | 1018 |
1019 void LayerTreeHost::NotifySwapPromiseMonitorsOfSetNeedsCommit() { | 1019 void LayerTreeHost::NotifySwapPromiseMonitorsOfSetNeedsCommit() { |
1020 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); | 1020 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); |
1021 for (; it != swap_promise_monitor_.end(); it++) | 1021 for (; it != swap_promise_monitor_.end(); it++) |
1022 (*it)->OnSetNeedsCommitOnMain(); | 1022 (*it)->OnSetNeedsCommitOnMain(); |
1023 } | 1023 } |
1024 | 1024 |
1025 void LayerTreeHost::QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise) { | 1025 void LayerTreeHost::QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise) { |
1026 DCHECK(swap_promise); | 1026 DCHECK(swap_promise); |
1027 swap_promise_list_.push_back(swap_promise.Pass()); | 1027 swap_promise_list_.push_back(std::move(swap_promise)); |
1028 } | 1028 } |
1029 | 1029 |
1030 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { | 1030 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { |
1031 for (const auto& swap_promise : swap_promise_list_) | 1031 for (const auto& swap_promise : swap_promise_list_) |
1032 swap_promise->DidNotSwap(reason); | 1032 swap_promise->DidNotSwap(reason); |
1033 swap_promise_list_.clear(); | 1033 swap_promise_list_.clear(); |
1034 } | 1034 } |
1035 | 1035 |
1036 void LayerTreeHost::OnCommitForSwapPromises() { | 1036 void LayerTreeHost::OnCommitForSwapPromises() { |
1037 for (const auto& swap_promise : swap_promise_list_) | 1037 for (const auto& swap_promise : swap_promise_list_) |
(...skipping 19 matching lines...) Expand all Loading... |
1057 } | 1057 } |
1058 | 1058 |
1059 void LayerTreeHost::SetAuthoritativeVSyncInterval( | 1059 void LayerTreeHost::SetAuthoritativeVSyncInterval( |
1060 const base::TimeDelta& interval) { | 1060 const base::TimeDelta& interval) { |
1061 proxy_->SetAuthoritativeVSyncInterval(interval); | 1061 proxy_->SetAuthoritativeVSyncInterval(interval); |
1062 } | 1062 } |
1063 | 1063 |
1064 void LayerTreeHost::RecordFrameTimingEvents( | 1064 void LayerTreeHost::RecordFrameTimingEvents( |
1065 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, | 1065 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, |
1066 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { | 1066 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { |
1067 client_->RecordFrameTimingEvents(composite_events.Pass(), | 1067 client_->RecordFrameTimingEvents(std::move(composite_events), |
1068 main_frame_events.Pass()); | 1068 std::move(main_frame_events)); |
1069 } | 1069 } |
1070 | 1070 |
1071 Layer* LayerTreeHost::LayerById(int id) const { | 1071 Layer* LayerTreeHost::LayerById(int id) const { |
1072 LayerIdMap::const_iterator iter = layer_id_map_.find(id); | 1072 LayerIdMap::const_iterator iter = layer_id_map_.find(id); |
1073 return iter != layer_id_map_.end() ? iter->second : NULL; | 1073 return iter != layer_id_map_.end() ? iter->second : NULL; |
1074 } | 1074 } |
1075 | 1075 |
1076 void LayerTreeHost::RegisterLayer(Layer* layer) { | 1076 void LayerTreeHost::RegisterLayer(Layer* layer) { |
1077 DCHECK(!LayerById(layer->id())); | 1077 DCHECK(!LayerById(layer->id())); |
1078 DCHECK(!in_paint_layer_contents_); | 1078 DCHECK(!in_paint_layer_contents_); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1244 return animation_host_ ? animation_host_->HasAnyAnimation(layer->id()) | 1244 return animation_host_ ? animation_host_->HasAnyAnimation(layer->id()) |
1245 : false; | 1245 : false; |
1246 } | 1246 } |
1247 | 1247 |
1248 bool LayerTreeHost::HasActiveAnimation(const Layer* layer) const { | 1248 bool LayerTreeHost::HasActiveAnimation(const Layer* layer) const { |
1249 return animation_host_ ? animation_host_->HasActiveAnimation(layer->id()) | 1249 return animation_host_ ? animation_host_->HasActiveAnimation(layer->id()) |
1250 : false; | 1250 : false; |
1251 } | 1251 } |
1252 | 1252 |
1253 } // namespace cc | 1253 } // namespace cc |
OLD | NEW |