diff options
Diffstat (limited to 'cc')
-rw-r--r-- | cc/input/scrollbar_animation_controller_linear_fade_unittest.cc | 12 | ||||
-rw-r--r-- | cc/input/scrollbar_animation_controller_thinning_unittest.cc | 2 | ||||
-rw-r--r-- | cc/layers/picture_layer_impl_perftest.cc | 2 | ||||
-rw-r--r-- | cc/layers/picture_layer_impl_unittest.cc | 8 | ||||
-rw-r--r-- | cc/tiles/tile_manager_perftest.cc | 4 | ||||
-rw-r--r-- | cc/tiles/tile_manager_unittest.cc | 4 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_impl.cc | 17 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_impl.h | 2 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_impl_unittest.cc | 29 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_unittest.cc | 5 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_unittest_scroll.cc | 4 | ||||
-rw-r--r-- | cc/trees/layer_tree_impl_unittest.cc | 10 | ||||
-rw-r--r-- | cc/trees/tree_synchronizer_unittest.cc | 2 |
13 files changed, 53 insertions, 48 deletions
diff --git a/cc/input/scrollbar_animation_controller_linear_fade_unittest.cc b/cc/input/scrollbar_animation_controller_linear_fade_unittest.cc index 20cf0b8..2f9e3bb 100644 --- a/cc/input/scrollbar_animation_controller_linear_fade_unittest.cc +++ b/cc/input/scrollbar_animation_controller_linear_fade_unittest.cc @@ -131,7 +131,7 @@ TEST_F(ScrollbarAnimationControllerLinearFadeTest, } TEST_F(ScrollbarAnimationControllerLinearFadeTest, HideOnResize) { - LayerImpl* scroll_layer = host_impl_.active_tree()->list()->LayerById(1); + LayerImpl* scroll_layer = host_impl_.active_list()->LayerById(1); ASSERT_TRUE(scroll_layer); EXPECT_EQ(gfx::Size(200, 200), scroll_layer->bounds()); @@ -162,7 +162,7 @@ TEST_F(ScrollbarAnimationControllerLinearFadeTest, HideOnResize) { } TEST_F(VerticalScrollbarAnimationControllerLinearFadeTest, HideOnResize) { - LayerImpl* scroll_layer = host_impl_.active_tree()->list()->LayerById(1); + LayerImpl* scroll_layer = host_impl_.active_list()->LayerById(1); ASSERT_TRUE(scroll_layer); EXPECT_EQ(gfx::Size(200, 200), scroll_layer->bounds()); @@ -195,7 +195,7 @@ TEST_F(ScrollbarAnimationControllerLinearFadeTest, HideOnUserNonScrollableHorz) { EXPECT_EQ(HORIZONTAL, scrollbar_layer_->orientation()); - LayerImpl* scroll_layer = host_impl_.active_tree()->list()->LayerById(1); + LayerImpl* scroll_layer = host_impl_.active_list()->LayerById(1); ASSERT_TRUE(scroll_layer); scroll_layer->set_user_scrollable_horizontal(false); @@ -211,7 +211,7 @@ TEST_F(ScrollbarAnimationControllerLinearFadeTest, ShowOnUserNonScrollableVert) { EXPECT_EQ(HORIZONTAL, scrollbar_layer_->orientation()); - LayerImpl* scroll_layer = host_impl_.active_tree()->list()->LayerById(1); + LayerImpl* scroll_layer = host_impl_.active_list()->LayerById(1); ASSERT_TRUE(scroll_layer); scroll_layer->set_user_scrollable_vertical(false); @@ -227,7 +227,7 @@ TEST_F(VerticalScrollbarAnimationControllerLinearFadeTest, HideOnUserNonScrollableVert) { EXPECT_EQ(VERTICAL, scrollbar_layer_->orientation()); - LayerImpl* scroll_layer = host_impl_.active_tree()->list()->LayerById(1); + LayerImpl* scroll_layer = host_impl_.active_list()->LayerById(1); ASSERT_TRUE(scroll_layer); scroll_layer->set_user_scrollable_vertical(false); @@ -243,7 +243,7 @@ TEST_F(VerticalScrollbarAnimationControllerLinearFadeTest, ShowOnUserNonScrollableHorz) { EXPECT_EQ(VERTICAL, scrollbar_layer_->orientation()); - LayerImpl* scroll_layer = host_impl_.active_tree()->list()->LayerById(1); + LayerImpl* scroll_layer = host_impl_.active_list()->LayerById(1); ASSERT_TRUE(scroll_layer); scroll_layer->set_user_scrollable_horizontal(false); diff --git a/cc/input/scrollbar_animation_controller_thinning_unittest.cc b/cc/input/scrollbar_animation_controller_thinning_unittest.cc index 12b2d84..6ecb733 100644 --- a/cc/input/scrollbar_animation_controller_thinning_unittest.cc +++ b/cc/input/scrollbar_animation_controller_thinning_unittest.cc @@ -90,7 +90,7 @@ TEST_F(ScrollbarAnimationControllerThinningTest, Idle) { // Check that scrollbar disappears when the layer becomes non-scrollable. TEST_F(ScrollbarAnimationControllerThinningTest, HideOnResize) { - LayerImpl* scroll_layer = host_impl_.active_tree()->list()->LayerById(1); + LayerImpl* scroll_layer = host_impl_.active_list()->LayerById(1); ASSERT_TRUE(scroll_layer); EXPECT_EQ(gfx::Size(200, 200), scroll_layer->bounds()); diff --git a/cc/layers/picture_layer_impl_perftest.cc b/cc/layers/picture_layer_impl_perftest.cc index c5d947d..9cb2c40 100644 --- a/cc/layers/picture_layer_impl_perftest.cc +++ b/cc/layers/picture_layer_impl_perftest.cc @@ -72,7 +72,7 @@ class PictureLayerImplPerfTest : public testing::Test { pending_tree->BuildPropertyTreesForTesting(); pending_layer_ = static_cast<FakePictureLayerImpl*>( - host_impl_.pending_tree()->list()->LayerById(7)); + host_impl_.pending_list()->LayerById(7)); } void RunRasterQueueConstructAndIterateTest(const std::string& test_name, diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc index c4230c2..d32c48a 100644 --- a/cc/layers/picture_layer_impl_unittest.cc +++ b/cc/layers/picture_layer_impl_unittest.cc @@ -155,7 +155,7 @@ class PictureLayerImplTest : public testing::Test { old_pending_layer_ = pending_layer_; pending_layer_ = nullptr; active_layer_ = static_cast<FakePictureLayerImpl*>( - host_impl_.active_tree()->list()->LayerById(id_)); + host_impl_.active_list()->LayerById(id_)); bool update_lcd_text = false; host_impl_.active_tree()->UpdateDrawProperties(update_lcd_text); @@ -258,7 +258,7 @@ class PictureLayerImplTest : public testing::Test { Layer::INVALID_ID); pending_layer_ = static_cast<FakePictureLayerImpl*>( - host_impl_.pending_tree()->list()->LayerById(id_)); + host_impl_.pending_list()->LayerById(id_)); // Add tilings/tiles for the layer. bool update_lcd_text = false; @@ -2240,7 +2240,7 @@ TEST_F(PictureLayerImplTest, ActivateUninitializedLayer) { pending_tree->SetRootLayer(std::move(pending_layer)); pending_layer_ = static_cast<FakePictureLayerImpl*>( - host_impl_.pending_tree()->list()->LayerById(id_)); + host_impl_.pending_list()->LayerById(id_)); // Set some state on the pending layer, make sure it is not clobbered // by a sync from the active layer. This could happen because if the @@ -2252,7 +2252,7 @@ TEST_F(PictureLayerImplTest, ActivateUninitializedLayer) { host_impl_.ActivateSyncTree(); active_layer_ = static_cast<FakePictureLayerImpl*>( - host_impl_.active_tree()->list()->LayerById(id_)); + host_impl_.active_list()->LayerById(id_)); EXPECT_EQ(0u, active_layer_->num_tilings()); EXPECT_EQ(raster_page_scale, active_layer_->raster_page_scale()); diff --git a/cc/tiles/tile_manager_perftest.cc b/cc/tiles/tile_manager_perftest.cc index 648ebf1..19b632c 100644 --- a/cc/tiles/tile_manager_perftest.cc +++ b/cc/tiles/tile_manager_perftest.cc @@ -144,7 +144,7 @@ class TileManagerPerfTest : public testing::Test { CHECK(!host_impl_.pending_tree()); pending_root_layer_ = NULL; active_root_layer_ = static_cast<FakePictureLayerImpl*>( - host_impl_.active_tree()->list()->LayerById(id_)); + host_impl_.active_list()->LayerById(id_)); } void SetupDefaultTreesWithFixedTileSize(const gfx::Size& layer_bounds, @@ -176,7 +176,7 @@ class TileManagerPerfTest : public testing::Test { pending_tree->BuildPropertyTreesForTesting(); pending_root_layer_ = static_cast<FakePictureLayerImpl*>( - host_impl_.pending_tree()->list()->LayerById(id_)); + host_impl_.pending_list()->LayerById(id_)); } void RunRasterQueueConstructTest(const std::string& test_name, diff --git a/cc/tiles/tile_manager_unittest.cc b/cc/tiles/tile_manager_unittest.cc index 5a3f5eb..3122e75 100644 --- a/cc/tiles/tile_manager_unittest.cc +++ b/cc/tiles/tile_manager_unittest.cc @@ -103,7 +103,7 @@ class TileManagerTilePriorityQueueTest : public testing::Test { CHECK(!host_impl_.pending_tree()); pending_layer_ = NULL; active_layer_ = static_cast<FakePictureLayerImpl*>( - host_impl_.active_tree()->list()->LayerById(id_)); + host_impl_.active_list()->LayerById(id_)); bool update_lcd_text = false; host_impl_.active_tree()->UpdateDrawProperties(update_lcd_text); } @@ -146,7 +146,7 @@ class TileManagerTilePriorityQueueTest : public testing::Test { pending_tree->SetRootLayer(std::move(pending_layer)); pending_layer_ = static_cast<FakePictureLayerImpl*>( - host_impl_.pending_tree()->list()->LayerById(id_)); + host_impl_.pending_list()->LayerById(id_)); // Add tilings/tiles for the layer. bool update_lcd_text = false; diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index da79b67..ab3e020 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -1297,6 +1297,14 @@ const LayerListImpl* LayerTreeHostImpl::pending_list() const { return pending_tree_.get() ? pending_tree_->list() : nullptr; } +LayerListImpl* LayerTreeHostImpl::recycle_list() { + return recycle_tree_.get() ? recycle_tree_->list() : nullptr; +} + +const LayerListImpl* LayerTreeHostImpl::recycle_list() const { + return recycle_tree_.get() ? recycle_tree_->list() : nullptr; +} + scoped_ptr<EvictionTilePriorityQueue> LayerTreeHostImpl::BuildEvictionQueue( TreePriority tree_priority) { TRACE_EVENT0("disabled-by-default-cc.debug", @@ -3819,12 +3827,12 @@ bool LayerTreeHostImpl::ScrollAnimationUpdateTarget( bool LayerTreeHostImpl::IsLayerInTree(int layer_id, LayerListType list_type) const { if (list_type == LayerListType::ACTIVE) { - return active_tree() ? active_tree()->list()->LayerById(layer_id) != nullptr + return active_tree() ? active_list()->LayerById(layer_id) != nullptr : false; } else { - if (pending_tree() && pending_tree()->list()->LayerById(layer_id)) + if (pending_tree() && pending_list()->LayerById(layer_id)) return true; - if (recycle_tree() && recycle_tree()->list()->LayerById(layer_id)) + if (recycle_tree() && recycle_list()->LayerById(layer_id)) return true; return false; @@ -3970,8 +3978,7 @@ void LayerTreeHostImpl::ScrollOffsetAnimationFinished() { gfx::ScrollOffset LayerTreeHostImpl::GetScrollOffsetForAnimation( int layer_id) const { if (active_tree()) { - LayerAnimationValueProvider* layer = - active_tree()->list()->LayerById(layer_id); + LayerAnimationValueProvider* layer = active_list()->LayerById(layer_id); if (layer) return layer->ScrollOffsetForAnimation(); } diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h index a2520fb..001d9ff 100644 --- a/cc/trees/layer_tree_host_impl.h +++ b/cc/trees/layer_tree_host_impl.h @@ -416,6 +416,8 @@ class CC_EXPORT LayerTreeHostImpl const LayerListImpl* active_list() const; LayerListImpl* pending_list(); const LayerListImpl* pending_list() const; + LayerListImpl* recycle_list(); + const LayerListImpl* recycle_list() const; LayerTreeImpl* active_tree() { return active_tree_.get(); } const LayerTreeImpl* active_tree() const { return active_tree_.get(); } diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index 25b066c..ff4d6f3 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -2743,8 +2743,7 @@ class LayerTreeHostImplTestScrollbarOpacity : public LayerTreeHostImplTest { host_impl_->pending_tree()->BuildPropertyTreesForTesting(); host_impl_->ActivateSyncTree(); - LayerImpl* scrollbar_layer = - host_impl_->active_tree()->list()->LayerById(400); + LayerImpl* scrollbar_layer = host_impl_->active_list()->LayerById(400); EffectNode* active_tree_node = host_impl_->active_tree()->property_trees()->effect_tree.Node( @@ -7740,12 +7739,12 @@ TEST_F(LayerTreeHostImplTest, ScrollUnknownNotOnAncestorChain) { int scroll_layer_id = 2; LayerImpl* scroll_layer = - host_impl_->active_tree()->list()->LayerById(scroll_layer_id); + host_impl_->active_list()->LayerById(scroll_layer_id); scroll_layer->SetDrawsContent(true); int page_scale_layer_id = 5; LayerImpl* page_scale_layer = - host_impl_->active_tree()->list()->LayerById(page_scale_layer_id); + host_impl_->active_list()->LayerById(page_scale_layer_id); int occluder_layer_id = 6; scoped_ptr<LayerImpl> occluder_layer = @@ -7776,7 +7775,7 @@ TEST_F(LayerTreeHostImplTest, ScrollUnknownScrollAncestorMismatch) { int scroll_layer_id = 2; LayerImpl* scroll_layer = - host_impl_->active_tree()->list()->LayerById(scroll_layer_id); + host_impl_->active_list()->LayerById(scroll_layer_id); scroll_layer->SetDrawsContent(true); int occluder_layer_id = 6; @@ -7814,11 +7813,11 @@ TEST_F(LayerTreeHostImplTest, NotScrollInvisibleScroller) { gfx::Size content_size(100, 100); SetupScrollAndContentsLayers(content_size); - LayerImpl* root = host_impl_->active_tree()->list()->LayerById(1); + LayerImpl* root = host_impl_->active_list()->LayerById(1); int scroll_layer_id = 2; LayerImpl* scroll_layer = - host_impl_->active_tree()->list()->LayerById(scroll_layer_id); + host_impl_->active_list()->LayerById(scroll_layer_id); int child_scroll_layer_id = 7; scoped_ptr<LayerImpl> child_scroll = @@ -7848,9 +7847,8 @@ TEST_F(LayerTreeHostImplTest, ScrollInvisibleScrollerWithVisibleDescendent) { gfx::Size content_size(100, 100); SetupScrollAndContentsLayers(content_size); - LayerImpl* root = host_impl_->active_tree()->list()->LayerById(1); - LayerImpl* root_scroll_layer = - host_impl_->active_tree()->list()->LayerById(2); + LayerImpl* root = host_impl_->active_list()->LayerById(1); + LayerImpl* root_scroll_layer = host_impl_->active_list()->LayerById(2); scoped_ptr<LayerImpl> invisible_scroll_layer = CreateScrollableLayer(7, content_size, root); @@ -7892,11 +7890,11 @@ TEST_F(LayerTreeHostImplTest, ScrollInvisibleScrollerWithVisibleScrollChild) { gfx::Size content_size(100, 100); SetupScrollAndContentsLayers(content_size); - LayerImpl* root = host_impl_->active_tree()->list()->LayerById(1); + LayerImpl* root = host_impl_->active_list()->LayerById(1); int scroll_layer_id = 2; LayerImpl* scroll_layer = - host_impl_->active_tree()->list()->LayerById(scroll_layer_id); + host_impl_->active_list()->LayerById(scroll_layer_id); int scroll_child_id = 6; scoped_ptr<LayerImpl> scroll_child = @@ -9272,7 +9270,7 @@ TEST_F(LayerTreeHostImplTest, ExternalTransformAffectsSublayerScaleFactor) { ->children()[0] .get(); content_layer->AddChild(LayerImpl::Create(host_impl_->active_tree(), 100)); - LayerImpl* test_layer = host_impl_->active_tree()->list()->LayerById(100); + LayerImpl* test_layer = host_impl_->active_list()->LayerById(100); test_layer->SetForceRenderSurface(true); test_layer->SetDrawsContent(true); test_layer->SetBounds(layer_size); @@ -10141,7 +10139,7 @@ TEST_F(LayerTreeHostImplTest, SubLayerScaleForNodeInSubtreeOfPageScaleLayer) { page_scale_layer->AddChild(LayerImpl::Create(host_impl_->active_tree(), 100)); LayerImpl* in_subtree_of_page_scale_layer = - host_impl_->active_tree()->list()->LayerById(100); + host_impl_->active_list()->LayerById(100); in_subtree_of_page_scale_layer->SetForceRenderSurface(true); SetNeedsRebuildPropertyTrees(); RebuildPropertyTrees(); @@ -10153,8 +10151,7 @@ TEST_F(LayerTreeHostImplTest, SubLayerScaleForNodeInSubtreeOfPageScaleLayer) { host_impl_->active_tree()->SetPageScaleOnActiveTree(2.f); DrawFrame(); - in_subtree_of_page_scale_layer = - host_impl_->active_tree()->list()->LayerById(100); + in_subtree_of_page_scale_layer = host_impl_->active_list()->LayerById(100); node = host_impl_->active_tree()->property_trees()->transform_tree.Node( in_subtree_of_page_scale_layer->transform_tree_index()); EXPECT_EQ(node->data.sublayer_scale, gfx::Vector2dF(2.f, 2.f)); diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index 6f8727f..1faa6843 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc @@ -1287,7 +1287,7 @@ class LayerTreeHostTestDamageWithScale : public LayerTreeHostTest { // cleanup. AddTilingUntilNextDraw ensures that it remains there during // damage calculation. FakePictureLayerImpl* child_layer_impl = static_cast<FakePictureLayerImpl*>( - host_impl->active_tree()->list()->LayerById(child_layer_->id())); + host_impl->active_list()->LayerById(child_layer_->id())); child_layer_impl->AddTilingUntilNextDraw(1.3f); } @@ -1314,8 +1314,7 @@ class LayerTreeHostTestDamageWithScale : public LayerTreeHostTest { case 1: { FakePictureLayerImpl* child_layer_impl = static_cast<FakePictureLayerImpl*>( - host_impl->active_tree()->list()->LayerById( - child_layer_->id())); + host_impl->active_list()->LayerById(child_layer_->id())); // We remove tilings pretty aggressively if they are not ideal. Add this // back in so that we can compare // child_layer_impl->GetEnclosingRectInTargetSpace to the damage. diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc index d75ff4f..050f836 100644 --- a/cc/trees/layer_tree_host_unittest_scroll.cc +++ b/cc/trees/layer_tree_host_unittest_scroll.cc @@ -179,7 +179,7 @@ class LayerTreeHostScrollTestScrollMultipleRedraw void DrawLayersOnThread(LayerTreeHostImpl* impl) override { LayerImpl* scroll_layer = - impl->active_tree()->list()->LayerById(scroll_layer_->id()); + impl->active_list()->LayerById(scroll_layer_->id()); if (impl->active_tree()->source_frame_number() == 0 && impl->SourceAnimationFrameNumberForTesting() == 1) { // First draw after first commit. @@ -832,7 +832,7 @@ class LayerTreeHostScrollTestSimple : public LayerTreeHostScrollTest { LayerImpl* root = impl->active_tree()->root_layer(); LayerImpl* scroll_layer = impl->OuterViewportScrollLayer(); LayerImpl* pending_root = - impl->active_tree()->list()->FindPendingLayerById(root->id()); + impl->active_list()->FindPendingLayerById(root->id()); switch (impl->active_tree()->source_frame_number()) { case 0: diff --git a/cc/trees/layer_tree_impl_unittest.cc b/cc/trees/layer_tree_impl_unittest.cc index bc10de0..57c3558 100644 --- a/cc/trees/layer_tree_impl_unittest.cc +++ b/cc/trees/layer_tree_impl_unittest.cc @@ -1929,7 +1929,7 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerOverlappingRegions) { // behind it. EXPECT_TRUE(result_layer); - host_impl().active_tree()->list()->LayerById(1234)->SetContentsOpaque(true); + host_impl().active_list()->LayerById(1234)->SetContentsOpaque(true); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); @@ -2358,18 +2358,18 @@ TEST_F(LayerTreeImplTest, SelectionBoundsWithLargeTransforms) { } TEST_F(LayerTreeImplTest, NumLayersTestOne) { - EXPECT_EQ(0u, host_impl().active_tree()->list()->NumLayers()); + EXPECT_EQ(0u, host_impl().active_list()->NumLayers()); scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1); - EXPECT_EQ(1u, host_impl().active_tree()->list()->NumLayers()); + EXPECT_EQ(1u, host_impl().active_list()->NumLayers()); } TEST_F(LayerTreeImplTest, NumLayersSmallTree) { - EXPECT_EQ(0u, host_impl().active_tree()->list()->NumLayers()); + EXPECT_EQ(0u, host_impl().active_list()->NumLayers()); scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1); root->AddChild(LayerImpl::Create(host_impl().active_tree(), 2)); root->AddChild(LayerImpl::Create(host_impl().active_tree(), 3)); root->child_at(1)->AddChild(LayerImpl::Create(host_impl().active_tree(), 4)); - EXPECT_EQ(4u, host_impl().active_tree()->list()->NumLayers()); + EXPECT_EQ(4u, host_impl().active_list()->NumLayers()); } TEST_F(LayerTreeImplTest, DeviceScaleFactorNeedsDrawPropertiesUpdate) { diff --git a/cc/trees/tree_synchronizer_unittest.cc b/cc/trees/tree_synchronizer_unittest.cc index 6059a32..f00cb82 100644 --- a/cc/trees/tree_synchronizer_unittest.cc +++ b/cc/trees/tree_synchronizer_unittest.cc @@ -788,7 +788,7 @@ TEST_F(TreeSynchronizerTest, SynchronizeCurrentlyScrollingNode) { host_impl->active_tree()); host_impl->active_tree()->SetCurrentlyScrollingLayer( - host_impl->active_tree()->list()->LayerById(scroll_layer->id())); + host_impl->active_list()->LayerById(scroll_layer->id())); transient_scroll_layer->SetScrollClipLayerId(Layer::INVALID_ID); host_->BuildPropertyTreesForTesting(); |