summaryrefslogtreecommitdiffstats
path: root/cc/test
diff options
context:
space:
mode:
authorajuma <ajuma@chromium.org>2015-06-25 14:53:02 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-25 21:53:34 +0000
commit6b46da2e972ced90f7ebcce21b355f0d87615f21 (patch)
treec0a77f4af6a35c1bedc532c301106dc230cf611e /cc/test
parentbcc9224a55646e712f5f46ef0906d58ff0733006 (diff)
downloadchromium_src-6b46da2e972ced90f7ebcce21b355f0d87615f21.zip
chromium_src-6b46da2e972ced90f7ebcce21b355f0d87615f21.tar.gz
chromium_src-6b46da2e972ced90f7ebcce21b355f0d87615f21.tar.bz2
cc: Make impl-thread property trees handle bounds delta
This makes the transform tree aware of inner and outer viewport bounds delta, and makes transform nodes know whether their position is affected by inner or outer viewport bounds delta. LayerPositionConstraintTests now pass with verification enabled. BUG=497806 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1159423002 Cr-Commit-Position: refs/heads/master@{#336268}
Diffstat (limited to 'cc/test')
-rw-r--r--cc/test/fake_layer_tree_host.cc12
-rw-r--r--cc/test/layer_tree_host_common_test.cc14
2 files changed, 24 insertions, 2 deletions
diff --git a/cc/test/fake_layer_tree_host.cc b/cc/test/fake_layer_tree_host.cc
index 09f2fc9..d323a8e 100644
--- a/cc/test/fake_layer_tree_host.cc
+++ b/cc/test/fake_layer_tree_host.cc
@@ -4,6 +4,7 @@
#include "cc/test/fake_layer_tree_host.h"
+#include "cc/layers/layer.h"
#include "cc/test/test_task_graph_runner.h"
namespace cc {
@@ -52,6 +53,17 @@ LayerImpl* FakeLayerTreeHost::CommitAndCreateLayerImplTree() {
TreeSynchronizer::PushProperties(root_layer(), layer_impl.get());
active_tree()->SetRootLayer(layer_impl.Pass());
+
+ if (page_scale_layer() && inner_viewport_scroll_layer()) {
+ active_tree()->SetViewportLayersFromIds(
+ overscroll_elasticity_layer() ? overscroll_elasticity_layer()->id()
+ : Layer::INVALID_ID,
+ page_scale_layer()->id(), inner_viewport_scroll_layer()->id(),
+ outer_viewport_scroll_layer() ? outer_viewport_scroll_layer()->id()
+ : Layer::INVALID_ID);
+ }
+
+ active_tree()->UpdatePropertyTreesForBoundsDelta();
return active_tree()->root_layer();
}
diff --git a/cc/test/layer_tree_host_common_test.cc b/cc/test/layer_tree_host_common_test.cc
index e21cc14c..5b12a56 100644
--- a/cc/test/layer_tree_host_common_test.cc
+++ b/cc/test/layer_tree_host_common_test.cc
@@ -91,6 +91,10 @@ void LayerTreeHostCommonTestBase::
preserves_2d_axis_alignment);
Layer* page_scale_layer = nullptr;
+ Layer* inner_viewport_scroll_layer =
+ root_layer->layer_tree_host()->inner_viewport_scroll_layer();
+ Layer* outer_viewport_scroll_layer =
+ root_layer->layer_tree_host()->outer_viewport_scroll_layer();
float page_scale_factor = 1.f;
float device_scale_factor = 1.f;
gfx::Size device_viewport_size =
@@ -98,7 +102,8 @@ void LayerTreeHostCommonTestBase::
root_layer->bounds().height() * device_scale_factor);
LayerList update_layer_list;
BuildPropertyTreesAndComputeVisibleRects(
- root_layer, page_scale_layer, page_scale_factor, device_scale_factor,
+ root_layer, page_scale_layer, inner_viewport_scroll_layer,
+ outer_viewport_scroll_layer, page_scale_factor, device_scale_factor,
gfx::Rect(device_viewport_size), identity_transform,
root_layer->layer_tree_host()->property_trees(), &update_layer_list);
}
@@ -110,6 +115,10 @@ void LayerTreeHostCommonTestBase::
gfx::Transform identity_transform;
LayerImpl* page_scale_layer = nullptr;
+ LayerImpl* inner_viewport_scroll_layer =
+ root_layer->layer_tree_impl()->InnerViewportScrollLayer();
+ LayerImpl* outer_viewport_scroll_layer =
+ root_layer->layer_tree_impl()->OuterViewportScrollLayer();
float page_scale_factor = 1.f;
float device_scale_factor = 1.f;
gfx::Size device_viewport_size =
@@ -117,7 +126,8 @@ void LayerTreeHostCommonTestBase::
root_layer->bounds().height() * device_scale_factor);
std::vector<LayerImpl*> update_layer_list;
BuildPropertyTreesAndComputeVisibleRects(
- root_layer, page_scale_layer, page_scale_factor, device_scale_factor,
+ root_layer, page_scale_layer, inner_viewport_scroll_layer,
+ outer_viewport_scroll_layer, page_scale_factor, device_scale_factor,
gfx::Rect(device_viewport_size), identity_transform,
root_layer->layer_tree_impl()->property_trees(), &update_layer_list);
}