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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 protected: | 50 protected: |
51 void Compare(const RenderPass* a, const RenderPass* b) { | 51 void Compare(const RenderPass* a, const RenderPass* b) { |
52 EXPECT_EQ(a->id, b->id); | 52 EXPECT_EQ(a->id, b->id); |
53 EXPECT_EQ(a->output_rect.ToString(), b->output_rect.ToString()); | 53 EXPECT_EQ(a->output_rect.ToString(), b->output_rect.ToString()); |
54 EXPECT_EQ(a->damage_rect.ToString(), b->damage_rect.ToString()); | 54 EXPECT_EQ(a->damage_rect.ToString(), b->damage_rect.ToString()); |
55 EXPECT_EQ(a->transform_to_root_target, b->transform_to_root_target); | 55 EXPECT_EQ(a->transform_to_root_target, b->transform_to_root_target); |
56 EXPECT_EQ(a->has_transparent_background, b->has_transparent_background); | 56 EXPECT_EQ(a->has_transparent_background, b->has_transparent_background); |
57 } | 57 } |
58 | 58 |
59 void Compare(const SharedQuadState* a, const SharedQuadState* b) { | 59 void Compare(const SharedQuadState* a, const SharedQuadState* b) { |
60 EXPECT_EQ(a->content_to_target_transform, b->content_to_target_transform); | 60 EXPECT_EQ(a->quad_to_target_transform, b->quad_to_target_transform); |
61 EXPECT_EQ(a->content_bounds, b->content_bounds); | 61 EXPECT_EQ(a->quad_layer_bounds, b->quad_layer_bounds); |
62 EXPECT_EQ(a->visible_content_rect, b->visible_content_rect); | 62 EXPECT_EQ(a->visible_quad_layer_rect, b->visible_quad_layer_rect); |
63 EXPECT_EQ(a->clip_rect, b->clip_rect); | 63 EXPECT_EQ(a->clip_rect, b->clip_rect); |
64 EXPECT_EQ(a->is_clipped, b->is_clipped); | 64 EXPECT_EQ(a->is_clipped, b->is_clipped); |
65 EXPECT_EQ(a->opacity, b->opacity); | 65 EXPECT_EQ(a->opacity, b->opacity); |
66 EXPECT_EQ(a->blend_mode, b->blend_mode); | 66 EXPECT_EQ(a->blend_mode, b->blend_mode); |
67 EXPECT_EQ(a->sorting_context_id, b->sorting_context_id); | 67 EXPECT_EQ(a->sorting_context_id, b->sorting_context_id); |
68 } | 68 } |
69 | 69 |
70 void Compare(const DrawQuad* a, const DrawQuad* b) { | 70 void Compare(const DrawQuad* a, const DrawQuad* b) { |
71 ASSERT_NE(DrawQuad::INVALID, a->material); | 71 ASSERT_NE(DrawQuad::INVALID, a->material); |
72 ASSERT_EQ(a->material, b->material); | 72 ASSERT_EQ(a->material, b->material); |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 IPC::ParamTraits<DelegatedFrameData>::Read(&msg, &iter, &frame_out)); | 620 IPC::ParamTraits<DelegatedFrameData>::Read(&msg, &iter, &frame_out)); |
621 | 621 |
622 scoped_ptr<RenderPass> pass_out = | 622 scoped_ptr<RenderPass> pass_out = |
623 frame_out.render_pass_list.take(frame_out.render_pass_list.begin()); | 623 frame_out.render_pass_list.take(frame_out.render_pass_list.begin()); |
624 | 624 |
625 // 2 SharedQuadStates come out. The first and fourth SharedQuadStates were | 625 // 2 SharedQuadStates come out. The first and fourth SharedQuadStates were |
626 // used by quads, and so serialized. Others were not. | 626 // used by quads, and so serialized. Others were not. |
627 ASSERT_EQ(2u, pass_out->shared_quad_state_list.size()); | 627 ASSERT_EQ(2u, pass_out->shared_quad_state_list.size()); |
628 ASSERT_EQ(2u, pass_out->quad_list.size()); | 628 ASSERT_EQ(2u, pass_out->quad_list.size()); |
629 | 629 |
630 EXPECT_EQ( | 630 EXPECT_EQ(gfx::Size(1, 1).ToString(), |
631 gfx::Size(1, 1).ToString(), | 631 pass_out->shared_quad_state_list.ElementAt(0) |
632 pass_out->shared_quad_state_list.ElementAt(0)->content_bounds.ToString()); | 632 ->quad_layer_bounds.ToString()); |
633 EXPECT_EQ( | 633 EXPECT_EQ(gfx::Size(4, 4).ToString(), |
634 gfx::Size(4, 4).ToString(), | 634 pass_out->shared_quad_state_list.ElementAt(1) |
635 pass_out->shared_quad_state_list.ElementAt(1)->content_bounds.ToString()); | 635 ->quad_layer_bounds.ToString()); |
636 } | 636 } |
637 | 637 |
638 TEST_F(CCMessagesTest, Resources) { | 638 TEST_F(CCMessagesTest, Resources) { |
639 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); | 639 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); |
640 gfx::Size arbitrary_size(757, 1281); | 640 gfx::Size arbitrary_size(757, 1281); |
641 unsigned int arbitrary_uint1 = 71234838; | 641 unsigned int arbitrary_uint1 = 71234838; |
642 unsigned int arbitrary_uint2 = 53589793; | 642 unsigned int arbitrary_uint2 = 53589793; |
643 | 643 |
644 GLbyte arbitrary_mailbox1[GL_MAILBOX_SIZE_CHROMIUM] = { | 644 GLbyte arbitrary_mailbox1[GL_MAILBOX_SIZE_CHROMIUM] = { |
645 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, | 645 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 SoftwareFrameData frame_out; | 752 SoftwareFrameData frame_out; |
753 base::PickleIterator iter(msg); | 753 base::PickleIterator iter(msg); |
754 EXPECT_EQ( | 754 EXPECT_EQ( |
755 expect_read, | 755 expect_read, |
756 IPC::ParamTraits<SoftwareFrameData>::Read(&msg, &iter, &frame_out)); | 756 IPC::ParamTraits<SoftwareFrameData>::Read(&msg, &iter, &frame_out)); |
757 } | 757 } |
758 } | 758 } |
759 | 759 |
760 } // namespace | 760 } // namespace |
761 } // namespace content | 761 } // namespace content |
OLD | NEW |