summaryrefslogtreecommitdiffstats
path: root/cc/trees/property_tree.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc/trees/property_tree.cc')
-rw-r--r--cc/trees/property_tree.cc45
1 files changed, 37 insertions, 8 deletions
diff --git a/cc/trees/property_tree.cc b/cc/trees/property_tree.cc
index 20e446b..f00563b 100644
--- a/cc/trees/property_tree.cc
+++ b/cc/trees/property_tree.cc
@@ -156,19 +156,12 @@ bool TransformTree::NeedsSourceToParentUpdate(TransformNode* node) {
node->parent_id != node->data.source_node_id);
}
-static bool AffectedByBoundsDelta(TransformNode* node) {
- return node->data.affected_by_inner_viewport_bounds_delta_x ||
- node->data.affected_by_inner_viewport_bounds_delta_y ||
- node->data.affected_by_outer_viewport_bounds_delta_x ||
- node->data.affected_by_outer_viewport_bounds_delta_y;
-}
-
void TransformTree::UpdateTransforms(int id) {
TransformNode* node = Node(id);
TransformNode* parent_node = parent(node);
TransformNode* target_node = Node(node->data.target_id);
if (node->data.needs_local_transform_update ||
- NeedsSourceToParentUpdate(node) || AffectedByBoundsDelta(node))
+ NeedsSourceToParentUpdate(node))
UpdateLocalTransform(node);
UpdateScreenSpaceTransform(node, parent_node, target_node);
UpdateSublayerScale(node);
@@ -426,6 +419,42 @@ void TransformTree::UpdateSnapping(TransformNode* node) {
node->data.scroll_snap = translation;
}
+void TransformTree::SetInnerViewportBoundsDelta(gfx::Vector2dF bounds_delta) {
+ if (inner_viewport_bounds_delta_ == bounds_delta)
+ return;
+
+ inner_viewport_bounds_delta_ = bounds_delta;
+
+ if (nodes_affected_by_inner_viewport_bounds_delta_.empty())
+ return;
+
+ set_needs_update(true);
+ for (int i : nodes_affected_by_inner_viewport_bounds_delta_)
+ Node(i)->data.needs_local_transform_update = true;
+}
+
+void TransformTree::SetOuterViewportBoundsDelta(gfx::Vector2dF bounds_delta) {
+ if (outer_viewport_bounds_delta_ == bounds_delta)
+ return;
+
+ outer_viewport_bounds_delta_ = bounds_delta;
+
+ if (nodes_affected_by_outer_viewport_bounds_delta_.empty())
+ return;
+
+ set_needs_update(true);
+ for (int i : nodes_affected_by_outer_viewport_bounds_delta_)
+ Node(i)->data.needs_local_transform_update = true;
+}
+
+void TransformTree::AddNodeAffectedByInnerViewportBoundsDelta(int node_id) {
+ nodes_affected_by_inner_viewport_bounds_delta_.push_back(node_id);
+}
+
+void TransformTree::AddNodeAffectedByOuterViewportBoundsDelta(int node_id) {
+ nodes_affected_by_outer_viewport_bounds_delta_.push_back(node_id);
+}
+
void OpacityTree::UpdateOpacities(int id) {
OpacityNode* node = Node(id);
node->data.screen_space_opacity = node->data.opacity;