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/layers/layer_impl.h" | 9 #include "cc/layers/layer_impl.h" |
10 #include "cc/resources/layer_painter.h" | 10 #include "cc/resources/layer_painter.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 Mock::VerifyAndClearExpectations(layer_tree_host_.get()); \ | 34 Mock::VerifyAndClearExpectations(layer_tree_host_.get()); \ |
35 } while (false) | 35 } while (false) |
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(FakeLayerTreeHostClient* client) | 42 explicit MockLayerTreeHost(FakeLayerTreeHostClient* client) |
43 : LayerTreeHost(client, NULL, LayerTreeSettings()) { | 43 : LayerTreeHost(client, NULL, LayerTreeSettings()) { |
44 InitializeSingleThreaded(client); | 44 InitializeSingleThreaded(client, base::MessageLoopProxy::current()); |
45 } | 45 } |
46 | 46 |
47 MOCK_METHOD0(SetNeedsCommit, void()); | 47 MOCK_METHOD0(SetNeedsCommit, void()); |
48 MOCK_METHOD0(SetNeedsUpdateLayers, void()); | 48 MOCK_METHOD0(SetNeedsUpdateLayers, void()); |
49 MOCK_METHOD0(SetNeedsFullTreeSync, void()); | 49 MOCK_METHOD0(SetNeedsFullTreeSync, void()); |
50 }; | 50 }; |
51 | 51 |
52 class MockLayerPainter : public LayerPainter { | 52 class MockLayerPainter : public LayerPainter { |
53 public: | 53 public: |
54 virtual void Paint(SkCanvas* canvas, | 54 virtual void Paint(SkCanvas* canvas, |
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 Mock::VerifyAndClearExpectations(layer_tree_host_.get()); | 866 Mock::VerifyAndClearExpectations(layer_tree_host_.get()); |
867 } | 867 } |
868 | 868 |
869 class LayerTreeHostFactory { | 869 class LayerTreeHostFactory { |
870 public: | 870 public: |
871 LayerTreeHostFactory() | 871 LayerTreeHostFactory() |
872 : client_(FakeLayerTreeHostClient::DIRECT_3D), | 872 : client_(FakeLayerTreeHostClient::DIRECT_3D), |
873 shared_bitmap_manager_(new TestSharedBitmapManager()) {} | 873 shared_bitmap_manager_(new TestSharedBitmapManager()) {} |
874 | 874 |
875 scoped_ptr<LayerTreeHost> Create() { | 875 scoped_ptr<LayerTreeHost> Create() { |
876 return LayerTreeHost::CreateSingleThreaded(&client_, | 876 return LayerTreeHost::CreateSingleThreaded( |
877 &client_, | 877 &client_, |
878 shared_bitmap_manager_.get(), | 878 &client_, |
879 LayerTreeSettings()).Pass(); | 879 shared_bitmap_manager_.get(), |
| 880 LayerTreeSettings(), |
| 881 base::MessageLoopProxy::current()).Pass(); |
880 } | 882 } |
881 | 883 |
882 scoped_ptr<LayerTreeHost> Create(LayerTreeSettings settings) { | 884 scoped_ptr<LayerTreeHost> Create(LayerTreeSettings settings) { |
883 return LayerTreeHost::CreateSingleThreaded( | 885 return LayerTreeHost::CreateSingleThreaded( |
884 &client_, &client_, shared_bitmap_manager_.get(), settings) | 886 &client_, |
885 .Pass(); | 887 &client_, |
| 888 shared_bitmap_manager_.get(), |
| 889 settings, |
| 890 base::MessageLoopProxy::current()).Pass(); |
886 } | 891 } |
887 | 892 |
888 private: | 893 private: |
889 FakeLayerTreeHostClient client_; | 894 FakeLayerTreeHostClient client_; |
890 scoped_ptr<SharedBitmapManager> shared_bitmap_manager_; | 895 scoped_ptr<SharedBitmapManager> shared_bitmap_manager_; |
891 }; | 896 }; |
892 | 897 |
893 void AssertLayerTreeHostMatchesForSubtree(Layer* layer, LayerTreeHost* host) { | 898 void AssertLayerTreeHostMatchesForSubtree(Layer* layer, LayerTreeHost* host) { |
894 EXPECT_EQ(host, layer->layer_tree_host()); | 899 EXPECT_EQ(host, layer->layer_tree_host()); |
895 | 900 |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1142 << "Flags: " << contents_opaque << ", " << layer_opaque << ", " | 1147 << "Flags: " << contents_opaque << ", " << layer_opaque << ", " |
1143 << host_opaque << "\n"; | 1148 << host_opaque << "\n"; |
1144 } | 1149 } |
1145 } | 1150 } |
1146 } | 1151 } |
1147 } | 1152 } |
1148 } | 1153 } |
1149 | 1154 |
1150 } // namespace | 1155 } // namespace |
1151 } // namespace cc | 1156 } // namespace cc |
OLD | NEW |