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

Side by Side Diff: cc/layers/layer_impl_unittest.cc

Issue 1805343006: cc: Impl thread scroll on ScrollNode instead of LayerImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve comments 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 unified diff | Download patch
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/layers/viewport.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/layers/layer_impl.h" 5 #include "cc/layers/layer_impl.h"
6 6
7 #include "cc/animation/mutable_properties.h" 7 #include "cc/animation/mutable_properties.h"
8 #include "cc/layers/painted_scrollbar_layer_impl.h" 8 #include "cc/layers/painted_scrollbar_layer_impl.h"
9 #include "cc/layers/solid_color_scrollbar_layer_impl.h" 9 #include "cc/layers/solid_color_scrollbar_layer_impl.h"
10 #include "cc/output/filter_operation.h" 10 #include "cc/output/filter_operation.h"
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 EXPECT_VECTOR_EQ( 626 EXPECT_VECTOR_EQ(
627 gfx::ScrollOffsetWithDelta(scroll_offset, sent_scroll_delta), 627 gfx::ScrollOffsetWithDelta(scroll_offset, sent_scroll_delta),
628 scroll_tree(layer())->GetScrollOffsetBaseForTesting(layer()->id())); 628 scroll_tree(layer())->GetScrollOffsetBaseForTesting(layer()->id()));
629 } 629 }
630 630
631 TEST_F(LayerImplScrollTest, ScrollUserUnscrollableLayer) { 631 TEST_F(LayerImplScrollTest, ScrollUserUnscrollableLayer) {
632 gfx::ScrollOffset scroll_offset(10, 5); 632 gfx::ScrollOffset scroll_offset(10, 5);
633 gfx::Vector2dF scroll_delta(20.5f, 8.5f); 633 gfx::Vector2dF scroll_delta(20.5f, 8.5f);
634 634
635 layer()->set_user_scrollable_vertical(false); 635 layer()->set_user_scrollable_vertical(false);
636 layer()->layer_tree_impl()->property_trees()->needs_rebuild = true;
637 layer()->layer_tree_impl()->BuildPropertyTreesForTesting();
636 scroll_tree(layer())->UpdateScrollOffsetBaseForTesting(layer()->id(), 638 scroll_tree(layer())->UpdateScrollOffsetBaseForTesting(layer()->id(),
637 scroll_offset); 639 scroll_offset);
638 gfx::Vector2dF unscrolled = layer()->ScrollBy(scroll_delta); 640 gfx::Vector2dF unscrolled = layer()->ScrollBy(scroll_delta);
639 641
640 EXPECT_VECTOR_EQ(gfx::Vector2dF(0, 8.5f), unscrolled); 642 EXPECT_VECTOR_EQ(gfx::Vector2dF(0, 8.5f), unscrolled);
641 EXPECT_VECTOR_EQ(gfx::Vector2dF(30.5f, 5), layer()->CurrentScrollOffset()); 643 EXPECT_VECTOR_EQ(gfx::Vector2dF(30.5f, 5), layer()->CurrentScrollOffset());
642 } 644 }
643 645
644 TEST_F(LayerImplScrollTest, PushPropertiesToMirrorsCurrentScrollOffset) { 646 TEST_F(LayerImplScrollTest, PushPropertiesToMirrorsCurrentScrollOffset) {
645 gfx::ScrollOffset scroll_offset(10, 5); 647 gfx::ScrollOffset scroll_offset(10, 5);
(...skipping 18 matching lines...) Expand all
664 666
665 pending_layer->PushPropertiesTo(layer()); 667 pending_layer->PushPropertiesTo(layer());
666 668
667 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset()); 669 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset());
668 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(), 670 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(),
669 pending_layer->CurrentScrollOffset()); 671 pending_layer->CurrentScrollOffset());
670 } 672 }
671 673
672 } // namespace 674 } // namespace
673 } // namespace cc 675 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/layers/viewport.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698