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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 arbitrary_resourceid3, | 426 arbitrary_resourceid3, |
427 arbitrary_resourceid4); | 427 arbitrary_resourceid4); |
428 scoped_ptr<DrawQuad> yuvvideo_cmp = yuvvideo_in->Copy( | 428 scoped_ptr<DrawQuad> yuvvideo_cmp = yuvvideo_in->Copy( |
429 yuvvideo_in->shared_quad_state); | 429 yuvvideo_in->shared_quad_state); |
430 | 430 |
431 scoped_ptr<RenderPass> pass_in = RenderPass::Create(); | 431 scoped_ptr<RenderPass> pass_in = RenderPass::Create(); |
432 pass_in->SetAll(arbitrary_id, | 432 pass_in->SetAll(arbitrary_id, |
433 arbitrary_rect1, | 433 arbitrary_rect1, |
434 arbitrary_rectf1, | 434 arbitrary_rectf1, |
435 arbitrary_matrix, | 435 arbitrary_matrix, |
436 arbitrary_bool1); | 436 arbitrary_bool1, |
| 437 cc::RenderPass::NO_OVERLAY); |
437 | 438 |
438 pass_in->shared_quad_state_list.push_back(shared_state1_in.Pass()); | 439 pass_in->shared_quad_state_list.push_back(shared_state1_in.Pass()); |
439 pass_in->quad_list.push_back(checkerboard_in.PassAs<DrawQuad>()); | 440 pass_in->quad_list.push_back(checkerboard_in.PassAs<DrawQuad>()); |
440 pass_in->quad_list.push_back(debugborder_in.PassAs<DrawQuad>()); | 441 pass_in->quad_list.push_back(debugborder_in.PassAs<DrawQuad>()); |
441 pass_in->quad_list.push_back(iosurface_in.PassAs<DrawQuad>()); | 442 pass_in->quad_list.push_back(iosurface_in.PassAs<DrawQuad>()); |
442 pass_in->quad_list.push_back(renderpass_in.PassAs<DrawQuad>()); | 443 pass_in->quad_list.push_back(renderpass_in.PassAs<DrawQuad>()); |
443 pass_in->shared_quad_state_list.push_back(shared_state2_in.Pass()); | 444 pass_in->shared_quad_state_list.push_back(shared_state2_in.Pass()); |
444 pass_in->shared_quad_state_list.push_back(shared_state3_in.Pass()); | 445 pass_in->shared_quad_state_list.push_back(shared_state3_in.Pass()); |
445 pass_in->quad_list.push_back(solidcolor_in.PassAs<DrawQuad>()); | 446 pass_in->quad_list.push_back(solidcolor_in.PassAs<DrawQuad>()); |
446 pass_in->quad_list.push_back(streamvideo_in.PassAs<DrawQuad>()); | 447 pass_in->quad_list.push_back(streamvideo_in.PassAs<DrawQuad>()); |
447 pass_in->quad_list.push_back(surface_in.PassAs<DrawQuad>()); | 448 pass_in->quad_list.push_back(surface_in.PassAs<DrawQuad>()); |
448 pass_in->quad_list.push_back(texture_in.PassAs<DrawQuad>()); | 449 pass_in->quad_list.push_back(texture_in.PassAs<DrawQuad>()); |
449 pass_in->quad_list.push_back(tile_in.PassAs<DrawQuad>()); | 450 pass_in->quad_list.push_back(tile_in.PassAs<DrawQuad>()); |
450 pass_in->quad_list.push_back(yuvvideo_in.PassAs<DrawQuad>()); | 451 pass_in->quad_list.push_back(yuvvideo_in.PassAs<DrawQuad>()); |
451 | 452 |
452 scoped_ptr<RenderPass> pass_cmp = RenderPass::Create(); | 453 scoped_ptr<RenderPass> pass_cmp = RenderPass::Create(); |
453 pass_cmp->SetAll(arbitrary_id, | 454 pass_cmp->SetAll(arbitrary_id, |
454 arbitrary_rect1, | 455 arbitrary_rect1, |
455 arbitrary_rectf1, | 456 arbitrary_rectf1, |
456 arbitrary_matrix, | 457 arbitrary_matrix, |
457 arbitrary_bool1); | 458 arbitrary_bool1, |
| 459 cc::RenderPass::NO_OVERLAY); |
458 | 460 |
459 pass_cmp->shared_quad_state_list.push_back(shared_state1_cmp.Pass()); | 461 pass_cmp->shared_quad_state_list.push_back(shared_state1_cmp.Pass()); |
460 pass_cmp->quad_list.push_back(checkerboard_cmp.PassAs<DrawQuad>()); | 462 pass_cmp->quad_list.push_back(checkerboard_cmp.PassAs<DrawQuad>()); |
461 pass_cmp->quad_list.push_back(debugborder_cmp.PassAs<DrawQuad>()); | 463 pass_cmp->quad_list.push_back(debugborder_cmp.PassAs<DrawQuad>()); |
462 pass_cmp->quad_list.push_back(iosurface_cmp.PassAs<DrawQuad>()); | 464 pass_cmp->quad_list.push_back(iosurface_cmp.PassAs<DrawQuad>()); |
463 pass_cmp->quad_list.push_back(renderpass_cmp.PassAs<DrawQuad>()); | 465 pass_cmp->quad_list.push_back(renderpass_cmp.PassAs<DrawQuad>()); |
464 pass_cmp->shared_quad_state_list.push_back(shared_state2_cmp.Pass()); | 466 pass_cmp->shared_quad_state_list.push_back(shared_state2_cmp.Pass()); |
465 pass_cmp->shared_quad_state_list.push_back(shared_state3_cmp.Pass()); | 467 pass_cmp->shared_quad_state_list.push_back(shared_state3_cmp.Pass()); |
466 pass_cmp->quad_list.push_back(solidcolor_cmp.PassAs<DrawQuad>()); | 468 pass_cmp->quad_list.push_back(solidcolor_cmp.PassAs<DrawQuad>()); |
467 pass_cmp->quad_list.push_back(streamvideo_cmp.PassAs<DrawQuad>()); | 469 pass_cmp->quad_list.push_back(streamvideo_cmp.PassAs<DrawQuad>()); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 } | 526 } |
525 | 527 |
526 TEST_F(CCMessagesTest, UnusedSharedQuadStates) { | 528 TEST_F(CCMessagesTest, UnusedSharedQuadStates) { |
527 scoped_ptr<CheckerboardDrawQuad> quad; | 529 scoped_ptr<CheckerboardDrawQuad> quad; |
528 | 530 |
529 scoped_ptr<RenderPass> pass_in = RenderPass::Create(); | 531 scoped_ptr<RenderPass> pass_in = RenderPass::Create(); |
530 pass_in->SetAll(RenderPass::Id(1, 1), | 532 pass_in->SetAll(RenderPass::Id(1, 1), |
531 gfx::Rect(100, 100), | 533 gfx::Rect(100, 100), |
532 gfx::RectF(), | 534 gfx::RectF(), |
533 gfx::Transform(), | 535 gfx::Transform(), |
534 false); | 536 false, |
| 537 cc::RenderPass::NO_OVERLAY); |
535 | 538 |
536 // The first SharedQuadState is used. | 539 // The first SharedQuadState is used. |
537 scoped_ptr<SharedQuadState> shared_state1_in = SharedQuadState::Create(); | 540 scoped_ptr<SharedQuadState> shared_state1_in = SharedQuadState::Create(); |
538 shared_state1_in->SetAll(gfx::Transform(), | 541 shared_state1_in->SetAll(gfx::Transform(), |
539 gfx::Size(1, 1), | 542 gfx::Size(1, 1), |
540 gfx::Rect(), | 543 gfx::Rect(), |
541 gfx::Rect(), | 544 gfx::Rect(), |
542 false, | 545 false, |
543 1.f, | 546 1.f, |
544 SkXfermode::kSrcOver_Mode); | 547 SkXfermode::kSrcOver_Mode); |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 } | 740 } |
738 | 741 |
739 // Verify the largest DrawQuad type is RenderPassDrawQuad. If this ever | 742 // Verify the largest DrawQuad type is RenderPassDrawQuad. If this ever |
740 // changes, then the ReserveSizeForRenderPassWrite() method needs to be | 743 // changes, then the ReserveSizeForRenderPassWrite() method needs to be |
741 // updated as well to use the new largest quad. | 744 // updated as well to use the new largest quad. |
742 EXPECT_EQ(sizeof(RenderPassDrawQuad), largest); | 745 EXPECT_EQ(sizeof(RenderPassDrawQuad), largest); |
743 } | 746 } |
744 | 747 |
745 } // namespace | 748 } // namespace |
746 } // namespace content | 749 } // namespace content |
OLD | NEW |