| OLD | NEW |
| 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/trees/tree_synchronizer.h" | 5 #include "cc/trees/tree_synchronizer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 class MockLayer : public Layer { | 50 class MockLayer : public Layer { |
| 51 public: | 51 public: |
| 52 static scoped_refptr<MockLayer> Create( | 52 static scoped_refptr<MockLayer> Create( |
| 53 std::vector<int>* layer_impl_destruction_list) { | 53 std::vector<int>* layer_impl_destruction_list) { |
| 54 return make_scoped_refptr(new MockLayer(layer_impl_destruction_list)); | 54 return make_scoped_refptr(new MockLayer(layer_impl_destruction_list)); |
| 55 } | 55 } |
| 56 | 56 |
| 57 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) | 57 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) |
| 58 OVERRIDE { | 58 override { |
| 59 return MockLayerImpl::Create(tree_impl, layer_id_); | 59 return MockLayerImpl::Create(tree_impl, layer_id_); |
| 60 } | 60 } |
| 61 | 61 |
| 62 virtual void PushPropertiesTo(LayerImpl* layer_impl) OVERRIDE { | 62 virtual void PushPropertiesTo(LayerImpl* layer_impl) override { |
| 63 Layer::PushPropertiesTo(layer_impl); | 63 Layer::PushPropertiesTo(layer_impl); |
| 64 | 64 |
| 65 MockLayerImpl* mock_layer_impl = static_cast<MockLayerImpl*>(layer_impl); | 65 MockLayerImpl* mock_layer_impl = static_cast<MockLayerImpl*>(layer_impl); |
| 66 mock_layer_impl->SetLayerImplDestructionList(layer_impl_destruction_list_); | 66 mock_layer_impl->SetLayerImplDestructionList(layer_impl_destruction_list_); |
| 67 } | 67 } |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 explicit MockLayer(std::vector<int>* layer_impl_destruction_list) | 70 explicit MockLayer(std::vector<int>* layer_impl_destruction_list) |
| 71 : Layer(), layer_impl_destruction_list_(layer_impl_destruction_list) {} | 71 : Layer(), layer_impl_destruction_list_(layer_impl_destruction_list) {} |
| 72 virtual ~MockLayer() {} | 72 virtual ~MockLayer() {} |
| (...skipping 11 matching lines...) Expand all Loading... |
| 84 bool SynchronizedAnimations() const { return synchronized_animations_; } | 84 bool SynchronizedAnimations() const { return synchronized_animations_; } |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 FakeLayerAnimationController() | 87 FakeLayerAnimationController() |
| 88 : LayerAnimationController(1), | 88 : LayerAnimationController(1), |
| 89 synchronized_animations_(false) {} | 89 synchronized_animations_(false) {} |
| 90 | 90 |
| 91 virtual ~FakeLayerAnimationController() {} | 91 virtual ~FakeLayerAnimationController() {} |
| 92 | 92 |
| 93 virtual void PushAnimationUpdatesTo(LayerAnimationController* controller_impl) | 93 virtual void PushAnimationUpdatesTo(LayerAnimationController* controller_impl) |
| 94 OVERRIDE { | 94 override { |
| 95 LayerAnimationController::PushAnimationUpdatesTo(controller_impl); | 95 LayerAnimationController::PushAnimationUpdatesTo(controller_impl); |
| 96 synchronized_animations_ = true; | 96 synchronized_animations_ = true; |
| 97 } | 97 } |
| 98 | 98 |
| 99 bool synchronized_animations_; | 99 bool synchronized_animations_; |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 void ExpectTreesAreIdentical(Layer* layer, | 102 void ExpectTreesAreIdentical(Layer* layer, |
| 103 LayerImpl* layer_impl, | 103 LayerImpl* layer_impl, |
| 104 LayerTreeImpl* tree_impl) { | 104 LayerTreeImpl* tree_impl) { |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 host_impl->active_tree()); | 751 host_impl->active_tree()); |
| 752 | 752 |
| 753 // The clip children should have been unhooked. | 753 // The clip children should have been unhooked. |
| 754 EXPECT_EQ(2u, intervening->children().size()); | 754 EXPECT_EQ(2u, intervening->children().size()); |
| 755 EXPECT_FALSE(clip_child2->clip_parent()); | 755 EXPECT_FALSE(clip_child2->clip_parent()); |
| 756 EXPECT_FALSE(additional_clip_child->clip_parent()); | 756 EXPECT_FALSE(additional_clip_child->clip_parent()); |
| 757 } | 757 } |
| 758 | 758 |
| 759 } // namespace | 759 } // namespace |
| 760 } // namespace cc | 760 } // namespace cc |
| OLD | NEW |