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, base::MessageLoopProxy::current()); | 44 InitializeSingleThreaded(client, |
45 base::MessageLoopProxy::current(), | |
46 scoped_ptr<ExternalBeginFrameSource>()); | |
danakj
2014/10/10 16:03:35
pass nullptr instead
simonhong
2014/10/15 01:04:21
Done.
| |
45 } | 47 } |
46 | 48 |
47 MOCK_METHOD0(SetNeedsCommit, void()); | 49 MOCK_METHOD0(SetNeedsCommit, void()); |
48 MOCK_METHOD0(SetNeedsUpdateLayers, void()); | 50 MOCK_METHOD0(SetNeedsUpdateLayers, void()); |
49 MOCK_METHOD0(SetNeedsFullTreeSync, void()); | 51 MOCK_METHOD0(SetNeedsFullTreeSync, void()); |
50 }; | 52 }; |
51 | 53 |
52 class MockLayerPainter : public LayerPainter { | 54 class MockLayerPainter : public LayerPainter { |
53 public: | 55 public: |
54 virtual void Paint(SkCanvas* canvas, const gfx::Rect& content_rect) override { | 56 virtual void Paint(SkCanvas* canvas, const gfx::Rect& content_rect) override { |
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
927 LayerTreeHostFactory() | 929 LayerTreeHostFactory() |
928 : client_(FakeLayerTreeHostClient::DIRECT_3D), | 930 : client_(FakeLayerTreeHostClient::DIRECT_3D), |
929 shared_bitmap_manager_(new TestSharedBitmapManager()) {} | 931 shared_bitmap_manager_(new TestSharedBitmapManager()) {} |
930 | 932 |
931 scoped_ptr<LayerTreeHost> Create() { | 933 scoped_ptr<LayerTreeHost> Create() { |
932 return LayerTreeHost::CreateSingleThreaded( | 934 return LayerTreeHost::CreateSingleThreaded( |
933 &client_, | 935 &client_, |
934 &client_, | 936 &client_, |
935 shared_bitmap_manager_.get(), | 937 shared_bitmap_manager_.get(), |
936 LayerTreeSettings(), | 938 LayerTreeSettings(), |
937 base::MessageLoopProxy::current()).Pass(); | 939 base::MessageLoopProxy::current(), |
940 scoped_ptr<ExternalBeginFrameSource>()).Pass(); | |
danakj
2014/10/10 16:03:35
nullptr here, etc
simonhong
2014/10/15 01:04:21
Done.
| |
938 } | 941 } |
939 | 942 |
940 scoped_ptr<LayerTreeHost> Create(LayerTreeSettings settings) { | 943 scoped_ptr<LayerTreeHost> Create(LayerTreeSettings settings) { |
941 return LayerTreeHost::CreateSingleThreaded( | 944 return LayerTreeHost::CreateSingleThreaded( |
942 &client_, | 945 &client_, |
943 &client_, | 946 &client_, |
944 shared_bitmap_manager_.get(), | 947 shared_bitmap_manager_.get(), |
945 settings, | 948 settings, |
946 base::MessageLoopProxy::current()).Pass(); | 949 base::MessageLoopProxy::current(), |
950 scoped_ptr<ExternalBeginFrameSource>()).Pass(); | |
947 } | 951 } |
948 | 952 |
949 private: | 953 private: |
950 FakeLayerTreeHostClient client_; | 954 FakeLayerTreeHostClient client_; |
951 scoped_ptr<SharedBitmapManager> shared_bitmap_manager_; | 955 scoped_ptr<SharedBitmapManager> shared_bitmap_manager_; |
952 }; | 956 }; |
953 | 957 |
954 void AssertLayerTreeHostMatchesForSubtree(Layer* layer, LayerTreeHost* host) { | 958 void AssertLayerTreeHostMatchesForSubtree(Layer* layer, LayerTreeHost* host) { |
955 EXPECT_EQ(host, layer->layer_tree_host()); | 959 EXPECT_EQ(host, layer->layer_tree_host()); |
956 | 960 |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1245 root_layer->AddChild(becomes_not_draws_content); | 1249 root_layer->AddChild(becomes_not_draws_content); |
1246 EXPECT_EQ(0, root_layer->NumDescendantsThatDrawContent()); | 1250 EXPECT_EQ(0, root_layer->NumDescendantsThatDrawContent()); |
1247 | 1251 |
1248 becomes_draws_content->SetIsDrawable(true); | 1252 becomes_draws_content->SetIsDrawable(true); |
1249 root_layer->AddChild(becomes_draws_content); | 1253 root_layer->AddChild(becomes_draws_content); |
1250 EXPECT_EQ(1, root_layer->NumDescendantsThatDrawContent()); | 1254 EXPECT_EQ(1, root_layer->NumDescendantsThatDrawContent()); |
1251 } | 1255 } |
1252 | 1256 |
1253 } // namespace | 1257 } // namespace |
1254 } // namespace cc | 1258 } // namespace cc |
OLD | NEW |