| 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 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 | 1005 |
| 1006 node = parent(node); | 1006 node = parent(node); |
| 1007 } | 1007 } |
| 1008 | 1008 |
| 1009 if (node->has_copy_request) | 1009 if (node->has_copy_request) |
| 1010 return node->id; | 1010 return node->id; |
| 1011 else | 1011 else |
| 1012 return EffectTree::kInvalidNodeId; | 1012 return EffectTree::kInvalidNodeId; |
| 1013 } | 1013 } |
| 1014 | 1014 |
| 1015 int EffectTree::LowestCommonAncestorWithRenderSurface(int id_1, |
| 1016 int id_2) const { |
| 1017 DCHECK(GetRenderSurface(id_1)); |
| 1018 DCHECK(GetRenderSurface(id_2)); |
| 1019 while (id_1 != id_2) { |
| 1020 if (id_1 < id_2) |
| 1021 id_2 = Node(id_2)->target_id; |
| 1022 else |
| 1023 id_1 = Node(id_1)->target_id; |
| 1024 } |
| 1025 |
| 1026 return id_1; |
| 1027 } |
| 1028 |
| 1015 void EffectTree::AddMaskLayerId(int id) { | 1029 void EffectTree::AddMaskLayerId(int id) { |
| 1016 mask_layer_ids_.push_back(id); | 1030 mask_layer_ids_.push_back(id); |
| 1017 } | 1031 } |
| 1018 | 1032 |
| 1019 void EffectTree::UpdateRenderSurfaces(LayerTreeImpl* layer_tree_impl, | 1033 void EffectTree::UpdateRenderSurfaces(LayerTreeImpl* layer_tree_impl, |
| 1020 bool non_root_surfaces_enabled) { | 1034 bool non_root_surfaces_enabled) { |
| 1021 for (int id = kContentsRootNodeId; id < static_cast<int>(size()); ++id) { | 1035 for (int id = kContentsRootNodeId; id < static_cast<int>(size()); ++id) { |
| 1022 EffectNode* effect_node = Node(id); | 1036 EffectNode* effect_node = Node(id); |
| 1023 bool needs_render_surface = | 1037 bool needs_render_surface = |
| 1024 id == kContentsRootNodeId || | 1038 id == kContentsRootNodeId || |
| (...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2132 const EffectNode* effect_node = effect_tree.Node(effect_id); | 2146 const EffectNode* effect_node = effect_tree.Node(effect_id); |
| 2133 | 2147 |
| 2134 if (effect_node->surface_contents_scale.x() != 0.0 && | 2148 if (effect_node->surface_contents_scale.x() != 0.0 && |
| 2135 effect_node->surface_contents_scale.y() != 0.0) | 2149 effect_node->surface_contents_scale.y() != 0.0) |
| 2136 screen_space_transform.Scale(1.0 / effect_node->surface_contents_scale.x(), | 2150 screen_space_transform.Scale(1.0 / effect_node->surface_contents_scale.x(), |
| 2137 1.0 / effect_node->surface_contents_scale.y()); | 2151 1.0 / effect_node->surface_contents_scale.y()); |
| 2138 return screen_space_transform; | 2152 return screen_space_transform; |
| 2139 } | 2153 } |
| 2140 | 2154 |
| 2141 } // namespace cc | 2155 } // namespace cc |
| OLD | NEW |