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

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

Issue 2382873002: Replace usage of SurfaceId's client_id with FrameSinkId (Closed)
Patch Set: Rebased Created 4 years, 2 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 | « cc/ipc/cc_param_traits_macros.h ('k') | cc/ipc/frame_sink_id.mojom » ('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 27 matching lines...) Expand all
38 using cc::TextureDrawQuad; 38 using cc::TextureDrawQuad;
39 using cc::TileDrawQuad; 39 using cc::TileDrawQuad;
40 using cc::TransferableResource; 40 using cc::TransferableResource;
41 using cc::StreamVideoDrawQuad; 41 using cc::StreamVideoDrawQuad;
42 using cc::YUVVideoDrawQuad; 42 using cc::YUVVideoDrawQuad;
43 using gfx::Transform; 43 using gfx::Transform;
44 44
45 namespace content { 45 namespace content {
46 namespace { 46 namespace {
47 47
48 static constexpr cc::FrameSinkId kArbitraryFrameSinkId(1, 1);
49
48 class CCParamTraitsTest : public testing::Test { 50 class CCParamTraitsTest : public testing::Test {
49 protected: 51 protected:
50 void Compare(const RenderPass* a, const RenderPass* b) { 52 void Compare(const RenderPass* a, const RenderPass* b) {
51 EXPECT_EQ(a->id, b->id); 53 EXPECT_EQ(a->id, b->id);
52 EXPECT_EQ(a->output_rect.ToString(), b->output_rect.ToString()); 54 EXPECT_EQ(a->output_rect.ToString(), b->output_rect.ToString());
53 EXPECT_EQ(a->damage_rect.ToString(), b->damage_rect.ToString()); 55 EXPECT_EQ(a->damage_rect.ToString(), b->damage_rect.ToString());
54 EXPECT_EQ(a->transform_to_root_target, b->transform_to_root_target); 56 EXPECT_EQ(a->transform_to_root_target, b->transform_to_root_target);
55 EXPECT_EQ(a->has_transparent_background, b->has_transparent_background); 57 EXPECT_EQ(a->has_transparent_background, b->has_transparent_background);
56 } 58 }
57 59
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 354
353 StreamVideoDrawQuad* streamvideo_in = 355 StreamVideoDrawQuad* streamvideo_in =
354 pass_in->CreateAndAppendDrawQuad<StreamVideoDrawQuad>(); 356 pass_in->CreateAndAppendDrawQuad<StreamVideoDrawQuad>();
355 streamvideo_in->SetAll( 357 streamvideo_in->SetAll(
356 shared_state3_in, arbitrary_rect2, arbitrary_rect2_inside_rect2, 358 shared_state3_in, arbitrary_rect2, arbitrary_rect2_inside_rect2,
357 arbitrary_rect1_inside_rect2, arbitrary_bool1, arbitrary_resourceid2, 359 arbitrary_rect1_inside_rect2, arbitrary_bool1, arbitrary_resourceid2,
358 arbitrary_size1, arbitrary_matrix1); 360 arbitrary_size1, arbitrary_matrix1);
359 pass_cmp->CopyFromAndAppendDrawQuad(streamvideo_in, 361 pass_cmp->CopyFromAndAppendDrawQuad(streamvideo_in,
360 streamvideo_in->shared_quad_state); 362 streamvideo_in->shared_quad_state);
361 363
362 cc::SurfaceId arbitrary_surface_id(0, 3, 0); 364 cc::SurfaceId arbitrary_surface_id(kArbitraryFrameSinkId, 3, 0);
363 SurfaceDrawQuad* surface_in = 365 SurfaceDrawQuad* surface_in =
364 pass_in->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); 366 pass_in->CreateAndAppendDrawQuad<SurfaceDrawQuad>();
365 surface_in->SetAll(shared_state3_in, arbitrary_rect2, 367 surface_in->SetAll(shared_state3_in, arbitrary_rect2,
366 arbitrary_rect2_inside_rect2, arbitrary_rect1_inside_rect2, 368 arbitrary_rect2_inside_rect2, arbitrary_rect1_inside_rect2,
367 arbitrary_bool1, arbitrary_surface_id); 369 arbitrary_bool1, arbitrary_surface_id);
368 pass_cmp->CopyFromAndAppendDrawQuad(surface_in, 370 pass_cmp->CopyFromAndAppendDrawQuad(surface_in,
369 surface_in->shared_quad_state); 371 surface_in->shared_quad_state);
370 372
371 TextureDrawQuad* texture_in = 373 TextureDrawQuad* texture_in =
372 pass_in->CreateAndAppendDrawQuad<TextureDrawQuad>(); 374 pass_in->CreateAndAppendDrawQuad<TextureDrawQuad>();
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 EXPECT_TRUE( 607 EXPECT_TRUE(
606 IPC::ParamTraits<DelegatedFrameData>::Read(&msg, &iter, &frame_out)); 608 IPC::ParamTraits<DelegatedFrameData>::Read(&msg, &iter, &frame_out));
607 609
608 ASSERT_EQ(2u, frame_out.resource_list.size()); 610 ASSERT_EQ(2u, frame_out.resource_list.size());
609 Compare(arbitrary_resource1, frame_out.resource_list[0]); 611 Compare(arbitrary_resource1, frame_out.resource_list[0]);
610 Compare(arbitrary_resource2, frame_out.resource_list[1]); 612 Compare(arbitrary_resource2, frame_out.resource_list[1]);
611 } 613 }
612 614
613 } // namespace 615 } // namespace
614 } // namespace content 616 } // namespace content
OLDNEW
« no previous file with comments | « cc/ipc/cc_param_traits_macros.h ('k') | cc/ipc/frame_sink_id.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698