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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 1736073002: cc: Move SyncedScrollOffset to scroll tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove scroll_offset() from LayerImpl Created 4 years, 10 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_impl_unittest.cc
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 32e461186d8abe9673795556b86ac7c6d0ee9ba9..13addc76b8e94381507e4315e55615dd15e158ef 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -2033,7 +2033,7 @@ TEST_F(LayerTreeHostImplTest, PinchGesture) {
host_impl_->active_tree()->PushPageScaleFromMainThread(1.f, min_page_scale,
max_page_scale);
scroll_layer->SetScrollDelta(gfx::Vector2d());
- scroll_layer->PullDeltaForMainThread();
+ scroll_layer->synced_scroll_offset()->PullDeltaForMainThread();
scroll_layer->PushScrollOffsetFromMainThread(gfx::ScrollOffset(50, 50));
float page_scale_delta = 0.1f;
@@ -2056,7 +2056,7 @@ TEST_F(LayerTreeHostImplTest, PinchGesture) {
host_impl_->active_tree()->PushPageScaleFromMainThread(1.f, min_page_scale,
max_page_scale);
scroll_layer->SetScrollDelta(gfx::Vector2d());
- scroll_layer->PullDeltaForMainThread();
+ scroll_layer->synced_scroll_offset()->PullDeltaForMainThread();
scroll_layer->PushScrollOffsetFromMainThread(gfx::ScrollOffset(20, 20));
float page_scale_delta = 1.f;
@@ -2079,7 +2079,7 @@ TEST_F(LayerTreeHostImplTest, PinchGesture) {
host_impl_->active_tree()->PushPageScaleFromMainThread(1.f, min_page_scale,
max_page_scale);
scroll_layer->SetScrollDelta(gfx::Vector2d());
- scroll_layer->PullDeltaForMainThread();
+ scroll_layer->synced_scroll_offset()->PullDeltaForMainThread();
scroll_layer->PushScrollOffsetFromMainThread(gfx::ScrollOffset(20, 20));
float page_scale_delta = 1.f;
@@ -2104,7 +2104,7 @@ TEST_F(LayerTreeHostImplTest, PinchGesture) {
{
host_impl_->active_tree()->PushPageScaleFromMainThread(0.5f, 0.5f, 4.f);
scroll_layer->SetScrollDelta(gfx::Vector2d());
- scroll_layer->PullDeltaForMainThread();
+ scroll_layer->synced_scroll_offset()->PullDeltaForMainThread();
scroll_layer->PushScrollOffsetFromMainThread(gfx::ScrollOffset(0, 0));
host_impl_->ScrollBegin(BeginState(gfx::Point(0, 0)).get(),
@@ -10192,12 +10192,17 @@ TEST_F(LayerTreeHostImplTest, JitterTest) {
LayerTreeImpl* pending_tree = host_impl_->pending_tree();
pending_tree->PushPageScaleFromMainThread(1.f, 1.f, 1.f);
+ LayerImpl* last_scrolled_layer = pending_tree->LayerById(
+ host_impl_->active_tree()->LastScrolledLayerId());
+ gfx::ScrollOffset pending_base =
+ last_scrolled_layer->synced_scroll_offset()->PendingBase();
pending_tree->property_trees()->needs_rebuild = true;
pending_tree->BuildPropertyTreesForTesting();
+ last_scrolled_layer->synced_scroll_offset()->PushFromMainThread(
+ pending_base);
ajuma 2016/03/03 18:05:06 The way this logic worked before relied on the pen
sunxd 2016/03/03 18:50:13 I think we don't need to. ScrollTree only clear it
+
pending_tree->set_needs_update_draw_properties();
pending_tree->UpdateDrawProperties(false);
- LayerImpl* last_scrolled_layer = pending_tree->LayerById(
- host_impl_->active_tree()->LastScrolledLayerId());
float jitter =
LayerTreeHostCommon::CalculateFrameJitter(last_scrolled_layer);
// There should not be any jitter measured till we hit the fixed point hits

Powered by Google App Engine
This is Rietveld 408576698