| 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 20 matching lines...) Expand all Loading... |
| 31 code_to_test; \ | 31 code_to_test; \ |
| 32 Mock::VerifyAndClearExpectations(layer_tree_host_.get()); \ | 32 Mock::VerifyAndClearExpectations(layer_tree_host_.get()); \ |
| 33 } while (false) | 33 } while (false) |
| 34 | 34 |
| 35 | 35 |
| 36 namespace cc { | 36 namespace cc { |
| 37 namespace { | 37 namespace { |
| 38 | 38 |
| 39 class MockLayerTreeHost : public LayerTreeHost { | 39 class MockLayerTreeHost : public LayerTreeHost { |
| 40 public: | 40 public: |
| 41 explicit MockLayerTreeHost(LayerTreeHostClient* client) | 41 explicit MockLayerTreeHost(FakeLayerTreeHostClient* client) |
| 42 : LayerTreeHost(client, NULL, LayerTreeSettings()) { | 42 : LayerTreeHost(client, NULL, LayerTreeSettings()) { |
| 43 Initialize(NULL); | 43 InitializeSingleThreaded(client); |
| 44 } | 44 } |
| 45 | 45 |
| 46 MOCK_METHOD0(SetNeedsCommit, void()); | 46 MOCK_METHOD0(SetNeedsCommit, void()); |
| 47 MOCK_METHOD0(SetNeedsUpdateLayers, void()); | 47 MOCK_METHOD0(SetNeedsUpdateLayers, 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, |
| (...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 | 796 |
| 797 EXPECT_EQ(replica, replica->mask_layer()->parent()); | 797 EXPECT_EQ(replica, replica->mask_layer()->parent()); |
| 798 } | 798 } |
| 799 | 799 |
| 800 class LayerTreeHostFactory { | 800 class LayerTreeHostFactory { |
| 801 public: | 801 public: |
| 802 LayerTreeHostFactory() | 802 LayerTreeHostFactory() |
| 803 : client_(FakeLayerTreeHostClient::DIRECT_3D) {} | 803 : client_(FakeLayerTreeHostClient::DIRECT_3D) {} |
| 804 | 804 |
| 805 scoped_ptr<LayerTreeHost> Create() { | 805 scoped_ptr<LayerTreeHost> Create() { |
| 806 return LayerTreeHost::Create(&client_, NULL, LayerTreeSettings(), NULL) | 806 return LayerTreeHost::CreateSingleThreaded(&client_, |
| 807 .Pass(); | 807 &client_, |
| 808 NULL, |
| 809 LayerTreeSettings()).Pass(); |
| 808 } | 810 } |
| 809 | 811 |
| 810 scoped_ptr<LayerTreeHost> Create(LayerTreeSettings settings) { | 812 scoped_ptr<LayerTreeHost> Create(LayerTreeSettings settings) { |
| 811 return LayerTreeHost::Create(&client_, NULL, settings, NULL).Pass(); | 813 return LayerTreeHost::CreateSingleThreaded(&client_, |
| 814 &client_, |
| 815 NULL, |
| 816 settings).Pass(); |
| 812 } | 817 } |
| 813 | 818 |
| 814 private: | 819 private: |
| 815 FakeLayerTreeHostClient client_; | 820 FakeLayerTreeHostClient client_; |
| 816 }; | 821 }; |
| 817 | 822 |
| 818 void AssertLayerTreeHostMatchesForSubtree(Layer* layer, LayerTreeHost* host) { | 823 void AssertLayerTreeHostMatchesForSubtree(Layer* layer, LayerTreeHost* host) { |
| 819 EXPECT_EQ(host, layer->layer_tree_host()); | 824 EXPECT_EQ(host, layer->layer_tree_host()); |
| 820 | 825 |
| 821 for (size_t i = 0; i < layer->children().size(); ++i) | 826 for (size_t i = 0; i < layer->children().size(); ++i) |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1067 << "Flags: " << contents_opaque << ", " << layer_opaque << ", " | 1072 << "Flags: " << contents_opaque << ", " << layer_opaque << ", " |
| 1068 << host_opaque << "\n"; | 1073 << host_opaque << "\n"; |
| 1069 } | 1074 } |
| 1070 } | 1075 } |
| 1071 } | 1076 } |
| 1072 } | 1077 } |
| 1073 } | 1078 } |
| 1074 | 1079 |
| 1075 } // namespace | 1080 } // namespace |
| 1076 } // namespace cc | 1081 } // namespace cc |
| OLD | NEW |