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_impl.h" | 5 #include "cc/trees/layer_tree_impl.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "cc/animation/keyframed_animation_curve.h" | 8 #include "cc/animation/keyframed_animation_curve.h" |
9 #include "cc/animation/scrollbar_animation_controller.h" | 9 #include "cc/animation/scrollbar_animation_controller.h" |
10 #include "cc/animation/scrollbar_animation_controller_linear_fade.h" | 10 #include "cc/animation/scrollbar_animation_controller_linear_fade.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 page_scale_delta_(1), | 90 page_scale_delta_(1), |
91 sent_page_scale_delta_(1), | 91 sent_page_scale_delta_(1), |
92 min_page_scale_factor_(0), | 92 min_page_scale_factor_(0), |
93 max_page_scale_factor_(0), | 93 max_page_scale_factor_(0), |
94 scrolling_layer_id_from_previous_tree_(0), | 94 scrolling_layer_id_from_previous_tree_(0), |
95 contents_textures_purged_(false), | 95 contents_textures_purged_(false), |
96 requires_high_res_to_draw_(false), | 96 requires_high_res_to_draw_(false), |
97 viewport_size_invalid_(false), | 97 viewport_size_invalid_(false), |
98 needs_update_draw_properties_(true), | 98 needs_update_draw_properties_(true), |
99 needs_full_tree_sync_(true), | 99 needs_full_tree_sync_(true), |
100 next_activation_forces_redraw_(false) {} | 100 next_activation_forces_redraw_(false), |
| 101 render_surface_layer_list_id_(0) { |
| 102 } |
101 | 103 |
102 LayerTreeImpl::~LayerTreeImpl() { | 104 LayerTreeImpl::~LayerTreeImpl() { |
103 // Need to explicitly clear the tree prior to destroying this so that | 105 // Need to explicitly clear the tree prior to destroying this so that |
104 // the LayerTreeImpl pointer is still valid in the LayerImpl dtor. | 106 // the LayerTreeImpl pointer is still valid in the LayerImpl dtor. |
105 DCHECK(!root_layer_); | 107 DCHECK(!root_layer_); |
106 DCHECK(layers_with_copy_output_request_.empty()); | 108 DCHECK(layers_with_copy_output_request_.empty()); |
107 } | 109 } |
108 | 110 |
109 void LayerTreeImpl::Shutdown() { root_layer_.reset(); } | 111 void LayerTreeImpl::Shutdown() { root_layer_.reset(); } |
110 | 112 |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 TRACE_EVENT2("cc", | 452 TRACE_EVENT2("cc", |
451 "LayerTreeImpl::UpdateDrawProperties", | 453 "LayerTreeImpl::UpdateDrawProperties", |
452 "IsActive", | 454 "IsActive", |
453 IsActiveTree(), | 455 IsActiveTree(), |
454 "SourceFrameNumber", | 456 "SourceFrameNumber", |
455 source_frame_number_); | 457 source_frame_number_); |
456 LayerImpl* page_scale_layer = | 458 LayerImpl* page_scale_layer = |
457 page_scale_layer_ ? page_scale_layer_ : InnerViewportContainerLayer(); | 459 page_scale_layer_ ? page_scale_layer_ : InnerViewportContainerLayer(); |
458 bool can_render_to_separate_surface = | 460 bool can_render_to_separate_surface = |
459 !output_surface()->ForcedDrawToSoftwareDevice(); | 461 !output_surface()->ForcedDrawToSoftwareDevice(); |
| 462 |
| 463 ++render_surface_layer_list_id_; |
460 LayerTreeHostCommon::CalcDrawPropsImplInputs inputs( | 464 LayerTreeHostCommon::CalcDrawPropsImplInputs inputs( |
461 root_layer(), | 465 root_layer(), |
462 DrawViewportSize(), | 466 DrawViewportSize(), |
463 layer_tree_host_impl_->DrawTransform(), | 467 layer_tree_host_impl_->DrawTransform(), |
464 device_scale_factor(), | 468 device_scale_factor(), |
465 total_page_scale_factor(), | 469 total_page_scale_factor(), |
466 page_scale_layer, | 470 page_scale_layer, |
467 MaxTextureSize(), | 471 MaxTextureSize(), |
468 settings().can_use_lcd_text, | 472 settings().can_use_lcd_text, |
469 can_render_to_separate_surface, | 473 can_render_to_separate_surface, |
470 settings().layer_transforms_should_scale_layer_contents, | 474 settings().layer_transforms_should_scale_layer_contents, |
471 &render_surface_layer_list_); | 475 &render_surface_layer_list_, |
| 476 render_surface_layer_list_id_); |
472 LayerTreeHostCommon::CalculateDrawProperties(&inputs); | 477 LayerTreeHostCommon::CalculateDrawProperties(&inputs); |
473 } | 478 } |
474 | 479 |
475 { | 480 { |
476 TRACE_EVENT2("cc", | 481 TRACE_EVENT2("cc", |
477 "LayerTreeImpl::UpdateTilePriorities", | 482 "LayerTreeImpl::UpdateTilePriorities", |
478 "IsActive", | 483 "IsActive", |
479 IsActiveTree(), | 484 IsActiveTree(), |
480 "SourceFrameNumber", | 485 "SourceFrameNumber", |
481 source_frame_number_); | 486 source_frame_number_); |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest() | 989 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest() |
985 const { | 990 const { |
986 // Only the active tree needs to know about layers with copy requests, as | 991 // Only the active tree needs to know about layers with copy requests, as |
987 // they are aborted if not serviced during draw. | 992 // they are aborted if not serviced during draw. |
988 DCHECK(IsActiveTree()); | 993 DCHECK(IsActiveTree()); |
989 | 994 |
990 return layers_with_copy_output_request_; | 995 return layers_with_copy_output_request_; |
991 } | 996 } |
992 | 997 |
993 } // namespace cc | 998 } // namespace cc |
OLD | NEW |