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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 EXPECT_EQ(a.format, b.format); | 192 EXPECT_EQ(a.format, b.format); |
193 EXPECT_EQ(a.target, b.target); | 193 EXPECT_EQ(a.target, b.target); |
194 EXPECT_EQ(a.filter, b.filter); | 194 EXPECT_EQ(a.filter, b.filter); |
195 EXPECT_EQ(a.size.ToString(), b.size.ToString()); | 195 EXPECT_EQ(a.size.ToString(), b.size.ToString()); |
196 for (size_t i = 0; i < arraysize(a.mailbox.name); ++i) | 196 for (size_t i = 0; i < arraysize(a.mailbox.name); ++i) |
197 EXPECT_EQ(a.mailbox.name[i], b.mailbox.name[i]); | 197 EXPECT_EQ(a.mailbox.name[i], b.mailbox.name[i]); |
198 } | 198 } |
199 }; | 199 }; |
200 | 200 |
201 TEST_F(CCMessagesTest, AllQuads) { | 201 TEST_F(CCMessagesTest, AllQuads) { |
202 IPC::Message msg(1, 2); | 202 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); |
203 | 203 |
204 Transform arbitrary_matrix; | 204 Transform arbitrary_matrix; |
205 arbitrary_matrix.Scale(3, 3); | 205 arbitrary_matrix.Scale(3, 3); |
206 arbitrary_matrix.Translate(-5, 20); | 206 arbitrary_matrix.Translate(-5, 20); |
207 arbitrary_matrix.Rotate(15); | 207 arbitrary_matrix.Rotate(15); |
208 gfx::Rect arbitrary_rect1(-5, 9, 3, 15); | 208 gfx::Rect arbitrary_rect1(-5, 9, 3, 15); |
209 gfx::Rect arbitrary_rect1_inside_rect1(-4, 12, 2, 8); | 209 gfx::Rect arbitrary_rect1_inside_rect1(-4, 12, 2, 8); |
210 gfx::Rect arbitrary_rect2_inside_rect1(-5, 11, 1, 2); | 210 gfx::Rect arbitrary_rect2_inside_rect1(-5, 11, 1, 2); |
211 gfx::Rect arbitrary_rect2(40, 23, 11, 7); | 211 gfx::Rect arbitrary_rect2(40, 23, 11, 7); |
212 gfx::Rect arbitrary_rect1_inside_rect2(44, 23, 4, 2); | 212 gfx::Rect arbitrary_rect1_inside_rect2(44, 23, 4, 2); |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 pass_cmp->quad_list[i]->shared_quad_state == | 486 pass_cmp->quad_list[i]->shared_quad_state == |
487 pass_cmp->quad_list[i - 1]->shared_quad_state; | 487 pass_cmp->quad_list[i - 1]->shared_quad_state; |
488 bool same_shared_quad_state_out = | 488 bool same_shared_quad_state_out = |
489 pass_out->quad_list[i]->shared_quad_state == | 489 pass_out->quad_list[i]->shared_quad_state == |
490 pass_out->quad_list[i - 1]->shared_quad_state; | 490 pass_out->quad_list[i - 1]->shared_quad_state; |
491 EXPECT_EQ(same_shared_quad_state_cmp, same_shared_quad_state_out); | 491 EXPECT_EQ(same_shared_quad_state_cmp, same_shared_quad_state_out); |
492 } | 492 } |
493 } | 493 } |
494 | 494 |
495 TEST_F(CCMessagesTest, Resources) { | 495 TEST_F(CCMessagesTest, Resources) { |
496 IPC::Message msg(1, 2); | 496 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); |
497 gfx::Size arbitrary_size(757, 1281); | 497 gfx::Size arbitrary_size(757, 1281); |
498 unsigned int arbitrary_uint1 = 71234838; | 498 unsigned int arbitrary_uint1 = 71234838; |
499 unsigned int arbitrary_uint2 = 53589793; | 499 unsigned int arbitrary_uint2 = 53589793; |
500 | 500 |
501 GLbyte arbitrary_mailbox1[64] = { | 501 GLbyte arbitrary_mailbox1[64] = { |
502 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, | 502 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, |
503 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, | 503 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, |
504 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, | 504 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, |
505 1, 2, 3, 4 | 505 1, 2, 3, 4 |
506 }; | 506 }; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 } | 595 } |
596 | 596 |
597 // Verify the largest DrawQuad type is RenderPassDrawQuad. If this ever | 597 // Verify the largest DrawQuad type is RenderPassDrawQuad. If this ever |
598 // changes, then the ReserveSizeForRenderPassWrite() method needs to be | 598 // changes, then the ReserveSizeForRenderPassWrite() method needs to be |
599 // updated as well to use the new largest quad. | 599 // updated as well to use the new largest quad. |
600 EXPECT_EQ(sizeof(RenderPassDrawQuad), largest); | 600 EXPECT_EQ(sizeof(RenderPassDrawQuad), largest); |
601 } | 601 } |
602 | 602 |
603 } // namespace | 603 } // namespace |
604 } // namespace content | 604 } // namespace content |
OLD | NEW |