OLD | NEW |
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 "content/common/cc_messages.h" | 5 #include "content/common/cc_messages.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 namespace { | 45 namespace { |
46 | 46 |
47 class CCMessagesTest : public testing::Test { | 47 class CCMessagesTest : public testing::Test { |
48 protected: | 48 protected: |
49 void Compare(const RenderPass* a, const RenderPass* b) { | 49 void Compare(const RenderPass* a, const RenderPass* b) { |
50 EXPECT_EQ(a->id, b->id); | 50 EXPECT_EQ(a->id, b->id); |
51 EXPECT_EQ(a->output_rect.ToString(), b->output_rect.ToString()); | 51 EXPECT_EQ(a->output_rect.ToString(), b->output_rect.ToString()); |
52 EXPECT_EQ(a->damage_rect.ToString(), b->damage_rect.ToString()); | 52 EXPECT_EQ(a->damage_rect.ToString(), b->damage_rect.ToString()); |
53 EXPECT_EQ(a->transform_to_root_target, b->transform_to_root_target); | 53 EXPECT_EQ(a->transform_to_root_target, b->transform_to_root_target); |
54 EXPECT_EQ(a->has_transparent_background, b->has_transparent_background); | 54 EXPECT_EQ(a->has_transparent_background, b->has_transparent_background); |
55 EXPECT_EQ(a->referenced_surfaces, b->referenced_surfaces); | |
56 } | 55 } |
57 | 56 |
58 void Compare(const SharedQuadState* a, const SharedQuadState* b) { | 57 void Compare(const SharedQuadState* a, const SharedQuadState* b) { |
59 EXPECT_EQ(a->quad_to_target_transform, b->quad_to_target_transform); | 58 EXPECT_EQ(a->quad_to_target_transform, b->quad_to_target_transform); |
60 EXPECT_EQ(a->quad_layer_bounds, b->quad_layer_bounds); | 59 EXPECT_EQ(a->quad_layer_bounds, b->quad_layer_bounds); |
61 EXPECT_EQ(a->visible_quad_layer_rect, b->visible_quad_layer_rect); | 60 EXPECT_EQ(a->visible_quad_layer_rect, b->visible_quad_layer_rect); |
62 EXPECT_EQ(a->clip_rect, b->clip_rect); | 61 EXPECT_EQ(a->clip_rect, b->clip_rect); |
63 EXPECT_EQ(a->is_clipped, b->is_clipped); | 62 EXPECT_EQ(a->is_clipped, b->is_clipped); |
64 EXPECT_EQ(a->opacity, b->opacity); | 63 EXPECT_EQ(a->opacity, b->opacity); |
65 EXPECT_EQ(a->blend_mode, b->blend_mode); | 64 EXPECT_EQ(a->blend_mode, b->blend_mode); |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 SurfaceDrawQuad* surface_in = | 391 SurfaceDrawQuad* surface_in = |
393 pass_in->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); | 392 pass_in->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); |
394 surface_in->SetAll(shared_state3_in, | 393 surface_in->SetAll(shared_state3_in, |
395 arbitrary_rect2, | 394 arbitrary_rect2, |
396 arbitrary_rect2_inside_rect2, | 395 arbitrary_rect2_inside_rect2, |
397 arbitrary_rect1_inside_rect2, | 396 arbitrary_rect1_inside_rect2, |
398 arbitrary_bool1, | 397 arbitrary_bool1, |
399 arbitrary_surface_id); | 398 arbitrary_surface_id); |
400 pass_cmp->CopyFromAndAppendDrawQuad(surface_in, | 399 pass_cmp->CopyFromAndAppendDrawQuad(surface_in, |
401 surface_in->shared_quad_state); | 400 surface_in->shared_quad_state); |
402 pass_in->referenced_surfaces.push_back(arbitrary_surface_id); | |
403 pass_cmp->referenced_surfaces.push_back(arbitrary_surface_id); | |
404 | 401 |
405 TextureDrawQuad* texture_in = | 402 TextureDrawQuad* texture_in = |
406 pass_in->CreateAndAppendDrawQuad<TextureDrawQuad>(); | 403 pass_in->CreateAndAppendDrawQuad<TextureDrawQuad>(); |
407 texture_in->SetAll(shared_state3_in, arbitrary_rect2, | 404 texture_in->SetAll(shared_state3_in, arbitrary_rect2, |
408 arbitrary_rect2_inside_rect2, arbitrary_rect1_inside_rect2, | 405 arbitrary_rect2_inside_rect2, arbitrary_rect1_inside_rect2, |
409 arbitrary_bool1, arbitrary_resourceid1, arbitrary_size1, | 406 arbitrary_bool1, arbitrary_resourceid1, arbitrary_size1, |
410 arbitrary_bool2, arbitrary_pointf1, | 407 arbitrary_bool2, arbitrary_pointf1, |
411 arbitrary_pointf2, arbitrary_color, arbitrary_float_array, | 408 arbitrary_pointf2, arbitrary_color, arbitrary_float_array, |
412 arbitrary_bool4, arbitrary_bool5); | 409 arbitrary_bool4, arbitrary_bool5); |
413 pass_cmp->CopyFromAndAppendDrawQuad(texture_in, | 410 pass_cmp->CopyFromAndAppendDrawQuad(texture_in, |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 EXPECT_TRUE(IPC::ParamTraits<DelegatedFrameData>::Read(&msg, | 662 EXPECT_TRUE(IPC::ParamTraits<DelegatedFrameData>::Read(&msg, |
666 &iter, &frame_out)); | 663 &iter, &frame_out)); |
667 | 664 |
668 ASSERT_EQ(2u, frame_out.resource_list.size()); | 665 ASSERT_EQ(2u, frame_out.resource_list.size()); |
669 Compare(arbitrary_resource1, frame_out.resource_list[0]); | 666 Compare(arbitrary_resource1, frame_out.resource_list[0]); |
670 Compare(arbitrary_resource2, frame_out.resource_list[1]); | 667 Compare(arbitrary_resource2, frame_out.resource_list[1]); |
671 } | 668 } |
672 | 669 |
673 } // namespace | 670 } // namespace |
674 } // namespace content | 671 } // namespace content |
OLD | NEW |