Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: cc/trees/property_tree.h

Issue 2758343002: cc: Use Element Id to Record Animation Changes (Closed)
Patch Set: fix for test Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_impl.cc ('k') | cc/trees/property_tree.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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);
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
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
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_
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_impl.cc ('k') | cc/trees/property_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698