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/layers/layer.h" | 5 #include "cc/layers/layer.h" |
6 | 6 |
7 #include "cc/animation/keyframed_animation_curve.h" | 7 #include "cc/animation/keyframed_animation_curve.h" |
8 #include "cc/base/math_util.h" | 8 #include "cc/base/math_util.h" |
9 #include "cc/base/thread.h" | 9 #include "cc/base/thread.h" |
10 #include "cc/layers/layer_impl.h" | 10 #include "cc/layers/layer_impl.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 } while (false) | 34 } while (false) |
35 | 35 |
36 | 36 |
37 namespace cc { | 37 namespace cc { |
38 namespace { | 38 namespace { |
39 | 39 |
40 class MockLayerTreeHost : public LayerTreeHost { | 40 class MockLayerTreeHost : public LayerTreeHost { |
41 public: | 41 public: |
42 explicit MockLayerTreeHost(LayerTreeHostClient* client) | 42 explicit MockLayerTreeHost(LayerTreeHostClient* client) |
43 : LayerTreeHost(client, LayerTreeSettings()) { | 43 : LayerTreeHost(client, LayerTreeSettings()) { |
44 Initialize(scoped_ptr<Thread>(NULL)); | 44 Initialize(scoped_ptr<Thread>()); |
45 } | 45 } |
46 | 46 |
47 MOCK_METHOD0(SetNeedsCommit, void()); | 47 MOCK_METHOD0(SetNeedsCommit, void()); |
48 MOCK_METHOD0(SetNeedsFullTreeSync, void()); | 48 MOCK_METHOD0(SetNeedsFullTreeSync, void()); |
49 }; | 49 }; |
50 | 50 |
51 class MockLayerPainter : public LayerPainter { | 51 class MockLayerPainter : public LayerPainter { |
52 public: | 52 public: |
53 virtual void Paint(SkCanvas* canvas, | 53 virtual void Paint(SkCanvas* canvas, |
54 gfx::Rect content_rect, | 54 gfx::Rect content_rect, |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 | 727 |
728 EXPECT_EQ(replica, replica->mask_layer()->parent()); | 728 EXPECT_EQ(replica, replica->mask_layer()->parent()); |
729 } | 729 } |
730 | 730 |
731 class LayerTreeHostFactory { | 731 class LayerTreeHostFactory { |
732 public: | 732 public: |
733 LayerTreeHostFactory() | 733 LayerTreeHostFactory() |
734 : client_(FakeLayerTreeHostClient::DIRECT_3D) {} | 734 : client_(FakeLayerTreeHostClient::DIRECT_3D) {} |
735 | 735 |
736 scoped_ptr<LayerTreeHost> Create() { | 736 scoped_ptr<LayerTreeHost> Create() { |
737 return LayerTreeHost::Create(&client_, | 737 return LayerTreeHost::Create( |
738 LayerTreeSettings(), | 738 &client_, LayerTreeSettings(), scoped_ptr<Thread>()).Pass(); |
739 scoped_ptr<Thread>(NULL)).Pass(); | |
740 } | 739 } |
741 | 740 |
742 scoped_ptr<LayerTreeHost> Create(LayerTreeSettings settings) { | 741 scoped_ptr<LayerTreeHost> Create(LayerTreeSettings settings) { |
743 return LayerTreeHost::Create(&client_, | 742 return LayerTreeHost::Create(&client_, settings, scoped_ptr<Thread>()) |
744 settings, | 743 .Pass(); |
745 scoped_ptr<Thread>(NULL)).Pass(); | |
746 } | 744 } |
747 | 745 |
748 private: | 746 private: |
749 FakeLayerTreeHostClient client_; | 747 FakeLayerTreeHostClient client_; |
750 }; | 748 }; |
751 | 749 |
752 void AssertLayerTreeHostMatchesForSubtree(Layer* layer, LayerTreeHost* host) { | 750 void AssertLayerTreeHostMatchesForSubtree(Layer* layer, LayerTreeHost* host) { |
753 EXPECT_EQ(host, layer->layer_tree_host()); | 751 EXPECT_EQ(host, layer->layer_tree_host()); |
754 | 752 |
755 for (size_t i = 0; i < layer->children().size(); ++i) | 753 for (size_t i = 0; i < layer->children().size(); ++i) |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 << "Flags: " << contents_opaque << ", " << layer_opaque << ", " | 1000 << "Flags: " << contents_opaque << ", " << layer_opaque << ", " |
1003 << host_opaque << "\n"; | 1001 << host_opaque << "\n"; |
1004 } | 1002 } |
1005 } | 1003 } |
1006 } | 1004 } |
1007 } | 1005 } |
1008 } | 1006 } |
1009 | 1007 |
1010 } // namespace | 1008 } // namespace |
1011 } // namespace cc | 1009 } // namespace cc |
OLD | NEW |