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

Unified Diff: cc/trees/layer_tree_host_unittest_scroll.cc

Issue 783543003: Update from https://crrev.com/306901 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « cc/trees/layer_tree_host_unittest_delegated.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest_scroll.cc
diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc
index 8015bdabbf63f66d36e374f7c2d83a79100ffe73..bd09d6aacb4957d828291fc1d4f2e44100aefecb 100644
--- a/cc/trees/layer_tree_host_unittest_scroll.cc
+++ b/cc/trees/layer_tree_host_unittest_scroll.cc
@@ -306,10 +306,10 @@ class LayerTreeHostScrollTestScrollAbortedCommit
EXPECT_VECTOR_EQ(root_scroll_layer->scroll_offset(), initial_scroll_);
EXPECT_EQ(1.f, impl->active_tree()->page_scale_delta());
- EXPECT_EQ(1.f, impl->active_tree()->total_page_scale_factor());
- impl->active_tree()->SetPageScaleDelta(impl_scale_);
+ EXPECT_EQ(1.f, impl->active_tree()->current_page_scale_factor());
+ impl->SetPageScaleOnActiveTree(impl_scale_);
EXPECT_EQ(impl_scale_, impl->active_tree()->page_scale_delta());
- EXPECT_EQ(impl_scale_, impl->active_tree()->total_page_scale_factor());
+ EXPECT_EQ(impl_scale_, impl->active_tree()->current_page_scale_factor());
// To simplify the testing flow, don't redraw here, just commit.
impl->SetNeedsCommit();
@@ -326,11 +326,11 @@ class LayerTreeHostScrollTestScrollAbortedCommit
gfx::ScrollOffsetWithDelta(initial_scroll_, impl_scroll_));
EXPECT_EQ(1.f, impl->active_tree()->page_scale_delta());
- EXPECT_EQ(impl_scale_, impl->active_tree()->total_page_scale_factor());
- impl->active_tree()->SetPageScaleDelta(impl_scale_);
+ EXPECT_EQ(impl_scale_, impl->active_tree()->current_page_scale_factor());
+ impl->SetPageScaleOnActiveTree(impl_scale_ * impl_scale_);
EXPECT_EQ(impl_scale_, impl->active_tree()->page_scale_delta());
EXPECT_EQ(impl_scale_ * impl_scale_,
- impl->active_tree()->total_page_scale_factor());
+ impl->active_tree()->current_page_scale_factor());
impl->SetNeedsCommit();
} else if (impl->active_tree()->source_frame_number() == 1) {
@@ -897,7 +897,7 @@ class ImplSidePaintingScrollTestImplOnlyScroll
: public ImplSidePaintingScrollTest {
public:
ImplSidePaintingScrollTestImplOnlyScroll()
- : initial_scroll_(20, 10), impl_thread_scroll_(-2, 3) {}
+ : initial_scroll_(20, 10), impl_thread_scroll_(-2, 3), impl_scale_(2.f) {}
void SetupTree() override {
LayerTreeHostScrollTest::SetupTree();
@@ -943,6 +943,7 @@ class ImplSidePaintingScrollTestImplOnlyScroll
ASSERT_TRUE(active_root);
ASSERT_TRUE(active_scroll_layer);
active_scroll_layer->ScrollBy(impl_thread_scroll_);
+ impl->SetPageScaleOnActiveTree(impl_scale_);
}
}
@@ -990,7 +991,6 @@ class ImplSidePaintingScrollTestImplOnlyScroll
EXPECT_VECTOR_EQ(pending_scroll_layer->ScrollDelta(), gfx::Vector2d());
EXPECT_VECTOR_EQ(pending_scroll_layer->sent_scroll_delta(),
gfx::Vector2d());
- EndTest();
break;
}
}
@@ -1006,14 +1006,25 @@ class ImplSidePaintingScrollTestImplOnlyScroll
EXPECT_VECTOR_EQ(scroll_layer->scroll_offset(), initial_scroll_);
EXPECT_VECTOR_EQ(scroll_layer->ScrollDelta(), gfx::Vector2d());
EXPECT_VECTOR_EQ(scroll_layer->sent_scroll_delta(), gfx::Vector2d());
+ EXPECT_EQ(1.f, impl->active_tree()->page_scale_delta());
+ EXPECT_EQ(1.f, impl->active_tree()->current_page_scale_factor());
PostSetNeedsCommitToMainThread();
break;
case 1:
EXPECT_VECTOR_EQ(scroll_layer->scroll_offset(), initial_scroll_);
EXPECT_VECTOR_EQ(scroll_layer->ScrollDelta(), impl_thread_scroll_);
EXPECT_VECTOR_EQ(scroll_layer->sent_scroll_delta(), gfx::Vector2d());
+ EXPECT_EQ(impl_scale_, impl->active_tree()->page_scale_delta());
+ EXPECT_EQ(impl_scale_,
+ impl->active_tree()->current_page_scale_factor());
PostSetNeedsCommitToMainThread();
break;
+ case 2:
+ EXPECT_EQ(1.f, impl->active_tree()->page_scale_delta());
+ EXPECT_EQ(impl_scale_,
+ impl->active_tree()->current_page_scale_factor());
+ EndTest();
+ break;
}
}
@@ -1022,6 +1033,7 @@ class ImplSidePaintingScrollTestImplOnlyScroll
private:
gfx::ScrollOffset initial_scroll_;
gfx::Vector2dF impl_thread_scroll_;
+ float impl_scale_;
};
MULTI_THREAD_TEST_F(ImplSidePaintingScrollTestImplOnlyScroll);
« no previous file with comments | « cc/trees/layer_tree_host_unittest_delegated.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698