OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 } | 795 } |
796 | 796 |
797 void EffectTree::UpdateIsDrawn(EffectNode* node, EffectNode* parent_node) { | 797 void EffectTree::UpdateIsDrawn(EffectNode* node, EffectNode* parent_node) { |
798 // Nodes that have screen space opacity 0 are hidden. So they are not drawn. | 798 // Nodes that have screen space opacity 0 are hidden. So they are not drawn. |
799 // Exceptions: | 799 // Exceptions: |
800 // 1) Nodes that contribute to copy requests, whether hidden or not, must be | 800 // 1) Nodes that contribute to copy requests, whether hidden or not, must be |
801 // drawn. | 801 // drawn. |
802 // 2) Nodes that have a background filter. | 802 // 2) Nodes that have a background filter. |
803 // 3) Nodes with animating screen space opacity on main thread or pending tree | 803 // 3) Nodes with animating screen space opacity on main thread or pending tree |
804 // are drawn if their parent is drawn irrespective of their opacity. | 804 // are drawn if their parent is drawn irrespective of their opacity. |
805 if (node->has_copy_request) | 805 if (node->has_copy_request || node->cache_render_surface) |
806 node->is_drawn = true; | 806 node->is_drawn = true; |
807 else if (EffectiveOpacity(node) == 0.f && | 807 else if (EffectiveOpacity(node) == 0.f && |
808 (!node->has_potential_opacity_animation || | 808 (!node->has_potential_opacity_animation || |
809 property_trees()->is_active) && | 809 property_trees()->is_active) && |
810 node->background_filters.IsEmpty()) | 810 node->background_filters.IsEmpty()) |
811 node->is_drawn = false; | 811 node->is_drawn = false; |
812 else if (parent_node) | 812 else if (parent_node) |
813 node->is_drawn = parent_node->is_drawn; | 813 node->is_drawn = parent_node->is_drawn; |
814 else | 814 else |
815 node->is_drawn = true; | 815 node->is_drawn = true; |
(...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2178 const EffectNode* effect_node = effect_tree.Node(effect_id); | 2178 const EffectNode* effect_node = effect_tree.Node(effect_id); |
2179 | 2179 |
2180 if (effect_node->surface_contents_scale.x() != 0.0 && | 2180 if (effect_node->surface_contents_scale.x() != 0.0 && |
2181 effect_node->surface_contents_scale.y() != 0.0) | 2181 effect_node->surface_contents_scale.y() != 0.0) |
2182 screen_space_transform.Scale(1.0 / effect_node->surface_contents_scale.x(), | 2182 screen_space_transform.Scale(1.0 / effect_node->surface_contents_scale.x(), |
2183 1.0 / effect_node->surface_contents_scale.y()); | 2183 1.0 / effect_node->surface_contents_scale.y()); |
2184 return screen_space_transform; | 2184 return screen_space_transform; |
2185 } | 2185 } |
2186 | 2186 |
2187 } // namespace cc | 2187 } // namespace cc |
OLD | NEW |