| 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_common.h" | 5 #include "cc/trees/layer_tree_host_common.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 if (!layer_is_drawn) | 462 if (!layer_is_drawn) |
| 463 return true; | 463 return true; |
| 464 | 464 |
| 465 // If layer is on the pending tree and opacity is being animated then | 465 // If layer is on the pending tree and opacity is being animated then |
| 466 // this subtree can't be skipped as we need to create, prioritize and | 466 // this subtree can't be skipped as we need to create, prioritize and |
| 467 // include tiles for this layer when deciding if tree can be activated. | 467 // include tiles for this layer when deciding if tree can be activated. |
| 468 if (layer->layer_tree_impl()->IsPendingTree() && | 468 if (layer->layer_tree_impl()->IsPendingTree() && |
| 469 layer->HasPotentiallyRunningOpacityAnimation()) | 469 layer->HasPotentiallyRunningOpacityAnimation()) |
| 470 return false; | 470 return false; |
| 471 | 471 |
| 472 // If layer has a background filter, don't skip the layer, even it the |
| 473 // opacity is 0. |
| 474 if (!layer->background_filters().IsEmpty()) |
| 475 return false; |
| 476 |
| 472 // The opacity of a layer always applies to its children (either implicitly | 477 // The opacity of a layer always applies to its children (either implicitly |
| 473 // via a render surface or explicitly if the parent preserves 3D), so the | 478 // via a render surface or explicitly if the parent preserves 3D), so the |
| 474 // entire subtree can be skipped if this layer is fully transparent. | 479 // entire subtree can be skipped if this layer is fully transparent. |
| 475 return !layer->opacity(); | 480 return !layer->opacity(); |
| 476 } | 481 } |
| 477 | 482 |
| 478 static inline void SavePaintPropertiesLayer(LayerImpl* layer) {} | 483 static inline void SavePaintPropertiesLayer(LayerImpl* layer) {} |
| 479 | 484 |
| 480 static bool SubtreeShouldRenderToSeparateSurface( | 485 static bool SubtreeShouldRenderToSeparateSurface( |
| 481 Layer* layer, | 486 Layer* layer, |
| (...skipping 2099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2581 | 2586 |
| 2582 PropertyTrees* GetPropertyTrees(Layer* layer) { | 2587 PropertyTrees* GetPropertyTrees(Layer* layer) { |
| 2583 return layer->layer_tree_host()->property_trees(); | 2588 return layer->layer_tree_host()->property_trees(); |
| 2584 } | 2589 } |
| 2585 | 2590 |
| 2586 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { | 2591 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { |
| 2587 return layer->layer_tree_impl()->property_trees(); | 2592 return layer->layer_tree_impl()->property_trees(); |
| 2588 } | 2593 } |
| 2589 | 2594 |
| 2590 } // namespace cc | 2595 } // namespace cc |
| OLD | NEW |