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 24 matching lines...) Expand all Loading... |
35 return invalid; | 35 return invalid; |
36 } | 36 } |
37 | 37 |
38 gfx::Size SurfaceSize() { | 38 gfx::Size SurfaceSize() { |
39 static gfx::Size size(5, 5); | 39 static gfx::Size size(5, 5); |
40 return size; | 40 return size; |
41 } | 41 } |
42 | 42 |
43 class EmptySurfaceFactoryClient : public SurfaceFactoryClient { | 43 class EmptySurfaceFactoryClient : public SurfaceFactoryClient { |
44 public: | 44 public: |
45 virtual void ReturnResources( | 45 void ReturnResources(const ReturnedResourceArray& resources) override {} |
46 const ReturnedResourceArray& resources) override {} | |
47 }; | 46 }; |
48 | 47 |
49 class SurfaceAggregatorTest : public testing::Test { | 48 class SurfaceAggregatorTest : public testing::Test { |
50 public: | 49 public: |
51 SurfaceAggregatorTest() | 50 SurfaceAggregatorTest() |
52 : factory_(&manager_, &empty_client_), aggregator_(&manager_, NULL) {} | 51 : factory_(&manager_, &empty_client_), aggregator_(&manager_, NULL) {} |
53 | 52 |
54 protected: | 53 protected: |
55 SurfaceManager manager_; | 54 SurfaceManager manager_; |
56 EmptySurfaceFactoryClient empty_client_; | 55 EmptySurfaceFactoryClient empty_client_; |
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1140 FakeOutputSurfaceClient output_surface_client_; | 1139 FakeOutputSurfaceClient output_surface_client_; |
1141 scoped_ptr<OutputSurface> output_surface_; | 1140 scoped_ptr<OutputSurface> output_surface_; |
1142 scoped_ptr<SharedBitmapManager> shared_bitmap_manager_; | 1141 scoped_ptr<SharedBitmapManager> shared_bitmap_manager_; |
1143 scoped_ptr<ResourceProvider> resource_provider_; | 1142 scoped_ptr<ResourceProvider> resource_provider_; |
1144 scoped_ptr<SurfaceAggregator> aggregator_; | 1143 scoped_ptr<SurfaceAggregator> aggregator_; |
1145 }; | 1144 }; |
1146 | 1145 |
1147 class ResourceTrackingSurfaceFactoryClient : public SurfaceFactoryClient { | 1146 class ResourceTrackingSurfaceFactoryClient : public SurfaceFactoryClient { |
1148 public: | 1147 public: |
1149 ResourceTrackingSurfaceFactoryClient() {} | 1148 ResourceTrackingSurfaceFactoryClient() {} |
1150 virtual ~ResourceTrackingSurfaceFactoryClient() {} | 1149 ~ResourceTrackingSurfaceFactoryClient() override {} |
1151 | 1150 |
1152 virtual void ReturnResources( | 1151 void ReturnResources(const ReturnedResourceArray& resources) override { |
1153 const ReturnedResourceArray& resources) override { | |
1154 returned_resources_ = resources; | 1152 returned_resources_ = resources; |
1155 } | 1153 } |
1156 | 1154 |
1157 ReturnedResourceArray returned_resources() const { | 1155 ReturnedResourceArray returned_resources() const { |
1158 return returned_resources_; | 1156 return returned_resources_; |
1159 } | 1157 } |
1160 | 1158 |
1161 private: | 1159 private: |
1162 ReturnedResourceArray returned_resources_; | 1160 ReturnedResourceArray returned_resources_; |
1163 | 1161 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1233 returned_ids[i] = client.returned_resources()[i].id; | 1231 returned_ids[i] = client.returned_resources()[i].id; |
1234 } | 1232 } |
1235 EXPECT_THAT(returned_ids, | 1233 EXPECT_THAT(returned_ids, |
1236 testing::WhenSorted(testing::ElementsAreArray(ids))); | 1234 testing::WhenSorted(testing::ElementsAreArray(ids))); |
1237 factory.Destroy(surface_id); | 1235 factory.Destroy(surface_id); |
1238 } | 1236 } |
1239 | 1237 |
1240 } // namespace | 1238 } // namespace |
1241 } // namespace cc | 1239 } // namespace cc |
1242 | 1240 |
OLD | NEW |