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

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

Issue 2172003002: cc: Compute transform to target using effect id. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: handlePAC Created 4 years, 5 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 void SetContentTargetId(int node_id, int content_target_id); 230 void SetContentTargetId(int node_id, int content_target_id);
231 231
232 const std::vector<TransformCachedNodeData>& cached_data() const { 232 const std::vector<TransformCachedNodeData>& cached_data() const {
233 return cached_data_; 233 return cached_data_;
234 } 234 }
235 235
236 void ToProtobuf(proto::PropertyTree* proto) const; 236 void ToProtobuf(proto::PropertyTree* proto) const;
237 void FromProtobuf(const proto::PropertyTree& proto, 237 void FromProtobuf(const proto::PropertyTree& proto,
238 std::unordered_map<int, int>* node_id_to_index_map); 238 std::unordered_map<int, int>* node_id_to_index_map);
239 239
240 private:
241 // Returns true iff the node at |desc_id| is a descendant of the node at
242 // |anc_id|.
243 bool IsDescendant(int desc_id, int anc_id) const;
244
245 // Computes the combined transform between |source_id| and |dest_id| and 240 // Computes the combined transform between |source_id| and |dest_id| and
246 // returns false if the inverse of a singular transform was used. These two 241 // returns false if the inverse of a singular transform was used. These two
247 // nodes must be on the same ancestor chain. 242 // nodes must be on the same ancestor chain.
248 bool CombineTransformsBetween(int source_id, 243 bool CombineTransformsBetween(int source_id,
249 int dest_id, 244 int dest_id,
250 gfx::Transform* transform) const; 245 gfx::Transform* transform) const;
251 246
252 // Computes the combined inverse transform between |source_id| and |dest_id| 247 // Computes the combined inverse transform between |source_id| and |dest_id|
253 // and returns false if the inverse of a singular transform was used. These 248 // and returns false if the inverse of a singular transform was used. These
254 // two nodes must be on the same ancestor chain. 249 // two nodes must be on the same ancestor chain.
255 bool CombineInversesBetween(int source_id, 250 bool CombineInversesBetween(int source_id,
256 int dest_id, 251 int dest_id,
257 gfx::Transform* transform) const; 252 gfx::Transform* transform) const;
258 253
254 private:
255 // Returns true iff the node at |desc_id| is a descendant of the node at
256 // |anc_id|.
257 bool IsDescendant(int desc_id, int anc_id) const;
258
259 void UpdateLocalTransform(TransformNode* node); 259 void UpdateLocalTransform(TransformNode* node);
260 void UpdateScreenSpaceTransform(TransformNode* node, 260 void UpdateScreenSpaceTransform(TransformNode* node,
261 TransformNode* parent_node, 261 TransformNode* parent_node,
262 TransformNode* target_node); 262 TransformNode* target_node);
263 void UpdateSurfaceContentsScale(TransformNode* node); 263 void UpdateSurfaceContentsScale(TransformNode* node);
264 void UpdateTargetSpaceTransform(TransformNode* node, 264 void UpdateTargetSpaceTransform(TransformNode* node,
265 TransformNode* target_node); 265 TransformNode* target_node);
266 void UpdateAnimationProperties(TransformNode* node, 266 void UpdateAnimationProperties(TransformNode* node,
267 TransformNode* parent_node); 267 TransformNode* parent_node);
268 void UndoSnapping(TransformNode* node); 268 void UndoSnapping(TransformNode* node);
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 CombinedAnimationScale GetAnimationScales(int transform_node_id, 537 CombinedAnimationScale GetAnimationScales(int transform_node_id,
538 LayerTreeImpl* layer_tree_impl); 538 LayerTreeImpl* layer_tree_impl);
539 void SetAnimationScalesForTesting(int transform_id, 539 void SetAnimationScalesForTesting(int transform_id,
540 float maximum_animation_scale, 540 float maximum_animation_scale,
541 float starting_animation_scale); 541 float starting_animation_scale);
542 void ResetCachedData(); 542 void ResetCachedData();
543 void UpdateCachedNumber(); 543 void UpdateCachedNumber();
544 gfx::Transform ToScreenSpaceTransformWithoutSurfaceContentsScale( 544 gfx::Transform ToScreenSpaceTransformWithoutSurfaceContentsScale(
545 int transform_id, 545 int transform_id,
546 int effect_id) const; 546 int effect_id) const;
547 bool ComputeTransformToTarget(int transform_id,
548 int effect_id,
549 gfx::Transform* transform) const;
547 550
548 private: 551 private:
549 gfx::Vector2dF inner_viewport_container_bounds_delta_; 552 gfx::Vector2dF inner_viewport_container_bounds_delta_;
550 gfx::Vector2dF outer_viewport_container_bounds_delta_; 553 gfx::Vector2dF outer_viewport_container_bounds_delta_;
551 gfx::Vector2dF inner_viewport_scroll_bounds_delta_; 554 gfx::Vector2dF inner_viewport_scroll_bounds_delta_;
552 555
553 PropertyTreesCachedData cached_data_; 556 PropertyTreesCachedData cached_data_;
554 }; 557 };
555 558
556 } // namespace cc 559 } // namespace cc
557 560
558 #endif // CC_TREES_PROPERTY_TREE_H_ 561 #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