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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 | 360 |
361 { | 361 { |
362 TRACE_EVENT0("cc", "LayerTreeHost::PushProperties"); | 362 TRACE_EVENT0("cc", "LayerTreeHost::PushProperties"); |
363 TreeSynchronizer::PushProperties(root_layer(), sync_tree->root_layer()); | 363 TreeSynchronizer::PushProperties(root_layer(), sync_tree->root_layer()); |
364 } | 364 } |
365 | 365 |
366 micro_benchmark_controller_.ScheduleImplBenchmarks(host_impl); | 366 micro_benchmark_controller_.ScheduleImplBenchmarks(host_impl); |
367 } | 367 } |
368 | 368 |
369 void LayerTreeHost::WillCommit() { | 369 void LayerTreeHost::WillCommit() { |
| 370 OnCommitForSwapPromises(); |
370 client_->WillCommit(); | 371 client_->WillCommit(); |
371 } | 372 } |
372 | 373 |
373 void LayerTreeHost::UpdateHudLayer() { | 374 void LayerTreeHost::UpdateHudLayer() { |
374 if (debug_state_.ShowHudInfo()) { | 375 if (debug_state_.ShowHudInfo()) { |
375 if (!hud_layer_.get()) { | 376 if (!hud_layer_.get()) { |
376 LayerSettings hud_layer_settings; | 377 LayerSettings hud_layer_settings; |
377 hud_layer_settings.use_compositor_animation_timelines = | 378 hud_layer_settings.use_compositor_animation_timelines = |
378 settings_.use_compositor_animation_timelines; | 379 settings_.use_compositor_animation_timelines; |
379 hud_layer_ = HeadsUpDisplayLayer::Create(hud_layer_settings); | 380 hud_layer_ = HeadsUpDisplayLayer::Create(hud_layer_settings); |
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1263 DCHECK(swap_promise); | 1264 DCHECK(swap_promise); |
1264 swap_promise_list_.push_back(swap_promise.Pass()); | 1265 swap_promise_list_.push_back(swap_promise.Pass()); |
1265 } | 1266 } |
1266 | 1267 |
1267 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { | 1268 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { |
1268 for (auto* swap_promise : swap_promise_list_) | 1269 for (auto* swap_promise : swap_promise_list_) |
1269 swap_promise->DidNotSwap(reason); | 1270 swap_promise->DidNotSwap(reason); |
1270 swap_promise_list_.clear(); | 1271 swap_promise_list_.clear(); |
1271 } | 1272 } |
1272 | 1273 |
| 1274 void LayerTreeHost::OnCommitForSwapPromises() { |
| 1275 for (auto* swap_promise : swap_promise_list_) |
| 1276 swap_promise->OnCommit(); |
| 1277 } |
| 1278 |
1273 void LayerTreeHost::set_surface_id_namespace(uint32_t id_namespace) { | 1279 void LayerTreeHost::set_surface_id_namespace(uint32_t id_namespace) { |
1274 surface_id_namespace_ = id_namespace; | 1280 surface_id_namespace_ = id_namespace; |
1275 } | 1281 } |
1276 | 1282 |
1277 SurfaceSequence LayerTreeHost::CreateSurfaceSequence() { | 1283 SurfaceSequence LayerTreeHost::CreateSurfaceSequence() { |
1278 return SurfaceSequence(surface_id_namespace_, next_surface_sequence_++); | 1284 return SurfaceSequence(surface_id_namespace_, next_surface_sequence_++); |
1279 } | 1285 } |
1280 | 1286 |
1281 void LayerTreeHost::SetChildrenNeedBeginFrames( | 1287 void LayerTreeHost::SetChildrenNeedBeginFrames( |
1282 bool children_need_begin_frames) const { | 1288 bool children_need_begin_frames) const { |
(...skipping 11 matching lines...) Expand all Loading... |
1294 } | 1300 } |
1295 | 1301 |
1296 void LayerTreeHost::RecordFrameTimingEvents( | 1302 void LayerTreeHost::RecordFrameTimingEvents( |
1297 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, | 1303 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, |
1298 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { | 1304 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { |
1299 client_->RecordFrameTimingEvents(composite_events.Pass(), | 1305 client_->RecordFrameTimingEvents(composite_events.Pass(), |
1300 main_frame_events.Pass()); | 1306 main_frame_events.Pass()); |
1301 } | 1307 } |
1302 | 1308 |
1303 } // namespace cc | 1309 } // namespace cc |
OLD | NEW |