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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 if (parent_node) | 790 if (parent_node) |
791 node->screen_space_opacity *= parent_node->screen_space_opacity; | 791 node->screen_space_opacity *= parent_node->screen_space_opacity; |
792 } | 792 } |
793 | 793 |
794 void EffectTree::UpdateIsDrawn(EffectNode* node, EffectNode* parent_node) { | 794 void EffectTree::UpdateIsDrawn(EffectNode* node, EffectNode* parent_node) { |
795 // Nodes that have screen space opacity 0 are hidden. So they are not drawn. | 795 // Nodes that have screen space opacity 0 are hidden. So they are not drawn. |
796 // Exceptions: | 796 // Exceptions: |
797 // 1) Nodes that contribute to copy requests, whether hidden or not, must be | 797 // 1) Nodes that contribute to copy requests, whether hidden or not, must be |
798 // drawn. | 798 // drawn. |
799 // 2) Nodes that have a background filter. | 799 // 2) Nodes that have a background filter. |
800 // 3) Nodes with animating screen space opacity on main thread or pending tree | 800 // 3) Nodes with animating screen space opacity are drawn if their parent is |
801 // are drawn if their parent is drawn irrespective of their opacity. | 801 // drawn irrespective of their opacity. |
802 if (node->has_copy_request) | 802 if (node->has_copy_request) |
803 node->is_drawn = true; | 803 node->is_drawn = true; |
804 else if (EffectiveOpacity(node) == 0.f && | 804 else if (EffectiveOpacity(node) == 0.f && |
805 (!node->has_potential_opacity_animation || | 805 !node->has_potential_opacity_animation && |
806 property_trees()->is_active) && | |
807 node->background_filters.IsEmpty()) | 806 node->background_filters.IsEmpty()) |
808 node->is_drawn = false; | 807 node->is_drawn = false; |
809 else if (parent_node) | 808 else if (parent_node) |
810 node->is_drawn = parent_node->is_drawn; | 809 node->is_drawn = parent_node->is_drawn; |
811 else | 810 else |
812 node->is_drawn = true; | 811 node->is_drawn = true; |
813 } | 812 } |
814 | 813 |
815 void EffectTree::UpdateEffectChanged(EffectNode* node, | 814 void EffectTree::UpdateEffectChanged(EffectNode* node, |
816 EffectNode* parent_node) { | 815 EffectNode* parent_node) { |
(...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2127 const EffectNode* effect_node = effect_tree.Node(effect_id); | 2126 const EffectNode* effect_node = effect_tree.Node(effect_id); |
2128 | 2127 |
2129 if (effect_node->surface_contents_scale.x() != 0.0 && | 2128 if (effect_node->surface_contents_scale.x() != 0.0 && |
2130 effect_node->surface_contents_scale.y() != 0.0) | 2129 effect_node->surface_contents_scale.y() != 0.0) |
2131 screen_space_transform.Scale(1.0 / effect_node->surface_contents_scale.x(), | 2130 screen_space_transform.Scale(1.0 / effect_node->surface_contents_scale.x(), |
2132 1.0 / effect_node->surface_contents_scale.y()); | 2131 1.0 / effect_node->surface_contents_scale.y()); |
2133 return screen_space_transform; | 2132 return screen_space_transform; |
2134 } | 2133 } |
2135 | 2134 |
2136 } // namespace cc | 2135 } // namespace cc |
OLD | NEW |