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_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 11 matching lines...) Expand all Loading... | |
22 #include "cc/base/math_util.h" | 22 #include "cc/base/math_util.h" |
23 #include "cc/base/util.h" | 23 #include "cc/base/util.h" |
24 #include "cc/debug/benchmark_instrumentation.h" | 24 #include "cc/debug/benchmark_instrumentation.h" |
25 #include "cc/debug/debug_rect_history.h" | 25 #include "cc/debug/debug_rect_history.h" |
26 #include "cc/debug/devtools_instrumentation.h" | 26 #include "cc/debug/devtools_instrumentation.h" |
27 #include "cc/debug/frame_rate_counter.h" | 27 #include "cc/debug/frame_rate_counter.h" |
28 #include "cc/debug/paint_time_counter.h" | 28 #include "cc/debug/paint_time_counter.h" |
29 #include "cc/debug/rendering_stats_instrumentation.h" | 29 #include "cc/debug/rendering_stats_instrumentation.h" |
30 #include "cc/debug/traced_value.h" | 30 #include "cc/debug/traced_value.h" |
31 #include "cc/input/page_scale_animation.h" | 31 #include "cc/input/page_scale_animation.h" |
32 #include "cc/input/scroll_elasticity_helper.h" | |
32 #include "cc/input/top_controls_manager.h" | 33 #include "cc/input/top_controls_manager.h" |
33 #include "cc/layers/append_quads_data.h" | 34 #include "cc/layers/append_quads_data.h" |
34 #include "cc/layers/heads_up_display_layer_impl.h" | 35 #include "cc/layers/heads_up_display_layer_impl.h" |
35 #include "cc/layers/layer_impl.h" | 36 #include "cc/layers/layer_impl.h" |
36 #include "cc/layers/layer_iterator.h" | 37 #include "cc/layers/layer_iterator.h" |
37 #include "cc/layers/painted_scrollbar_layer_impl.h" | 38 #include "cc/layers/painted_scrollbar_layer_impl.h" |
38 #include "cc/layers/render_surface_impl.h" | 39 #include "cc/layers/render_surface_impl.h" |
39 #include "cc/layers/scrollbar_layer_impl_base.h" | 40 #include "cc/layers/scrollbar_layer_impl_base.h" |
40 #include "cc/output/compositor_frame_metadata.h" | 41 #include "cc/output/compositor_frame_metadata.h" |
41 #include "cc/output/copy_output_request.h" | 42 #include "cc/output/copy_output_request.h" |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
274 LayerTreeHostImpl::~LayerTreeHostImpl() { | 275 LayerTreeHostImpl::~LayerTreeHostImpl() { |
275 DCHECK(proxy_->IsImplThread()); | 276 DCHECK(proxy_->IsImplThread()); |
276 TRACE_EVENT0("cc", "LayerTreeHostImpl::~LayerTreeHostImpl()"); | 277 TRACE_EVENT0("cc", "LayerTreeHostImpl::~LayerTreeHostImpl()"); |
277 TRACE_EVENT_OBJECT_DELETED_WITH_ID( | 278 TRACE_EVENT_OBJECT_DELETED_WITH_ID( |
278 TRACE_DISABLED_BY_DEFAULT("cc.debug"), "cc::LayerTreeHostImpl", id_); | 279 TRACE_DISABLED_BY_DEFAULT("cc.debug"), "cc::LayerTreeHostImpl", id_); |
279 | 280 |
280 if (input_handler_client_) { | 281 if (input_handler_client_) { |
281 input_handler_client_->WillShutdown(); | 282 input_handler_client_->WillShutdown(); |
282 input_handler_client_ = NULL; | 283 input_handler_client_ = NULL; |
283 } | 284 } |
285 if (scroll_elasticity_helper_) | |
286 scroll_elasticity_helper_.reset(); | |
284 | 287 |
285 // The layer trees must be destroyed before the layer tree host. We've | 288 // The layer trees must be destroyed before the layer tree host. We've |
286 // made a contract with our animation controllers that the registrar | 289 // made a contract with our animation controllers that the registrar |
287 // will outlive them, and we must make good. | 290 // will outlive them, and we must make good. |
288 if (recycle_tree_) | 291 if (recycle_tree_) |
289 recycle_tree_->Shutdown(); | 292 recycle_tree_->Shutdown(); |
290 if (pending_tree_) | 293 if (pending_tree_) |
291 pending_tree_->Shutdown(); | 294 pending_tree_->Shutdown(); |
292 active_tree_->Shutdown(); | 295 active_tree_->Shutdown(); |
293 recycle_tree_ = nullptr; | 296 recycle_tree_ = nullptr; |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
443 return layer_impl != NULL; | 446 return layer_impl != NULL; |
444 } | 447 } |
445 | 448 |
446 scoped_ptr<SwapPromiseMonitor> | 449 scoped_ptr<SwapPromiseMonitor> |
447 LayerTreeHostImpl::CreateLatencyInfoSwapPromiseMonitor( | 450 LayerTreeHostImpl::CreateLatencyInfoSwapPromiseMonitor( |
448 ui::LatencyInfo* latency) { | 451 ui::LatencyInfo* latency) { |
449 return make_scoped_ptr( | 452 return make_scoped_ptr( |
450 new LatencyInfoSwapPromiseMonitor(latency, NULL, this)); | 453 new LatencyInfoSwapPromiseMonitor(latency, NULL, this)); |
451 } | 454 } |
452 | 455 |
456 ScrollElasticityHelper* LayerTreeHostImpl::GetScrollElasticityHelper() { | |
aelias_OOO_until_Jul13
2014/11/13 02:11:03
Could you rename this to CreateScrollElasticityHel
ccameron
2014/11/13 02:45:57
Done.
| |
457 if (!scroll_elasticity_helper_) | |
458 scroll_elasticity_helper_.reset(new ScrollElasticityHelper(this)); | |
459 return scroll_elasticity_helper_.get(); | |
460 } | |
461 | |
453 void LayerTreeHostImpl::QueueSwapPromiseForMainThreadScrollUpdate( | 462 void LayerTreeHostImpl::QueueSwapPromiseForMainThreadScrollUpdate( |
454 scoped_ptr<SwapPromise> swap_promise) { | 463 scoped_ptr<SwapPromise> swap_promise) { |
455 swap_promises_for_main_thread_scroll_update_.push_back(swap_promise.Pass()); | 464 swap_promises_for_main_thread_scroll_update_.push_back(swap_promise.Pass()); |
456 } | 465 } |
457 | 466 |
458 void LayerTreeHostImpl::TrackDamageForAllSurfaces( | 467 void LayerTreeHostImpl::TrackDamageForAllSurfaces( |
459 LayerImpl* root_draw_layer, | 468 LayerImpl* root_draw_layer, |
460 const LayerImplList& render_surface_layer_list) { | 469 const LayerImplList& render_surface_layer_list) { |
461 // For now, we use damage tracking to compute a global scissor. To do this, we | 470 // For now, we use damage tracking to compute a global scissor. To do this, we |
462 // must compute all damage tracking before drawing anything, so that we know | 471 // must compute all damage tracking before drawing anything, so that we know |
(...skipping 2959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3422 } | 3431 } |
3423 | 3432 |
3424 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3433 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
3425 std::vector<PictureLayerImpl*>::iterator it = | 3434 std::vector<PictureLayerImpl*>::iterator it = |
3426 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3435 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
3427 DCHECK(it != picture_layers_.end()); | 3436 DCHECK(it != picture_layers_.end()); |
3428 picture_layers_.erase(it); | 3437 picture_layers_.erase(it); |
3429 } | 3438 } |
3430 | 3439 |
3431 } // namespace cc | 3440 } // namespace cc |
OLD | NEW |