OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/output/compositor_frame.h" | 5 #include "cc/output/compositor_frame.h" |
6 #include "cc/output/delegated_frame_data.h" | 6 #include "cc/output/delegated_frame_data.h" |
7 #include "cc/quads/render_pass.h" | 7 #include "cc/quads/render_pass.h" |
8 #include "cc/quads/render_pass_draw_quad.h" | 8 #include "cc/quads/render_pass_draw_quad.h" |
9 #include "cc/quads/solid_color_draw_quad.h" | 9 #include "cc/quads/solid_color_draw_quad.h" |
10 #include "cc/quads/surface_draw_quad.h" | 10 #include "cc/quads/surface_draw_quad.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 factory_.Create(one_id); | 62 factory_.Create(one_id); |
63 scoped_ptr<CompositorFrame> frame = aggregator_.Aggregate(one_id); | 63 scoped_ptr<CompositorFrame> frame = aggregator_.Aggregate(one_id); |
64 EXPECT_FALSE(frame); | 64 EXPECT_FALSE(frame); |
65 factory_.Destroy(one_id); | 65 factory_.Destroy(one_id); |
66 } | 66 } |
67 | 67 |
68 class SurfaceAggregatorValidSurfaceTest : public SurfaceAggregatorTest { | 68 class SurfaceAggregatorValidSurfaceTest : public SurfaceAggregatorTest { |
69 public: | 69 public: |
70 SurfaceAggregatorValidSurfaceTest() : allocator_(1u), child_allocator_(2u) {} | 70 SurfaceAggregatorValidSurfaceTest() : allocator_(1u), child_allocator_(2u) {} |
71 | 71 |
72 virtual void SetUp() { | 72 void SetUp() override { |
73 SurfaceAggregatorTest::SetUp(); | 73 SurfaceAggregatorTest::SetUp(); |
74 root_surface_id_ = allocator_.GenerateId(); | 74 root_surface_id_ = allocator_.GenerateId(); |
75 factory_.Create(root_surface_id_); | 75 factory_.Create(root_surface_id_); |
76 } | 76 } |
77 | 77 |
78 virtual void TearDown() { | 78 void TearDown() override { |
79 factory_.Destroy(root_surface_id_); | 79 factory_.Destroy(root_surface_id_); |
80 SurfaceAggregatorTest::TearDown(); | 80 SurfaceAggregatorTest::TearDown(); |
81 } | 81 } |
82 | 82 |
83 void AggregateAndVerify(test::Pass* expected_passes, | 83 void AggregateAndVerify(test::Pass* expected_passes, |
84 size_t expected_pass_count, | 84 size_t expected_pass_count, |
85 SurfaceId* surface_ids, | 85 SurfaceId* surface_ids, |
86 size_t expected_surface_count) { | 86 size_t expected_surface_count) { |
87 scoped_ptr<CompositorFrame> aggregated_frame = | 87 scoped_ptr<CompositorFrame> aggregated_frame = |
88 aggregator_.Aggregate(root_surface_id_); | 88 aggregator_.Aggregate(root_surface_id_); |
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1213 // be treated as completely damaged. | 1213 // be treated as completely damaged. |
1214 EXPECT_TRUE(aggregated_pass_list[0]->damage_rect.Contains( | 1214 EXPECT_TRUE(aggregated_pass_list[0]->damage_rect.Contains( |
1215 gfx::Rect(SurfaceSize()))); | 1215 gfx::Rect(SurfaceSize()))); |
1216 } | 1216 } |
1217 | 1217 |
1218 factory_.Destroy(child_surface_id); | 1218 factory_.Destroy(child_surface_id); |
1219 } | 1219 } |
1220 | 1220 |
1221 class SurfaceAggregatorWithResourcesTest : public testing::Test { | 1221 class SurfaceAggregatorWithResourcesTest : public testing::Test { |
1222 public: | 1222 public: |
1223 virtual void SetUp() { | 1223 void SetUp() override { |
1224 output_surface_ = FakeOutputSurface::CreateSoftware( | 1224 output_surface_ = FakeOutputSurface::CreateSoftware( |
1225 make_scoped_ptr(new SoftwareOutputDevice)); | 1225 make_scoped_ptr(new SoftwareOutputDevice)); |
1226 output_surface_->BindToClient(&output_surface_client_); | 1226 output_surface_->BindToClient(&output_surface_client_); |
1227 shared_bitmap_manager_.reset(new TestSharedBitmapManager); | 1227 shared_bitmap_manager_.reset(new TestSharedBitmapManager); |
1228 | 1228 |
1229 resource_provider_ = ResourceProvider::Create(output_surface_.get(), | 1229 resource_provider_ = ResourceProvider::Create(output_surface_.get(), |
1230 shared_bitmap_manager_.get(), | 1230 shared_bitmap_manager_.get(), |
1231 NULL, | 1231 NULL, |
1232 NULL, | 1232 NULL, |
1233 0, | 1233 0, |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1406 EXPECT_THAT(returned_ids, | 1406 EXPECT_THAT(returned_ids, |
1407 testing::WhenSorted(testing::ElementsAreArray(ids))); | 1407 testing::WhenSorted(testing::ElementsAreArray(ids))); |
1408 EXPECT_EQ(3u, resource_provider_->num_resources()); | 1408 EXPECT_EQ(3u, resource_provider_->num_resources()); |
1409 factory.Destroy(surface_id); | 1409 factory.Destroy(surface_id); |
1410 factory.Destroy(surface_id2); | 1410 factory.Destroy(surface_id2); |
1411 } | 1411 } |
1412 | 1412 |
1413 } // namespace | 1413 } // namespace |
1414 } // namespace cc | 1414 } // namespace cc |
1415 | 1415 |
OLD | NEW |