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

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

Issue 1912893002: cc : Stop pushing properties not used by LayerImpl to LayerImpl. (2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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.h" 5 #include "cc/layers/layer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.h"
10 #include "cc/animation/animation_host.h" 10 #include "cc/animation/animation_host.h"
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 scoped_refptr<Layer> child2 = Layer::Create(); 962 scoped_refptr<Layer> child2 = Layer::Create();
963 scoped_refptr<Layer> grand_child = Layer::Create(); 963 scoped_refptr<Layer> grand_child = Layer::Create();
964 scoped_refptr<Layer> dummy_layer1 = Layer::Create(); 964 scoped_refptr<Layer> dummy_layer1 = Layer::Create();
965 scoped_refptr<Layer> dummy_layer2 = Layer::Create(); 965 scoped_refptr<Layer> dummy_layer2 = Layer::Create();
966 966
967 layer_tree_host_->SetRootLayer(root); 967 layer_tree_host_->SetRootLayer(root);
968 root->AddChild(child); 968 root->AddChild(child);
969 root->AddChild(child2); 969 root->AddChild(child2);
970 child->AddChild(grand_child); 970 child->AddChild(grand_child);
971 EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(AtLeast(1)); 971 EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(AtLeast(1));
972 child->SetForceRenderSurface(true); 972 child->SetForceRenderSurfaceForTesting(true);
973 EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(AtLeast(1)); 973 EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(AtLeast(1));
974 child2->SetScrollParent(grand_child.get()); 974 child2->SetScrollParent(grand_child.get());
975 SkXfermode::Mode arbitrary_blend_mode = SkXfermode::kMultiply_Mode; 975 SkXfermode::Mode arbitrary_blend_mode = SkXfermode::kMultiply_Mode;
976 std::unique_ptr<LayerImpl> root_impl = 976 std::unique_ptr<LayerImpl> root_impl =
977 LayerImpl::Create(host_impl_.active_tree(), root->id()); 977 LayerImpl::Create(host_impl_.active_tree(), root->id());
978 std::unique_ptr<LayerImpl> child_impl = 978 std::unique_ptr<LayerImpl> child_impl =
979 LayerImpl::Create(host_impl_.active_tree(), child->id()); 979 LayerImpl::Create(host_impl_.active_tree(), child->id());
980 std::unique_ptr<LayerImpl> child2_impl = 980 std::unique_ptr<LayerImpl> child2_impl =
981 LayerImpl::Create(host_impl_.active_tree(), child2->id()); 981 LayerImpl::Create(host_impl_.active_tree(), child2->id());
982 std::unique_ptr<LayerImpl> grand_child_impl = 982 std::unique_ptr<LayerImpl> grand_child_impl =
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
1653 gfx::ScrollOffset(10, 10))); 1653 gfx::ScrollOffset(10, 10)));
1654 EXPECT_SET_NEEDS_COMMIT(1, test_layer->AddMainThreadScrollingReasons( 1654 EXPECT_SET_NEEDS_COMMIT(1, test_layer->AddMainThreadScrollingReasons(
1655 MainThreadScrollingReason::kEventHandlers)); 1655 MainThreadScrollingReason::kEventHandlers));
1656 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetNonFastScrollableRegion( 1656 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetNonFastScrollableRegion(
1657 Region(gfx::Rect(1, 1, 2, 2)))); 1657 Region(gfx::Rect(1, 1, 2, 2))));
1658 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetTransform( 1658 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetTransform(
1659 gfx::Transform(0.0, 0.0, 0.0, 0.0, 0.0, 0.0))); 1659 gfx::Transform(0.0, 0.0, 0.0, 0.0, 0.0, 0.0)));
1660 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetDoubleSided(false)); 1660 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetDoubleSided(false));
1661 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetTouchEventHandlerRegion( 1661 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetTouchEventHandlerRegion(
1662 gfx::Rect(10, 10))); 1662 gfx::Rect(10, 10)));
1663 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetForceRenderSurface(true)); 1663 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetForceRenderSurfaceForTesting(true));
1664 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetHideLayerAndSubtree(true)); 1664 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetHideLayerAndSubtree(true));
1665 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetElementId(2)); 1665 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetElementId(2));
1666 EXPECT_SET_NEEDS_COMMIT( 1666 EXPECT_SET_NEEDS_COMMIT(
1667 1, test_layer->SetMutableProperties(MutableProperty::kTransform)); 1667 1, test_layer->SetMutableProperties(MutableProperty::kTransform));
1668 1668
1669 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, test_layer->SetMaskLayer( 1669 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, test_layer->SetMaskLayer(
1670 dummy_layer1.get())); 1670 dummy_layer1.get()));
1671 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, test_layer->SetReplicaLayer( 1671 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, test_layer->SetReplicaLayer(
1672 dummy_layer2.get())); 1672 dummy_layer2.get()));
1673 1673
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
2512 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties()); 2512 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties());
2513 2513
2514 test_layer->PushPropertiesTo(impl_layer.get()); 2514 test_layer->PushPropertiesTo(impl_layer.get());
2515 2515
2516 EXPECT_EQ(2lu, impl_layer->element_id()); 2516 EXPECT_EQ(2lu, impl_layer->element_id());
2517 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties()); 2517 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties());
2518 } 2518 }
2519 2519
2520 } // namespace 2520 } // namespace
2521 } // namespace cc 2521 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_position_constraint_unittest.cc ('k') | cc/layers/nine_patch_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698