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