| 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 <vector> | 10 #include <vector> |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 bool affected_by_inner_viewport_bounds_delta_y : 1; | 128 bool affected_by_inner_viewport_bounds_delta_y : 1; |
| 129 bool affected_by_outer_viewport_bounds_delta_x : 1; | 129 bool affected_by_outer_viewport_bounds_delta_x : 1; |
| 130 bool affected_by_outer_viewport_bounds_delta_y : 1; | 130 bool affected_by_outer_viewport_bounds_delta_y : 1; |
| 131 | 131 |
| 132 // Layer scale factor is used as a fallback when we either cannot adjust | 132 // Layer scale factor is used as a fallback when we either cannot adjust |
| 133 // raster scale or if the raster scale cannot be extracted from the screen | 133 // raster scale or if the raster scale cannot be extracted from the screen |
| 134 // space transform. For layers in the subtree of the page scale layer, the | 134 // space transform. For layers in the subtree of the page scale layer, the |
| 135 // layer scale factor should include the page scale factor. | 135 // layer scale factor should include the page scale factor. |
| 136 bool in_subtree_of_page_scale_layer : 1; | 136 bool in_subtree_of_page_scale_layer : 1; |
| 137 | 137 |
| 138 // We need to track changes to to_screen transform to compute the damage rect. |
| 139 bool transform_changed : 1; |
| 140 |
| 138 // TODO(vollick): will be moved when accelerated effects are implemented. | 141 // TODO(vollick): will be moved when accelerated effects are implemented. |
| 139 float post_local_scale_factor; | 142 float post_local_scale_factor; |
| 140 | 143 |
| 141 // The maximum scale that that node's |local| transform will have during | 144 // The maximum scale that that node's |local| transform will have during |
| 142 // current animations, considering only scales at keyframes not including the | 145 // current animations, considering only scales at keyframes not including the |
| 143 // starting keyframe of each animation. | 146 // starting keyframe of each animation. |
| 144 float local_maximum_animation_target_scale; | 147 float local_maximum_animation_target_scale; |
| 145 | 148 |
| 146 // The maximum scale that this node's |local| transform will have during | 149 // The maximum scale that this node's |local| transform will have during |
| 147 // current animatons, considering only the starting scale of each animation. | 150 // current animatons, considering only the starting scale of each animation. |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 // iff the inverse of a singular transform was used (and the result should, | 381 // iff the inverse of a singular transform was used (and the result should, |
| 379 // therefore, not be trusted). | 382 // therefore, not be trusted). |
| 380 bool ComputeTransformWithSourceSublayerScale(int source_id, | 383 bool ComputeTransformWithSourceSublayerScale(int source_id, |
| 381 int dest_id, | 384 int dest_id, |
| 382 gfx::Transform* transform) const; | 385 gfx::Transform* transform) const; |
| 383 | 386 |
| 384 // Returns true iff the nodes indexed by |source_id| and |dest_id| are 2D axis | 387 // Returns true iff the nodes indexed by |source_id| and |dest_id| are 2D axis |
| 385 // aligned with respect to one another. | 388 // aligned with respect to one another. |
| 386 bool Are2DAxisAligned(int source_id, int dest_id) const; | 389 bool Are2DAxisAligned(int source_id, int dest_id) const; |
| 387 | 390 |
| 391 void ResetChangeTracking(); |
| 388 // Updates the parent, target, and screen space transforms and snapping. | 392 // Updates the parent, target, and screen space transforms and snapping. |
| 389 void UpdateTransforms(int id); | 393 void UpdateTransforms(int id); |
| 390 | 394 |
| 391 // A TransformNode's source_to_parent value is used to account for the fact | 395 // A TransformNode's source_to_parent value is used to account for the fact |
| 392 // that fixed-position layers are positioned by Blink wrt to their layer tree | 396 // that fixed-position layers are positioned by Blink wrt to their layer tree |
| 393 // parent (their "source"), but are parented in the transform tree by their | 397 // parent (their "source"), but are parented in the transform tree by their |
| 394 // fixed-position container. This value needs to be updated on main-thread | 398 // fixed-position container. This value needs to be updated on main-thread |
| 395 // property trees (for position changes initiated by Blink), but not on the | 399 // property trees (for position changes initiated by Blink), but not on the |
| 396 // compositor thread (since the offset from a node corresponding to a | 400 // compositor thread (since the offset from a node corresponding to a |
| 397 // fixed-position layer to its fixed-position container is unaffected by | 401 // fixed-position layer to its fixed-position container is unaffected by |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 void UpdateScreenSpaceTransform(TransformNode* node, | 471 void UpdateScreenSpaceTransform(TransformNode* node, |
| 468 TransformNode* parent_node, | 472 TransformNode* parent_node, |
| 469 TransformNode* target_node); | 473 TransformNode* target_node); |
| 470 void UpdateSublayerScale(TransformNode* node); | 474 void UpdateSublayerScale(TransformNode* node); |
| 471 void UpdateTargetSpaceTransform(TransformNode* node, | 475 void UpdateTargetSpaceTransform(TransformNode* node, |
| 472 TransformNode* target_node); | 476 TransformNode* target_node); |
| 473 void UpdateAnimationProperties(TransformNode* node, | 477 void UpdateAnimationProperties(TransformNode* node, |
| 474 TransformNode* parent_node); | 478 TransformNode* parent_node); |
| 475 void UndoSnapping(TransformNode* node); | 479 void UndoSnapping(TransformNode* node); |
| 476 void UpdateSnapping(TransformNode* node); | 480 void UpdateSnapping(TransformNode* node); |
| 481 void UpdateTransformChanged(TransformNode* node, |
| 482 TransformNode* parent_node, |
| 483 TransformNode* source_node); |
| 477 void UpdateNodeAndAncestorsHaveIntegerTranslations( | 484 void UpdateNodeAndAncestorsHaveIntegerTranslations( |
| 478 TransformNode* node, | 485 TransformNode* node, |
| 479 TransformNode* parent_node); | 486 TransformNode* parent_node); |
| 480 bool NeedsSourceToParentUpdate(TransformNode* node); | 487 bool NeedsSourceToParentUpdate(TransformNode* node); |
| 481 | 488 |
| 482 bool source_to_parent_updates_allowed_; | 489 bool source_to_parent_updates_allowed_; |
| 483 // When to_screen transform has perspective, the transform node's sublayer | 490 // When to_screen transform has perspective, the transform node's sublayer |
| 484 // scale is calculated using page scale factor, device scale factor and the | 491 // scale is calculated using page scale factor, device scale factor and the |
| 485 // scale factor of device transform. So we need to store them explicitly. | 492 // scale factor of device transform. So we need to store them explicitly. |
| 486 float page_scale_factor_; | 493 float page_scale_factor_; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 | 576 |
| 570 private: | 577 private: |
| 571 gfx::Vector2dF inner_viewport_container_bounds_delta_; | 578 gfx::Vector2dF inner_viewport_container_bounds_delta_; |
| 572 gfx::Vector2dF outer_viewport_container_bounds_delta_; | 579 gfx::Vector2dF outer_viewport_container_bounds_delta_; |
| 573 gfx::Vector2dF inner_viewport_scroll_bounds_delta_; | 580 gfx::Vector2dF inner_viewport_scroll_bounds_delta_; |
| 574 }; | 581 }; |
| 575 | 582 |
| 576 } // namespace cc | 583 } // namespace cc |
| 577 | 584 |
| 578 #endif // CC_TREES_PROPERTY_TREE_H_ | 585 #endif // CC_TREES_PROPERTY_TREE_H_ |
| OLD | NEW |