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

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

Issue 1973083002: Use element id's for animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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_unittest.cc ('k') | cc/layers/layer_utils_unittest.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.h" 5 #include "cc/layers/layer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
10 #include "cc/animation/animation_host.h" 10 #include "cc/animation/animation_host.h"
(...skipping 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after
1702 MainThreadScrollingReason::kEventHandlers)); 1702 MainThreadScrollingReason::kEventHandlers));
1703 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetNonFastScrollableRegion( 1703 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetNonFastScrollableRegion(
1704 Region(gfx::Rect(1, 1, 2, 2)))); 1704 Region(gfx::Rect(1, 1, 2, 2))));
1705 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetTransform( 1705 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetTransform(
1706 gfx::Transform(0.0, 0.0, 0.0, 0.0, 0.0, 0.0))); 1706 gfx::Transform(0.0, 0.0, 0.0, 0.0, 0.0, 0.0)));
1707 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetDoubleSided(false)); 1707 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetDoubleSided(false));
1708 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetTouchEventHandlerRegion( 1708 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetTouchEventHandlerRegion(
1709 gfx::Rect(10, 10))); 1709 gfx::Rect(10, 10)));
1710 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetForceRenderSurfaceForTesting(true)); 1710 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetForceRenderSurfaceForTesting(true));
1711 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetHideLayerAndSubtree(true)); 1711 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetHideLayerAndSubtree(true));
1712 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetElementId(2)); 1712 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetElementId(ElementId(2, 0)));
1713 EXPECT_SET_NEEDS_COMMIT( 1713 EXPECT_SET_NEEDS_COMMIT(
1714 1, test_layer->SetMutableProperties(MutableProperty::kTransform)); 1714 1, test_layer->SetMutableProperties(MutableProperty::kTransform));
1715 1715
1716 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, test_layer->SetMaskLayer( 1716 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, test_layer->SetMaskLayer(
1717 dummy_layer1.get())); 1717 dummy_layer1.get()));
1718 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, test_layer->SetReplicaLayer( 1718 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, test_layer->SetReplicaLayer(
1719 dummy_layer2.get())); 1719 dummy_layer2.get()));
1720 1720
1721 // The above tests should not have caused a change to the needs_display flag. 1721 // The above tests should not have caused a change to the needs_display flag.
1722 EXPECT_FALSE(test_layer->NeedsDisplayForTesting()); 1722 EXPECT_FALSE(test_layer->NeedsDisplayForTesting());
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
2502 TEST_F(LayerTest, ElementIdAndMutablePropertiesArePushed) { 2502 TEST_F(LayerTest, ElementIdAndMutablePropertiesArePushed) {
2503 scoped_refptr<Layer> test_layer = Layer::Create(); 2503 scoped_refptr<Layer> test_layer = Layer::Create();
2504 std::unique_ptr<LayerImpl> impl_layer = 2504 std::unique_ptr<LayerImpl> impl_layer =
2505 LayerImpl::Create(host_impl_.active_tree(), 1); 2505 LayerImpl::Create(host_impl_.active_tree(), 1);
2506 2506
2507 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, 2507 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1,
2508 layer_tree_host_->SetRootLayer(test_layer)); 2508 layer_tree_host_->SetRootLayer(test_layer));
2509 2509
2510 EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(2); 2510 EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(2);
2511 2511
2512 test_layer->SetElementId(2); 2512 test_layer->SetElementId(ElementId(2, 0));
2513 test_layer->SetMutableProperties(MutableProperty::kTransform); 2513 test_layer->SetMutableProperties(MutableProperty::kTransform);
2514 2514
2515 EXPECT_EQ(0lu, impl_layer->element_id()); 2515 EXPECT_FALSE(impl_layer->element_id());
2516 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties()); 2516 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties());
2517 2517
2518 test_layer->PushPropertiesTo(impl_layer.get()); 2518 test_layer->PushPropertiesTo(impl_layer.get());
2519 2519
2520 EXPECT_EQ(2lu, impl_layer->element_id()); 2520 EXPECT_EQ(ElementId(2, 0), impl_layer->element_id());
2521 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties()); 2521 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties());
2522 } 2522 }
2523 2523
2524 } // namespace 2524 } // namespace
2525 } // namespace cc 2525 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl_unittest.cc ('k') | cc/layers/layer_utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698