| 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/debug/traced_value.h" | 10 #include "cc/debug/traced_value.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 outer_viewport_scroll_layer_(NULL), | 33 outer_viewport_scroll_layer_(NULL), |
| 34 page_scale_factor_(1), | 34 page_scale_factor_(1), |
| 35 page_scale_delta_(1), | 35 page_scale_delta_(1), |
| 36 sent_page_scale_delta_(1), | 36 sent_page_scale_delta_(1), |
| 37 min_page_scale_factor_(0), | 37 min_page_scale_factor_(0), |
| 38 max_page_scale_factor_(0), | 38 max_page_scale_factor_(0), |
| 39 scrolling_layer_id_from_previous_tree_(0), | 39 scrolling_layer_id_from_previous_tree_(0), |
| 40 contents_textures_purged_(false), | 40 contents_textures_purged_(false), |
| 41 viewport_size_invalid_(false), | 41 viewport_size_invalid_(false), |
| 42 needs_update_draw_properties_(true), | 42 needs_update_draw_properties_(true), |
| 43 needs_full_tree_sync_(true) { | 43 needs_full_tree_sync_(true), |
| 44 next_activation_forces_redraw_(false) { |
| 44 } | 45 } |
| 45 | 46 |
| 46 LayerTreeImpl::~LayerTreeImpl() { | 47 LayerTreeImpl::~LayerTreeImpl() { |
| 47 // Need to explicitly clear the tree prior to destroying this so that | 48 // Need to explicitly clear the tree prior to destroying this so that |
| 48 // the LayerTreeImpl pointer is still valid in the LayerImpl dtor. | 49 // the LayerTreeImpl pointer is still valid in the LayerImpl dtor. |
| 49 root_layer_.reset(); | 50 root_layer_.reset(); |
| 50 } | 51 } |
| 51 | 52 |
| 52 static LayerImpl* FindRootScrollLayerRecursive(LayerImpl* layer) { | 53 static LayerImpl* FindRootScrollLayerRecursive(LayerImpl* layer) { |
| 53 if (!layer) | 54 if (!layer) |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 105 |
| 105 render_surface_layer_list_.clear(); | 106 render_surface_layer_list_.clear(); |
| 106 set_needs_update_draw_properties(); | 107 set_needs_update_draw_properties(); |
| 107 return root_layer_.Pass(); | 108 return root_layer_.Pass(); |
| 108 } | 109 } |
| 109 | 110 |
| 110 void LayerTreeImpl::PushPropertiesTo(LayerTreeImpl* target_tree) { | 111 void LayerTreeImpl::PushPropertiesTo(LayerTreeImpl* target_tree) { |
| 111 // The request queue should have been processed and does not require a push. | 112 // The request queue should have been processed and does not require a push. |
| 112 DCHECK_EQ(ui_resource_request_queue_.size(), 0u); | 113 DCHECK_EQ(ui_resource_request_queue_.size(), 0u); |
| 113 | 114 |
| 115 if (next_activation_forces_redraw_) { |
| 116 layer_tree_host_impl_->SetFullRootLayerDamage(); |
| 117 next_activation_forces_redraw_ = false; |
| 118 } |
| 119 |
| 114 target_tree->SetLatencyInfo(latency_info_); | 120 target_tree->SetLatencyInfo(latency_info_); |
| 115 latency_info_.Clear(); | 121 latency_info_.Clear(); |
| 116 target_tree->SetPageScaleFactorAndLimits( | 122 target_tree->SetPageScaleFactorAndLimits( |
| 117 page_scale_factor(), min_page_scale_factor(), max_page_scale_factor()); | 123 page_scale_factor(), min_page_scale_factor(), max_page_scale_factor()); |
| 118 target_tree->SetPageScaleDelta( | 124 target_tree->SetPageScaleDelta( |
| 119 target_tree->page_scale_delta() / target_tree->sent_page_scale_delta()); | 125 target_tree->page_scale_delta() / target_tree->sent_page_scale_delta()); |
| 120 target_tree->set_sent_page_scale_delta(1); | 126 target_tree->set_sent_page_scale_delta(1); |
| 121 | 127 |
| 122 if (settings().use_pinch_virtual_viewport) { | 128 if (settings().use_pinch_virtual_viewport) { |
| 123 target_tree->SetViewportLayersFromIds( | 129 target_tree->SetViewportLayersFromIds( |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 const std::vector<LayerImpl*> LayerTreeImpl::LayersWithCopyOutputRequest() | 709 const std::vector<LayerImpl*> LayerTreeImpl::LayersWithCopyOutputRequest() |
| 704 const { | 710 const { |
| 705 // Only the active tree needs to know about layers with copy requests, as | 711 // Only the active tree needs to know about layers with copy requests, as |
| 706 // they are aborted if not serviced during draw. | 712 // they are aborted if not serviced during draw. |
| 707 DCHECK(IsActiveTree()); | 713 DCHECK(IsActiveTree()); |
| 708 | 714 |
| 709 return layers_with_copy_output_request_; | 715 return layers_with_copy_output_request_; |
| 710 } | 716 } |
| 711 | 717 |
| 712 } // namespace cc | 718 } // namespace cc |
| OLD | NEW |