summaryrefslogtreecommitdiffstats
path: root/cc/trees/property_tree.cc
diff options
context:
space:
mode:
authorjaydasika <jaydasika@chromium.org>2015-08-27 18:41:47 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-28 01:42:40 +0000
commitfd10e64a2896ae9aacce1c98878b970cbffff1c7 (patch)
tree0eb58f98f31495d74c65e00832c6abfc2ce62d33 /cc/trees/property_tree.cc
parent418515fe1be862f97a71d55ff8c0dc671ee99e87 (diff)
downloadchromium_src-fd10e64a2896ae9aacce1c98878b970cbffff1c7.zip
chromium_src-fd10e64a2896ae9aacce1c98878b970cbffff1c7.tar.gz
chromium_src-fd10e64a2896ae9aacce1c98878b970cbffff1c7.tar.bz2
Update Viewport Clip in LayerTreeHostImpl::SetViewportSize
If LayerTreeHostImpl::SetViewportSize updates viewport and we do hit testing before the activation of the pending tree, the active tree uses the old properties. So, its necessary to update clip tree as soon as viewport size changes. CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1318113003 Cr-Commit-Position: refs/heads/master@{#346049}
Diffstat (limited to 'cc/trees/property_tree.cc')
-rw-r--r--cc/trees/property_tree.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/cc/trees/property_tree.cc b/cc/trees/property_tree.cc
index df3e3cc..d65a142 100644
--- a/cc/trees/property_tree.cc
+++ b/cc/trees/property_tree.cc
@@ -591,6 +591,22 @@ void TransformTree::UpdateNodeAndAncestorsHaveIntegerTranslations(
parent_node->data.node_and_ancestors_have_only_integer_translation;
}
+void ClipTree::SetViewportClip(gfx::RectF viewport_rect) {
+ if (size() < 2)
+ return;
+ ClipNode* node = Node(1);
+ if (viewport_rect == node->data.clip)
+ return;
+ node->data.clip = viewport_rect;
+ set_needs_update(true);
+}
+
+gfx::RectF ClipTree::ViewportClip() {
+ const unsigned long min_size = 1;
+ DCHECK_GT(size(), min_size);
+ return Node(1)->data.clip;
+}
+
PropertyTrees::PropertyTrees() : needs_rebuild(true), sequence_number(0) {
}