Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(384)

Side by Side Diff: cc/surfaces/surface_aggregator_unittest.cc

Issue 732423002: Update from chromium https://crrev.com/304586 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/surfaces/surface_aggregator.cc ('k') | cc/test/fake_layer_tree_host_impl_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 ASSERT_EQ(3u, client.returned_resources().size()); 1235 ASSERT_EQ(3u, client.returned_resources().size());
1236 ResourceProvider::ResourceId returned_ids[3]; 1236 ResourceProvider::ResourceId returned_ids[3];
1237 for (size_t i = 0; i < 3; ++i) { 1237 for (size_t i = 0; i < 3; ++i) {
1238 returned_ids[i] = client.returned_resources()[i].id; 1238 returned_ids[i] = client.returned_resources()[i].id;
1239 } 1239 }
1240 EXPECT_THAT(returned_ids, 1240 EXPECT_THAT(returned_ids,
1241 testing::WhenSorted(testing::ElementsAreArray(ids))); 1241 testing::WhenSorted(testing::ElementsAreArray(ids)));
1242 factory.Destroy(surface_id); 1242 factory.Destroy(surface_id);
1243 } 1243 }
1244 1244
1245 TEST_F(SurfaceAggregatorWithResourcesTest, TwoSurfaces) {
1246 ResourceTrackingSurfaceFactoryClient client;
1247 SurfaceFactory factory(&manager_, &client);
1248 SurfaceId surface_id(7u);
1249 factory.Create(surface_id, SurfaceSize());
1250 SurfaceId surface_id2(8u);
1251 factory.Create(surface_id2, SurfaceSize());
1252
1253 ResourceProvider::ResourceId ids[] = {11, 12, 13};
1254 SubmitFrameWithResources(ids, arraysize(ids), &factory, surface_id);
1255 ResourceProvider::ResourceId ids2[] = {14, 15, 16};
1256 SubmitFrameWithResources(ids2, arraysize(ids2), &factory, surface_id2);
1257
1258 scoped_ptr<CompositorFrame> frame = aggregator_->Aggregate(surface_id);
1259
1260 SubmitFrameWithResources(NULL, 0, &factory, surface_id);
1261
1262 // Nothing should be available to be returned yet.
1263 EXPECT_TRUE(client.returned_resources().empty());
1264
1265 frame = aggregator_->Aggregate(surface_id2);
1266
1267 // surface_id wasn't referenced, so its resources should be returned.
1268 ASSERT_EQ(3u, client.returned_resources().size());
1269 ResourceProvider::ResourceId returned_ids[3];
1270 for (size_t i = 0; i < 3; ++i) {
1271 returned_ids[i] = client.returned_resources()[i].id;
1272 }
1273 EXPECT_THAT(returned_ids,
1274 testing::WhenSorted(testing::ElementsAreArray(ids)));
1275 EXPECT_EQ(3u, resource_provider_->num_resources());
1276 factory.Destroy(surface_id);
1277 factory.Destroy(surface_id2);
1278 }
1279
1245 } // namespace 1280 } // namespace
1246 } // namespace cc 1281 } // namespace cc
1247 1282
OLDNEW
« no previous file with comments | « cc/surfaces/surface_aggregator.cc ('k') | cc/test/fake_layer_tree_host_impl_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698