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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 1766053002: Clean LayerImpl's scroll offset callers in unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_host_common_unittest.cc
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc
index cb780478b6ef06bdfd47698846595b83cb6e3af4..b7e991faef27e7d7d6e301e4e22e0e2a1766cd2f 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -345,12 +345,15 @@ TEST_F(LayerTreeHostCommonTest, TransformsAboutScrollOffset) {
gfx::Size(scroll_layer->bounds().width() + kMaxScrollOffset.x(),
scroll_layer->bounds().height() + kMaxScrollOffset.y()));
scroll_layer->SetScrollClipLayer(clip_layer->id());
- scroll_layer->SetScrollDelta(kScrollDelta);
+ SetScrollOffsetDelta(scroll_layer, kScrollDelta);
gfx::Transform impl_transform;
scroll_layer->AddChild(std::move(sublayer_scoped_ptr));
LayerImpl* scroll_layer_raw_ptr = scroll_layer_scoped_ptr.get();
clip_layer->AddChild(std::move(scroll_layer_scoped_ptr));
- scroll_layer_raw_ptr->PushScrollOffsetFromMainThread(kScrollOffset);
+ scroll_layer_raw_ptr->layer_tree_impl()
+ ->property_trees()
+ ->scroll_tree.UpdateScrollOffsetBaseForTesting(scroll_layer_raw_ptr->id(),
+ kScrollOffset);
scoped_ptr<LayerImpl> root(LayerImpl::Create(host_impl.active_tree(), 3));
SetLayerPropertiesForTesting(root.get(), identity_matrix, gfx::Point3F(),
@@ -7160,7 +7163,7 @@ TEST_F(LayerTreeHostCommonTest, ScrollCompensationWithRounding) {
// Rounded to integers already.
{
gfx::Vector2dF scroll_delta(3.0, 5.0);
- scroll_layer->SetScrollDelta(scroll_delta);
+ SetScrollOffsetDelta(scroll_layer, scroll_delta);
LayerImplList render_surface_layer_list;
root->layer_tree_impl()->IncrementRenderSurfaceListIdForTesting();
@@ -7183,7 +7186,7 @@ TEST_F(LayerTreeHostCommonTest, ScrollCompensationWithRounding) {
// Scroll delta requiring rounding.
{
gfx::Vector2dF scroll_delta(4.1f, 8.1f);
- scroll_layer->SetScrollDelta(scroll_delta);
+ SetScrollOffsetDelta(scroll_layer, scroll_delta);
gfx::Vector2dF rounded_scroll_delta(4.f, 8.f);
@@ -7216,7 +7219,7 @@ TEST_F(LayerTreeHostCommonTest, ScrollCompensationWithRounding) {
->transform_tree.set_source_to_parent_updates_allowed(true);
gfx::Vector2dF scroll_delta(4.5f, 8.5f);
- scroll_layer->SetScrollDelta(scroll_delta);
+ SetScrollOffsetDelta(scroll_layer, scroll_delta);
LayerImplList render_surface_layer_list;
root->layer_tree_impl()->IncrementRenderSurfaceListIdForTesting();
@@ -7296,8 +7299,11 @@ TEST_F(LayerTreeHostCommonTest,
SetLayerPropertiesForTesting(fixed.get(), identity_transform, gfx::Point3F(),
gfx::PointF(3.0f, 4.0f), gfx::Size(50, 50), true,
false, false);
- scroll_layer->PushScrollOffsetFromMainThread(scroll_offset);
- scroll_layer->SetScrollDelta(scroll_delta);
+ scroll_layer->layer_tree_impl()
+ ->property_trees()
+ ->scroll_tree.UpdateScrollOffsetBaseForTesting(scroll_layer->id(),
+ scroll_offset);
+ SetScrollOffsetDelta(scroll_layer, scroll_delta);
scroll_layer->SetScrollCompensationAdjustment(main_scroll_fractional_part);
scroller->AddChild(std::move(fixed));
@@ -7380,7 +7386,7 @@ TEST_F(LayerTreeHostCommonTest,
end_operations);
}
gfx::Vector2dF scroll_delta(5.f, 9.f);
- scroller->SetScrollDelta(scroll_delta);
+ SetScrollOffsetDelta(scroller, scroll_delta);
ExecuteCalculateDrawProperties(root);

Powered by Google App Engine
This is Rietveld 408576698