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

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

Issue 2029813002: cc::SharedQuadState: drop CopyFrom and add copy constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use = default in cc Created 4 years, 6 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 | cc/quads/draw_quad_perftest.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 <stddef.h> 5 #include <stddef.h>
6 #include <string.h> 6 #include <string.h>
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 shared_state1_in->SetAll(arbitrary_matrix1, arbitrary_size1, arbitrary_rect1, 292 shared_state1_in->SetAll(arbitrary_matrix1, arbitrary_size1, arbitrary_rect1,
293 arbitrary_rect2, arbitrary_bool1, arbitrary_float1, 293 arbitrary_rect2, arbitrary_bool1, arbitrary_float1,
294 arbitrary_blend_mode1, arbitrary_context_id1); 294 arbitrary_blend_mode1, arbitrary_context_id1);
295 295
296 std::unique_ptr<RenderPass> pass_cmp = RenderPass::Create(); 296 std::unique_ptr<RenderPass> pass_cmp = RenderPass::Create();
297 pass_cmp->SetAll(root_id, arbitrary_rect1, arbitrary_rect2, arbitrary_matrix1, 297 pass_cmp->SetAll(root_id, arbitrary_rect1, arbitrary_rect2, arbitrary_matrix1,
298 arbitrary_bool1); 298 arbitrary_bool1);
299 299
300 SharedQuadState* shared_state1_cmp = 300 SharedQuadState* shared_state1_cmp =
301 pass_cmp->CreateAndAppendSharedQuadState(); 301 pass_cmp->CreateAndAppendSharedQuadState();
302 shared_state1_cmp->CopyFrom(shared_state1_in); 302 *shared_state1_cmp = *shared_state1_in;
303 303
304 DebugBorderDrawQuad* debugborder_in = 304 DebugBorderDrawQuad* debugborder_in =
305 pass_in->CreateAndAppendDrawQuad<DebugBorderDrawQuad>(); 305 pass_in->CreateAndAppendDrawQuad<DebugBorderDrawQuad>();
306 debugborder_in->SetAll(shared_state1_in, arbitrary_rect3, 306 debugborder_in->SetAll(shared_state1_in, arbitrary_rect3,
307 arbitrary_rect1_inside_rect3, 307 arbitrary_rect1_inside_rect3,
308 arbitrary_rect2_inside_rect3, arbitrary_bool1, 308 arbitrary_rect2_inside_rect3, arbitrary_bool1,
309 arbitrary_color, arbitrary_int); 309 arbitrary_color, arbitrary_int);
310 pass_cmp->CopyFromAndAppendDrawQuad(debugborder_in, 310 pass_cmp->CopyFromAndAppendDrawQuad(debugborder_in,
311 debugborder_in->shared_quad_state); 311 debugborder_in->shared_quad_state);
312 312
313 SharedQuadState* shared_state2_in = pass_in->CreateAndAppendSharedQuadState(); 313 SharedQuadState* shared_state2_in = pass_in->CreateAndAppendSharedQuadState();
314 shared_state2_in->SetAll(arbitrary_matrix2, arbitrary_size2, arbitrary_rect2, 314 shared_state2_in->SetAll(arbitrary_matrix2, arbitrary_size2, arbitrary_rect2,
315 arbitrary_rect3, arbitrary_bool1, arbitrary_float2, 315 arbitrary_rect3, arbitrary_bool1, arbitrary_float2,
316 arbitrary_blend_mode2, arbitrary_context_id2); 316 arbitrary_blend_mode2, arbitrary_context_id2);
317 SharedQuadState* shared_state2_cmp = 317 SharedQuadState* shared_state2_cmp =
318 pass_cmp->CreateAndAppendSharedQuadState(); 318 pass_cmp->CreateAndAppendSharedQuadState();
319 shared_state2_cmp->CopyFrom(shared_state2_in); 319 *shared_state2_cmp = *shared_state2_in;
320 320
321 RenderPassDrawQuad* renderpass_in = 321 RenderPassDrawQuad* renderpass_in =
322 pass_in->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); 322 pass_in->CreateAndAppendDrawQuad<RenderPassDrawQuad>();
323 renderpass_in->SetAll( 323 renderpass_in->SetAll(
324 shared_state2_in, arbitrary_rect1, arbitrary_rect2_inside_rect1, 324 shared_state2_in, arbitrary_rect1, arbitrary_rect2_inside_rect1,
325 arbitrary_rect1_inside_rect1, arbitrary_bool1, child_id, 325 arbitrary_rect1_inside_rect1, arbitrary_bool1, child_id,
326 arbitrary_resourceid2, arbitrary_vector2df1, arbitrary_size1, 326 arbitrary_resourceid2, arbitrary_vector2df1, arbitrary_size1,
327 arbitrary_filters1, arbitrary_vector2df2, arbitrary_filters2); 327 arbitrary_filters1, arbitrary_vector2df2, arbitrary_filters2);
328 pass_cmp->CopyFromAndAppendRenderPassDrawQuad( 328 pass_cmp->CopyFromAndAppendRenderPassDrawQuad(
329 renderpass_in, renderpass_in->shared_quad_state, 329 renderpass_in, renderpass_in->shared_quad_state,
330 renderpass_in->render_pass_id); 330 renderpass_in->render_pass_id);
331 331
332 SharedQuadState* shared_state3_in = pass_in->CreateAndAppendSharedQuadState(); 332 SharedQuadState* shared_state3_in = pass_in->CreateAndAppendSharedQuadState();
333 shared_state3_in->SetAll(arbitrary_matrix1, arbitrary_size3, arbitrary_rect3, 333 shared_state3_in->SetAll(arbitrary_matrix1, arbitrary_size3, arbitrary_rect3,
334 arbitrary_rect1, arbitrary_bool1, arbitrary_float3, 334 arbitrary_rect1, arbitrary_bool1, arbitrary_float3,
335 arbitrary_blend_mode3, arbitrary_context_id3); 335 arbitrary_blend_mode3, arbitrary_context_id3);
336 SharedQuadState* shared_state3_cmp = 336 SharedQuadState* shared_state3_cmp =
337 pass_cmp->CreateAndAppendSharedQuadState(); 337 pass_cmp->CreateAndAppendSharedQuadState();
338 shared_state3_cmp->CopyFrom(shared_state3_in); 338 *shared_state3_cmp = *shared_state3_in;
339 339
340 SolidColorDrawQuad* solidcolor_in = 340 SolidColorDrawQuad* solidcolor_in =
341 pass_in->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); 341 pass_in->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
342 solidcolor_in->SetAll(shared_state3_in, arbitrary_rect3, 342 solidcolor_in->SetAll(shared_state3_in, arbitrary_rect3,
343 arbitrary_rect1_inside_rect3, 343 arbitrary_rect1_inside_rect3,
344 arbitrary_rect2_inside_rect3, arbitrary_bool1, 344 arbitrary_rect2_inside_rect3, arbitrary_bool1,
345 arbitrary_color, arbitrary_bool2); 345 arbitrary_color, arbitrary_bool2);
346 pass_cmp->CopyFromAndAppendDrawQuad(solidcolor_in, 346 pass_cmp->CopyFromAndAppendDrawQuad(solidcolor_in,
347 solidcolor_in->shared_quad_state); 347 solidcolor_in->shared_quad_state);
348 348
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 EXPECT_TRUE( 600 EXPECT_TRUE(
601 IPC::ParamTraits<DelegatedFrameData>::Read(&msg, &iter, &frame_out)); 601 IPC::ParamTraits<DelegatedFrameData>::Read(&msg, &iter, &frame_out));
602 602
603 ASSERT_EQ(2u, frame_out.resource_list.size()); 603 ASSERT_EQ(2u, frame_out.resource_list.size());
604 Compare(arbitrary_resource1, frame_out.resource_list[0]); 604 Compare(arbitrary_resource1, frame_out.resource_list[0]);
605 Compare(arbitrary_resource2, frame_out.resource_list[1]); 605 Compare(arbitrary_resource2, frame_out.resource_list[1]);
606 } 606 }
607 607
608 } // namespace 608 } // namespace
609 } // namespace content 609 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | cc/quads/draw_quad_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698