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 #ifndef CC_TREES_PROPERTY_TREE_H_ | 5 #ifndef CC_TREES_PROPERTY_TREE_H_ |
6 #define CC_TREES_PROPERTY_TREE_H_ | 6 #define CC_TREES_PROPERTY_TREE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
97 } | 97 } |
98 PropertyTrees* property_trees() const { return property_trees_; } | 98 PropertyTrees* property_trees() const { return property_trees_; } |
99 | 99 |
100 void AsValueInto(base::trace_event::TracedValue* value) const; | 100 void AsValueInto(base::trace_event::TracedValue* value) const; |
101 | 101 |
102 const T* FindNodeFromOwningLayerId(int id) const { | 102 const T* FindNodeFromOwningLayerId(int id) const { |
103 return Node(FindNodeIndexFromOwningLayerId(id)); | 103 return Node(FindNodeIndexFromOwningLayerId(id)); |
104 } | 104 } |
105 T* UpdateNodeFromOwningLayerId(int id) { | 105 T* UpdateNodeFromOwningLayerId(int id) { |
106 int index = FindNodeIndexFromOwningLayerId(id); | 106 int index = FindNodeIndexFromOwningLayerId(id); |
107 if (index == kInvalidNodeId && property_trees()->is_main_thread) { | 107 if (index == kInvalidNodeId) { |
108 DCHECK(property_trees()->is_main_thread); | |
108 property_trees()->needs_rebuild = true; | 109 property_trees()->needs_rebuild = true; |
109 } | 110 } |
110 | 111 |
111 return Node(index); | 112 return Node(index); |
112 } | 113 } |
113 | 114 |
114 int FindNodeIndexFromOwningLayerId(int id) const { | 115 int FindNodeIndexFromOwningLayerId(int id) const { |
115 auto iter = owning_layer_id_to_node_index.find(id); | 116 auto iter = owning_layer_id_to_node_index.find(id); |
116 if (iter == owning_layer_id_to_node_index.end()) | 117 if (iter == owning_layer_id_to_node_index.end()) |
117 return kInvalidNodeId; | 118 return kInvalidNodeId; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
164 TransformTree& operator=(const TransformTree&); | 165 TransformTree& operator=(const TransformTree&); |
165 | 166 |
166 bool operator==(const TransformTree& other) const; | 167 bool operator==(const TransformTree& other) const; |
167 | 168 |
168 static const int kContentsRootNodeId = 1; | 169 static const int kContentsRootNodeId = 1; |
169 | 170 |
170 int Insert(const TransformNode& tree_node, int parent_id); | 171 int Insert(const TransformNode& tree_node, int parent_id); |
171 | 172 |
172 void clear(); | 173 void clear(); |
173 | 174 |
175 TransformNode* FindNodeFromElementId(ElementId id); | |
wkorman
2017/03/20 21:59:57
Sometimes code guidelines prefer naming methods di
weiliangc
2017/03/21 15:18:52
Since this is a member function on transform/effec
wkorman
2017/03/21 19:44:23
Ah, that's right, I think it's ok as is then.
| |
174 void OnTransformAnimated(const gfx::Transform& transform, | 176 void OnTransformAnimated(const gfx::Transform& transform, |
175 int id, | 177 int id, |
176 LayerTreeImpl* layer_tree_impl); | 178 LayerTreeImpl* layer_tree_impl); |
177 // Computes the change of basis transform from node |source_id| to |dest_id|. | 179 // Computes the change of basis transform from node |source_id| to |dest_id|. |
178 // This is used by scroll children to compute transform from their scroll | 180 // This is used by scroll children to compute transform from their scroll |
179 // parent space (source) to their parent space (destination) and it can atmost | 181 // parent space (source) to their parent space (destination) and it can atmost |
180 // be a translation. This function assumes that the path from source to | 182 // be a translation. This function assumes that the path from source to |
181 // destination has only translations. So, it should not be called when there | 183 // destination has only translations. So, it should not be called when there |
182 // can be intermediate 3d transforms but the end result is a translation. | 184 // can be intermediate 3d transforms but the end result is a translation. |
183 bool ComputeTranslation(int source_id, | 185 bool ComputeTranslation(int source_id, |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
333 static const int kContentsRootNodeId = 1; | 335 static const int kContentsRootNodeId = 1; |
334 | 336 |
335 int Insert(const EffectNode& tree_node, int parent_id); | 337 int Insert(const EffectNode& tree_node, int parent_id); |
336 | 338 |
337 void clear(); | 339 void clear(); |
338 | 340 |
339 float EffectiveOpacity(const EffectNode* node) const; | 341 float EffectiveOpacity(const EffectNode* node) const; |
340 | 342 |
341 void UpdateSurfaceContentsScale(EffectNode* node); | 343 void UpdateSurfaceContentsScale(EffectNode* node); |
342 | 344 |
345 EffectNode* FindNodeFromElementId(ElementId id); | |
343 void OnOpacityAnimated(float opacity, int id, LayerTreeImpl* layer_tree_impl); | 346 void OnOpacityAnimated(float opacity, int id, LayerTreeImpl* layer_tree_impl); |
344 void OnFilterAnimated(const FilterOperations& filters, | 347 void OnFilterAnimated(const FilterOperations& filters, |
345 int id, | 348 int id, |
346 LayerTreeImpl* layer_tree_impl); | 349 LayerTreeImpl* layer_tree_impl); |
347 | 350 |
348 void UpdateEffects(int id); | 351 void UpdateEffects(int id); |
349 | 352 |
350 void UpdateEffectChanged(EffectNode* node, EffectNode* parent_node); | 353 void UpdateEffectChanged(EffectNode* node, EffectNode* parent_node); |
351 | 354 |
352 void AddCopyRequest(int node_id, std::unique_ptr<CopyOutputRequest> request); | 355 void AddCopyRequest(int node_id, std::unique_ptr<CopyOutputRequest> request); |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
688 DrawTransforms& GetDrawTransforms(int transform_id, int effect_id) const; | 691 DrawTransforms& GetDrawTransforms(int transform_id, int effect_id) const; |
689 DrawTransformData& FetchDrawTransformsDataFromCache(int transform_id, | 692 DrawTransformData& FetchDrawTransformsDataFromCache(int transform_id, |
690 int effect_id) const; | 693 int effect_id) const; |
691 | 694 |
692 PropertyTreesCachedData cached_data_; | 695 PropertyTreesCachedData cached_data_; |
693 }; | 696 }; |
694 | 697 |
695 } // namespace cc | 698 } // namespace cc |
696 | 699 |
697 #endif // CC_TREES_PROPERTY_TREE_H_ | 700 #endif // CC_TREES_PROPERTY_TREE_H_ |
OLD | NEW |