| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/test/layer_test_common.h" | 5 #include "cc/test/layer_test_common.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "cc/animation/animation_host.h" | 9 #include "cc/animation/animation_host.h" |
| 10 #include "cc/animation/animation_id_provider.h" | 10 #include "cc/animation/animation_id_provider.h" |
| 11 #include "cc/animation/animation_player.h" | 11 #include "cc/animation/animation_player.h" |
| 12 #include "cc/base/math_util.h" | 12 #include "cc/base/math_util.h" |
| 13 #include "cc/base/region.h" | 13 #include "cc/base/region.h" |
| 14 #include "cc/layers/append_quads_data.h" | 14 #include "cc/layers/append_quads_data.h" |
| 15 #include "cc/output/copy_output_request.h" | 15 #include "cc/output/copy_output_request.h" |
| 16 #include "cc/output/copy_output_result.h" | 16 #include "cc/output/copy_output_result.h" |
| 17 #include "cc/quads/draw_quad.h" | 17 #include "cc/quads/draw_quad.h" |
| 18 #include "cc/quads/render_pass.h" | 18 #include "cc/quads/render_pass.h" |
| 19 #include "cc/test/animation_test_common.h" | 19 #include "cc/test/animation_test_common.h" |
| 20 #include "cc/test/fake_compositor_frame_sink.h" | 20 #include "cc/test/fake_compositor_frame_sink.h" |
| 21 #include "cc/test/layer_tree_settings_for_testing.h" | |
| 22 #include "cc/test/mock_occlusion_tracker.h" | 21 #include "cc/test/mock_occlusion_tracker.h" |
| 23 #include "cc/trees/layer_tree_host_common.h" | 22 #include "cc/trees/layer_tree_host_common.h" |
| 24 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
| 25 #include "ui/gfx/geometry/point_conversions.h" | 24 #include "ui/gfx/geometry/point_conversions.h" |
| 26 #include "ui/gfx/geometry/rect.h" | 25 #include "ui/gfx/geometry/rect.h" |
| 27 #include "ui/gfx/geometry/rect_conversions.h" | 26 #include "ui/gfx/geometry/rect_conversions.h" |
| 28 #include "ui/gfx/geometry/size_conversions.h" | 27 #include "ui/gfx/geometry/size_conversions.h" |
| 29 | 28 |
| 30 namespace cc { | 29 namespace cc { |
| 31 | 30 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 EXPECT_EQ(quad->rect.ToString(), quad->visible_rect.ToString()); | 110 EXPECT_EQ(quad->rect.ToString(), quad->visible_rect.ToString()); |
| 112 } else { | 111 } else { |
| 113 EXPECT_NE(quad->rect.ToString(), quad->visible_rect.ToString()); | 112 EXPECT_NE(quad->rect.ToString(), quad->visible_rect.ToString()); |
| 114 EXPECT_TRUE(quad->rect.Contains(quad->visible_rect)); | 113 EXPECT_TRUE(quad->rect.Contains(quad->visible_rect)); |
| 115 ++(*partially_occluded_count); | 114 ++(*partially_occluded_count); |
| 116 } | 115 } |
| 117 } | 116 } |
| 118 } | 117 } |
| 119 | 118 |
| 120 LayerTestCommon::LayerImplTest::LayerImplTest() | 119 LayerTestCommon::LayerImplTest::LayerImplTest() |
| 121 : LayerImplTest(LayerTreeSettingsForTesting()) {} | 120 : LayerImplTest(LayerTreeSettings()) {} |
| 122 | 121 |
| 123 LayerTestCommon::LayerImplTest::LayerImplTest( | 122 LayerTestCommon::LayerImplTest::LayerImplTest( |
| 124 std::unique_ptr<CompositorFrameSink> compositor_frame_sink) | 123 std::unique_ptr<CompositorFrameSink> compositor_frame_sink) |
| 125 : LayerImplTest(LayerTreeSettingsForTesting(), | 124 : LayerImplTest(LayerTreeSettings(), std::move(compositor_frame_sink)) {} |
| 126 std::move(compositor_frame_sink)) {} | |
| 127 | 125 |
| 128 LayerTestCommon::LayerImplTest::LayerImplTest(const LayerTreeSettings& settings) | 126 LayerTestCommon::LayerImplTest::LayerImplTest(const LayerTreeSettings& settings) |
| 129 : LayerImplTest(settings, FakeCompositorFrameSink::Create3d()) {} | 127 : LayerImplTest(settings, FakeCompositorFrameSink::Create3d()) {} |
| 130 | 128 |
| 131 LayerTestCommon::LayerImplTest::LayerImplTest( | 129 LayerTestCommon::LayerImplTest::LayerImplTest( |
| 132 const LayerTreeSettings& settings, | 130 const LayerTreeSettings& settings, |
| 133 std::unique_ptr<CompositorFrameSink> compositor_frame_sink) | 131 std::unique_ptr<CompositorFrameSink> compositor_frame_sink) |
| 134 : compositor_frame_sink_(std::move(compositor_frame_sink)), | 132 : compositor_frame_sink_(std::move(compositor_frame_sink)), |
| 135 animation_host_(AnimationHost::CreateForTesting(ThreadInstance::MAIN)), | 133 animation_host_(AnimationHost::CreateForTesting(ThreadInstance::MAIN)), |
| 136 host_(FakeLayerTreeHost::Create(&client_, | 134 host_(FakeLayerTreeHost::Create(&client_, |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 } | 217 } |
| 220 | 218 |
| 221 void EmptyCopyOutputCallback(std::unique_ptr<CopyOutputResult> result) {} | 219 void EmptyCopyOutputCallback(std::unique_ptr<CopyOutputResult> result) {} |
| 222 | 220 |
| 223 void LayerTestCommon::LayerImplTest::RequestCopyOfOutput() { | 221 void LayerTestCommon::LayerImplTest::RequestCopyOfOutput() { |
| 224 root_layer_for_testing()->test_properties()->copy_requests.push_back( | 222 root_layer_for_testing()->test_properties()->copy_requests.push_back( |
| 225 CopyOutputRequest::CreateRequest(base::Bind(&EmptyCopyOutputCallback))); | 223 CopyOutputRequest::CreateRequest(base::Bind(&EmptyCopyOutputCallback))); |
| 226 } | 224 } |
| 227 | 225 |
| 228 } // namespace cc | 226 } // namespace cc |
| OLD | NEW |