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

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

Issue 2051013002: cc : Push layer lists instead of layer tree at commit and activation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/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 1694 matching lines...) Expand 10 before | Expand all | Expand 10 after
1705 1705
1706 TEST_F(LayerTest, PushPropertiesAccumulatesUpdateRect) { 1706 TEST_F(LayerTest, PushPropertiesAccumulatesUpdateRect) {
1707 scoped_refptr<Layer> test_layer = Layer::Create(); 1707 scoped_refptr<Layer> test_layer = Layer::Create();
1708 std::unique_ptr<LayerImpl> impl_layer = 1708 std::unique_ptr<LayerImpl> impl_layer =
1709 LayerImpl::Create(host_impl_.active_tree(), 1); 1709 LayerImpl::Create(host_impl_.active_tree(), 1);
1710 1710
1711 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, 1711 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1,
1712 layer_tree_host_->SetRootLayer(test_layer)); 1712 layer_tree_host_->SetRootLayer(test_layer));
1713 1713
1714 host_impl_.active_tree()->SetRootLayer(std::move(impl_layer)); 1714 host_impl_.active_tree()->SetRootLayer(std::move(impl_layer));
1715 host_impl_.active_tree()->BuildLayerListForTesting();
1715 LayerImpl* impl_layer_ptr = host_impl_.active_tree()->LayerById(1); 1716 LayerImpl* impl_layer_ptr = host_impl_.active_tree()->LayerById(1);
1716 test_layer->SetNeedsDisplayRect(gfx::Rect(5, 5)); 1717 test_layer->SetNeedsDisplayRect(gfx::Rect(5, 5));
1717 test_layer->PushPropertiesTo(impl_layer_ptr); 1718 test_layer->PushPropertiesTo(impl_layer_ptr);
1718 EXPECT_FLOAT_RECT_EQ(gfx::RectF(0.f, 0.f, 5.f, 5.f), 1719 EXPECT_FLOAT_RECT_EQ(gfx::RectF(0.f, 0.f, 5.f, 5.f),
1719 impl_layer_ptr->update_rect()); 1720 impl_layer_ptr->update_rect());
1720 1721
1721 // The LayerImpl's update_rect() should be accumulated here, since we did not 1722 // The LayerImpl's update_rect() should be accumulated here, since we did not
1722 // do anything to clear it. 1723 // do anything to clear it.
1723 test_layer->SetNeedsDisplayRect(gfx::Rect(10, 10, 5, 5)); 1724 test_layer->SetNeedsDisplayRect(gfx::Rect(10, 10, 5, 5));
1724 test_layer->PushPropertiesTo(impl_layer_ptr); 1725 test_layer->PushPropertiesTo(impl_layer_ptr);
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
2493 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties()); 2494 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties());
2494 2495
2495 test_layer->PushPropertiesTo(impl_layer.get()); 2496 test_layer->PushPropertiesTo(impl_layer.get());
2496 2497
2497 EXPECT_EQ(2lu, impl_layer->element_id()); 2498 EXPECT_EQ(2lu, impl_layer->element_id());
2498 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties()); 2499 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties());
2499 } 2500 }
2500 2501
2501 } // namespace 2502 } // namespace
2502 } // namespace cc 2503 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_position_constraint_unittest.cc ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698