| 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" | |
| 11 #include "cc/test/animation_test_common.h" | 10 #include "cc/test/animation_test_common.h" |
| 12 #include "cc/test/fake_impl_proxy.h" | 11 #include "cc/test/fake_impl_proxy.h" |
| 13 #include "cc/test/fake_layer_tree_host_client.h" | 12 #include "cc/test/fake_layer_tree_host_client.h" |
| 14 #include "cc/test/fake_layer_tree_host_impl.h" | 13 #include "cc/test/fake_layer_tree_host_impl.h" |
| 15 #include "cc/test/geometry_test_utils.h" | 14 #include "cc/test/geometry_test_utils.h" |
| 16 #include "cc/test/layer_test_common.h" | 15 #include "cc/test/layer_test_common.h" |
| 17 #include "cc/test/test_shared_bitmap_manager.h" | 16 #include "cc/test/test_shared_bitmap_manager.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" |
| 20 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 42 explicit MockLayerTreeHost(FakeLayerTreeHostClient* client) | 41 explicit MockLayerTreeHost(FakeLayerTreeHostClient* client) |
| 43 : LayerTreeHost(client, NULL, LayerTreeSettings()) { | 42 : LayerTreeHost(client, NULL, LayerTreeSettings()) { |
| 44 InitializeSingleThreaded(client); | 43 InitializeSingleThreaded(client); |
| 45 } | 44 } |
| 46 | 45 |
| 47 MOCK_METHOD0(SetNeedsCommit, void()); | 46 MOCK_METHOD0(SetNeedsCommit, void()); |
| 48 MOCK_METHOD0(SetNeedsUpdateLayers, void()); | 47 MOCK_METHOD0(SetNeedsUpdateLayers, void()); |
| 49 MOCK_METHOD0(SetNeedsFullTreeSync, void()); | 48 MOCK_METHOD0(SetNeedsFullTreeSync, void()); |
| 50 }; | 49 }; |
| 51 | 50 |
| 52 class MockLayerPainter : public LayerPainter { | |
| 53 public: | |
| 54 virtual void Paint(SkCanvas* canvas, | |
| 55 const gfx::Rect& content_rect, | |
| 56 gfx::RectF* opaque) OVERRIDE {} | |
| 57 }; | |
| 58 | |
| 59 | |
| 60 class LayerTest : public testing::Test { | 51 class LayerTest : public testing::Test { |
| 61 public: | 52 public: |
| 62 LayerTest() | 53 LayerTest() |
| 63 : host_impl_(&proxy_, &shared_bitmap_manager_), | 54 : host_impl_(&proxy_, &shared_bitmap_manager_), |
| 64 fake_client_(FakeLayerTreeHostClient::DIRECT_3D) {} | 55 fake_client_(FakeLayerTreeHostClient::DIRECT_3D) {} |
| 65 | 56 |
| 66 protected: | 57 protected: |
| 67 virtual void SetUp() OVERRIDE { | 58 virtual void SetUp() OVERRIDE { |
| 68 layer_tree_host_.reset(new StrictMock<MockLayerTreeHost>(&fake_client_)); | 59 layer_tree_host_.reset(new StrictMock<MockLayerTreeHost>(&fake_client_)); |
| 69 } | 60 } |
| (...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1143 << "Flags: " << contents_opaque << ", " << layer_opaque << ", " | 1134 << "Flags: " << contents_opaque << ", " << layer_opaque << ", " |
| 1144 << host_opaque << "\n"; | 1135 << host_opaque << "\n"; |
| 1145 } | 1136 } |
| 1146 } | 1137 } |
| 1147 } | 1138 } |
| 1148 } | 1139 } |
| 1149 } | 1140 } |
| 1150 | 1141 |
| 1151 } // namespace | 1142 } // namespace |
| 1152 } // namespace cc | 1143 } // namespace cc |
| OLD | NEW |