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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 property_trees_ = *property_trees; | 377 property_trees_ = *property_trees; |
378 bool render_surfaces_changed = | 378 bool render_surfaces_changed = |
379 property_trees_.effect_tree.CreateOrReuseRenderSurfaces( | 379 property_trees_.effect_tree.CreateOrReuseRenderSurfaces( |
380 &old_render_surfaces, this); | 380 &old_render_surfaces, this); |
381 if (render_surfaces_changed) | 381 if (render_surfaces_changed) |
382 set_needs_update_draw_properties(); | 382 set_needs_update_draw_properties(); |
383 property_trees->effect_tree.PushCopyRequestsTo(&property_trees_.effect_tree); | 383 property_trees->effect_tree.PushCopyRequestsTo(&property_trees_.effect_tree); |
384 property_trees_.is_main_thread = false; | 384 property_trees_.is_main_thread = false; |
385 property_trees_.is_active = IsActiveTree(); | 385 property_trees_.is_active = IsActiveTree(); |
386 property_trees_.transform_tree.set_source_to_parent_updates_allowed(false); | 386 property_trees_.transform_tree.set_source_to_parent_updates_allowed(false); |
| 387 // The value of some effect node properties (like is_drawn) depends on |
| 388 // whether we are on the active tree or not. So, we need to update the |
| 389 // effect tree. |
| 390 if (IsActiveTree()) |
| 391 property_trees_.effect_tree.set_needs_update(true); |
387 } | 392 } |
388 | 393 |
389 void LayerTreeImpl::PushPropertyTreesTo(LayerTreeImpl* target_tree) { | 394 void LayerTreeImpl::PushPropertyTreesTo(LayerTreeImpl* target_tree) { |
390 // Property trees may store damage status. We preserve the active tree | 395 // Property trees may store damage status. We preserve the active tree |
391 // damage status by pushing the damage status from active tree property | 396 // damage status by pushing the damage status from active tree property |
392 // trees to pending tree property trees or by moving it onto the layers. | 397 // trees to pending tree property trees or by moving it onto the layers. |
393 if (target_tree->property_trees()->changed) { | 398 if (target_tree->property_trees()->changed) { |
394 if (property_trees()->sequence_number == | 399 if (property_trees()->sequence_number == |
395 target_tree->property_trees()->sequence_number) | 400 target_tree->property_trees()->sequence_number) |
396 target_tree->property_trees()->PushChangeTrackingTo(property_trees()); | 401 target_tree->property_trees()->PushChangeTrackingTo(property_trees()); |
(...skipping 1704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2101 | 2106 |
2102 void LayerTreeImpl::ResetAllChangeTracking() { | 2107 void LayerTreeImpl::ResetAllChangeTracking() { |
2103 layers_that_should_push_properties_.clear(); | 2108 layers_that_should_push_properties_.clear(); |
2104 // Iterate over all layers, including masks. | 2109 // Iterate over all layers, including masks. |
2105 for (auto& layer : *layers_) | 2110 for (auto& layer : *layers_) |
2106 layer->ResetChangeTracking(); | 2111 layer->ResetChangeTracking(); |
2107 property_trees_.ResetAllChangeTracking(); | 2112 property_trees_.ResetAllChangeTracking(); |
2108 } | 2113 } |
2109 | 2114 |
2110 } // namespace cc | 2115 } // namespace cc |
OLD | NEW |