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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 Compare(YUVVideoDrawQuad::MaterialCast(a), | 122 Compare(YUVVideoDrawQuad::MaterialCast(a), |
123 YUVVideoDrawQuad::MaterialCast(b)); | 123 YUVVideoDrawQuad::MaterialCast(b)); |
124 break; | 124 break; |
125 case DrawQuad::INVALID: | 125 case DrawQuad::INVALID: |
126 break; | 126 break; |
127 } | 127 } |
128 } | 128 } |
129 | 129 |
130 void Compare(const CheckerboardDrawQuad* a, const CheckerboardDrawQuad* b) { | 130 void Compare(const CheckerboardDrawQuad* a, const CheckerboardDrawQuad* b) { |
131 EXPECT_EQ(a->color, b->color); | 131 EXPECT_EQ(a->color, b->color); |
| 132 EXPECT_EQ(a->scale, b->scale); |
132 } | 133 } |
133 | 134 |
134 void Compare(const DebugBorderDrawQuad* a, const DebugBorderDrawQuad* b) { | 135 void Compare(const DebugBorderDrawQuad* a, const DebugBorderDrawQuad* b) { |
135 EXPECT_EQ(a->color, b->color); | 136 EXPECT_EQ(a->color, b->color); |
136 EXPECT_EQ(a->width, b->width); | 137 EXPECT_EQ(a->width, b->width); |
137 } | 138 } |
138 | 139 |
139 void Compare(const IOSurfaceDrawQuad* a, const IOSurfaceDrawQuad* b) { | 140 void Compare(const IOSurfaceDrawQuad* a, const IOSurfaceDrawQuad* b) { |
140 EXPECT_EQ(a->io_surface_size.ToString(), b->io_surface_size.ToString()); | 141 EXPECT_EQ(a->io_surface_size.ToString(), b->io_surface_size.ToString()); |
141 EXPECT_EQ(a->io_surface_resource_id, b->io_surface_resource_id); | 142 EXPECT_EQ(a->io_surface_resource_id, b->io_surface_resource_id); |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 arbitrary_rect2, | 310 arbitrary_rect2, |
310 arbitrary_matrix, | 311 arbitrary_matrix, |
311 arbitrary_bool1); | 312 arbitrary_bool1); |
312 | 313 |
313 SharedQuadState* shared_state1_cmp = | 314 SharedQuadState* shared_state1_cmp = |
314 pass_cmp->CreateAndAppendSharedQuadState(); | 315 pass_cmp->CreateAndAppendSharedQuadState(); |
315 shared_state1_cmp->CopyFrom(shared_state1_in); | 316 shared_state1_cmp->CopyFrom(shared_state1_in); |
316 | 317 |
317 CheckerboardDrawQuad* checkerboard_in = | 318 CheckerboardDrawQuad* checkerboard_in = |
318 pass_in->CreateAndAppendDrawQuad<CheckerboardDrawQuad>(); | 319 pass_in->CreateAndAppendDrawQuad<CheckerboardDrawQuad>(); |
319 checkerboard_in->SetAll(shared_state1_in, | 320 checkerboard_in->SetAll(shared_state1_in, arbitrary_rect1, |
320 arbitrary_rect1, | |
321 arbitrary_rect2_inside_rect1, | 321 arbitrary_rect2_inside_rect1, |
322 arbitrary_rect1_inside_rect1, | 322 arbitrary_rect1_inside_rect1, arbitrary_bool1, |
323 arbitrary_bool1, | 323 arbitrary_color, arbitrary_float1); |
324 arbitrary_color); | |
325 pass_cmp->CopyFromAndAppendDrawQuad(checkerboard_in, | 324 pass_cmp->CopyFromAndAppendDrawQuad(checkerboard_in, |
326 checkerboard_in->shared_quad_state); | 325 checkerboard_in->shared_quad_state); |
327 | 326 |
328 DebugBorderDrawQuad* debugborder_in = | 327 DebugBorderDrawQuad* debugborder_in = |
329 pass_in->CreateAndAppendDrawQuad<DebugBorderDrawQuad>(); | 328 pass_in->CreateAndAppendDrawQuad<DebugBorderDrawQuad>(); |
330 debugborder_in->SetAll(shared_state1_in, | 329 debugborder_in->SetAll(shared_state1_in, |
331 arbitrary_rect3, | 330 arbitrary_rect3, |
332 arbitrary_rect1_inside_rect3, | 331 arbitrary_rect1_inside_rect3, |
333 arbitrary_rect2_inside_rect3, | 332 arbitrary_rect2_inside_rect3, |
334 arbitrary_bool1, | 333 arbitrary_bool1, |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 gfx::Size(1, 1), | 559 gfx::Size(1, 1), |
561 gfx::Rect(), | 560 gfx::Rect(), |
562 gfx::Rect(), | 561 gfx::Rect(), |
563 false, | 562 false, |
564 1.f, | 563 1.f, |
565 SkXfermode::kSrcOver_Mode, | 564 SkXfermode::kSrcOver_Mode, |
566 0); | 565 0); |
567 | 566 |
568 CheckerboardDrawQuad* quad1 = | 567 CheckerboardDrawQuad* quad1 = |
569 pass_in->CreateAndAppendDrawQuad<CheckerboardDrawQuad>(); | 568 pass_in->CreateAndAppendDrawQuad<CheckerboardDrawQuad>(); |
570 quad1->SetAll(shared_state1_in, | 569 quad1->SetAll(shared_state1_in, gfx::Rect(10, 10), gfx::Rect(10, 10), |
571 gfx::Rect(10, 10), | 570 gfx::Rect(10, 10), false, SK_ColorRED, 1.f); |
572 gfx::Rect(10, 10), | |
573 gfx::Rect(10, 10), | |
574 false, | |
575 SK_ColorRED); | |
576 | 571 |
577 // The second and third SharedQuadStates are not used. | 572 // The second and third SharedQuadStates are not used. |
578 SharedQuadState* shared_state2_in = pass_in->CreateAndAppendSharedQuadState(); | 573 SharedQuadState* shared_state2_in = pass_in->CreateAndAppendSharedQuadState(); |
579 shared_state2_in->SetAll(gfx::Transform(), | 574 shared_state2_in->SetAll(gfx::Transform(), |
580 gfx::Size(2, 2), | 575 gfx::Size(2, 2), |
581 gfx::Rect(), | 576 gfx::Rect(), |
582 gfx::Rect(), | 577 gfx::Rect(), |
583 false, | 578 false, |
584 1.f, | 579 1.f, |
585 SkXfermode::kSrcOver_Mode, | 580 SkXfermode::kSrcOver_Mode, |
(...skipping 15 matching lines...) Expand all Loading... |
601 gfx::Size(4, 4), | 596 gfx::Size(4, 4), |
602 gfx::Rect(), | 597 gfx::Rect(), |
603 gfx::Rect(), | 598 gfx::Rect(), |
604 false, | 599 false, |
605 1.f, | 600 1.f, |
606 SkXfermode::kSrcOver_Mode, | 601 SkXfermode::kSrcOver_Mode, |
607 0); | 602 0); |
608 | 603 |
609 CheckerboardDrawQuad* quad2 = | 604 CheckerboardDrawQuad* quad2 = |
610 pass_in->CreateAndAppendDrawQuad<CheckerboardDrawQuad>(); | 605 pass_in->CreateAndAppendDrawQuad<CheckerboardDrawQuad>(); |
611 quad2->SetAll(shared_state4_in, | 606 quad2->SetAll(shared_state4_in, gfx::Rect(10, 10), gfx::Rect(10, 10), |
612 gfx::Rect(10, 10), | 607 gfx::Rect(10, 10), false, SK_ColorRED, 1.f); |
613 gfx::Rect(10, 10), | |
614 gfx::Rect(10, 10), | |
615 false, | |
616 SK_ColorRED); | |
617 | 608 |
618 // The fifth is not used again. | 609 // The fifth is not used again. |
619 SharedQuadState* shared_state5_in = pass_in->CreateAndAppendSharedQuadState(); | 610 SharedQuadState* shared_state5_in = pass_in->CreateAndAppendSharedQuadState(); |
620 shared_state5_in->SetAll(gfx::Transform(), | 611 shared_state5_in->SetAll(gfx::Transform(), |
621 gfx::Size(5, 5), | 612 gfx::Size(5, 5), |
622 gfx::Rect(), | 613 gfx::Rect(), |
623 gfx::Rect(), | 614 gfx::Rect(), |
624 false, | 615 false, |
625 1.f, | 616 1.f, |
626 SkXfermode::kSrcOver_Mode, | 617 SkXfermode::kSrcOver_Mode, |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 SoftwareFrameData frame_out; | 765 SoftwareFrameData frame_out; |
775 PickleIterator iter(msg); | 766 PickleIterator iter(msg); |
776 EXPECT_EQ( | 767 EXPECT_EQ( |
777 expect_read, | 768 expect_read, |
778 IPC::ParamTraits<SoftwareFrameData>::Read(&msg, &iter, &frame_out)); | 769 IPC::ParamTraits<SoftwareFrameData>::Read(&msg, &iter, &frame_out)); |
779 } | 770 } |
780 } | 771 } |
781 | 772 |
782 } // namespace | 773 } // namespace |
783 } // namespace content | 774 } // namespace content |
OLD | NEW |