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

Side by Side Diff: cc/ipc/cc_serialization_perftest.cc

Issue 2190943002: cc serialization perf: Add a couple more tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <utility> 5 #include <utility>
6 6
7 #include "base/test/launcher/unit_test_launcher.h" 7 #include "base/test/launcher/unit_test_launcher.h"
8 #include "base/test/test_suite.h" 8 #include "base/test/test_suite.h"
9 #include "cc/ipc/cc_param_traits.h" 9 #include "cc/ipc/cc_param_traits.h"
10 #include "cc/ipc/compositor_frame.mojom.h" 10 #include "cc/ipc/compositor_frame.mojom.h"
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 SK_ColorRED, kForceAntiAliasingOff); 272 SK_ColorRED, kForceAntiAliasingOff);
273 } 273 }
274 274
275 frame.delegated_frame_data.reset(new DelegatedFrameData); 275 frame.delegated_frame_data.reset(new DelegatedFrameData);
276 frame.delegated_frame_data->render_pass_list.push_back( 276 frame.delegated_frame_data->render_pass_list.push_back(
277 std::move(render_pass)); 277 std::move(render_pass));
278 278
279 RunTest("DelegatedFrame_ManyQuads_100000_100000", std::move(frame)); 279 RunTest("DelegatedFrame_ManyQuads_100000_100000", std::move(frame));
280 } 280 }
281 281
282 TEST_F(CCSerializationPerfTest, DelegatedFrame_ManyRenderPasses_5_100) {
283 CompositorFrame frame;
284 frame.delegated_frame_data.reset(new DelegatedFrameData);
285
286 for (int i = 0; i < 5; ++i) {
287 std::unique_ptr<RenderPass> render_pass = RenderPass::Create();
288 render_pass->SetNew(RenderPassId(1, 1), gfx::Rect(), gfx::Rect(),
289 gfx::Transform());
290 for (int j = 0; j < 100; ++j) {
291 render_pass->CreateAndAppendSharedQuadState();
292 const gfx::Rect bounds(100, 100, 100, 100);
293 const bool kForceAntiAliasingOff = true;
294 SolidColorDrawQuad* quad =
295 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
296 quad->SetNew(render_pass->shared_quad_state_list.back(), bounds, bounds,
297 SK_ColorRED, kForceAntiAliasingOff);
298 }
299 frame.delegated_frame_data->render_pass_list.push_back(
300 std::move(render_pass));
301 }
302
303 RunTest("DelegatedFrame_ManyRenderPasses_10000_100", std::move(frame));
ajuma 2016/07/28 14:19:13 s/10000/5
Fady Samuel 2016/07/28 19:22:28 Done.
304 }
305
306 TEST_F(CCSerializationPerfTest, DelegatedFrame_ManyRenderPasses_10_500) {
307 CompositorFrame frame;
308 frame.delegated_frame_data.reset(new DelegatedFrameData);
309
310 for (int i = 0; i < 10; ++i) {
311 std::unique_ptr<RenderPass> render_pass = RenderPass::Create();
312 render_pass->SetNew(RenderPassId(1, 1), gfx::Rect(), gfx::Rect(),
313 gfx::Transform());
314 for (int j = 0; j < 500; ++j) {
315 render_pass->CreateAndAppendSharedQuadState();
316 const gfx::Rect bounds(100, 100, 100, 100);
317 const bool kForceAntiAliasingOff = true;
318 SolidColorDrawQuad* quad =
319 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
320 quad->SetNew(render_pass->shared_quad_state_list.back(), bounds, bounds,
321 SK_ColorRED, kForceAntiAliasingOff);
322 }
323 frame.delegated_frame_data->render_pass_list.push_back(
324 std::move(render_pass));
325 }
326
327 RunTest("DelegatedFrame_ManyRenderPasses_10000_100", std::move(frame));
ajuma 2016/07/28 14:19:13 s/10000_100/10_500
Fady Samuel 2016/07/28 19:22:28 Done.
328 }
329
282 TEST_F(CCSerializationPerfTest, DelegatedFrame_ManyRenderPasses_10000_100) { 330 TEST_F(CCSerializationPerfTest, DelegatedFrame_ManyRenderPasses_10000_100) {
ajuma 2016/07/28 14:19:13 Since this and the two new tests all have the same
Fady Samuel 2016/07/28 19:22:28 Done.
283 CompositorFrame frame; 331 CompositorFrame frame;
284 frame.delegated_frame_data.reset(new DelegatedFrameData); 332 frame.delegated_frame_data.reset(new DelegatedFrameData);
285 333
286 for (int i = 0; i < 1000; ++i) { 334 for (int i = 0; i < 1000; ++i) {
287 std::unique_ptr<RenderPass> render_pass = RenderPass::Create(); 335 std::unique_ptr<RenderPass> render_pass = RenderPass::Create();
288 render_pass->SetNew(RenderPassId(1, 1), gfx::Rect(), gfx::Rect(), 336 render_pass->SetNew(RenderPassId(1, 1), gfx::Rect(), gfx::Rect(),
289 gfx::Transform()); 337 gfx::Transform());
290 for (int j = 0; j < 100; ++j) { 338 for (int j = 0; j < 100; ++j) {
291 render_pass->CreateAndAppendSharedQuadState(); 339 render_pass->CreateAndAppendSharedQuadState();
292 const gfx::Rect bounds(100, 100, 100, 100); 340 const gfx::Rect bounds(100, 100, 100, 100);
293 const bool kForceAntiAliasingOff = true; 341 const bool kForceAntiAliasingOff = true;
294 SolidColorDrawQuad* quad = 342 SolidColorDrawQuad* quad =
295 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); 343 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
296 quad->SetNew(render_pass->shared_quad_state_list.back(), bounds, bounds, 344 quad->SetNew(render_pass->shared_quad_state_list.back(), bounds, bounds,
297 SK_ColorRED, kForceAntiAliasingOff); 345 SK_ColorRED, kForceAntiAliasingOff);
298 } 346 }
299 frame.delegated_frame_data->render_pass_list.push_back( 347 frame.delegated_frame_data->render_pass_list.push_back(
300 std::move(render_pass)); 348 std::move(render_pass));
301 } 349 }
302 350
303 RunTest("DelegatedFrame_ManyRenderPasses_10000_100", std::move(frame)); 351 RunTest("DelegatedFrame_ManyRenderPasses_10000_100", std::move(frame));
304 } 352 }
305 353
306 } // namespace 354 } // namespace
307 } // namespace cc 355 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698