OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/quads/draw_quad.h" | 5 #include "cc/quads/draw_quad.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 CREATE_QUAD_3_ALL(StreamVideoDrawQuad, resource_id, resource_size_in_pixels, | 499 CREATE_QUAD_3_ALL(StreamVideoDrawQuad, resource_id, resource_size_in_pixels, |
500 matrix); | 500 matrix); |
501 EXPECT_EQ(DrawQuad::STREAM_VIDEO_CONTENT, copy_quad->material); | 501 EXPECT_EQ(DrawQuad::STREAM_VIDEO_CONTENT, copy_quad->material); |
502 EXPECT_EQ(resource_id, copy_quad->resource_id()); | 502 EXPECT_EQ(resource_id, copy_quad->resource_id()); |
503 EXPECT_EQ(resource_size_in_pixels, copy_quad->resource_size_in_pixels()); | 503 EXPECT_EQ(resource_size_in_pixels, copy_quad->resource_size_in_pixels()); |
504 EXPECT_EQ(matrix, copy_quad->matrix); | 504 EXPECT_EQ(matrix, copy_quad->matrix); |
505 } | 505 } |
506 | 506 |
507 TEST(DrawQuadTest, CopySurfaceDrawQuad) { | 507 TEST(DrawQuadTest, CopySurfaceDrawQuad) { |
508 gfx::Rect visible_rect(40, 50, 30, 20); | 508 gfx::Rect visible_rect(40, 50, 30, 20); |
509 SurfaceId surface_id(0, 1234, 0); | 509 SurfaceId surface_id(0, 0, 1234, 0); |
510 CREATE_SHARED_STATE(); | 510 CREATE_SHARED_STATE(); |
511 | 511 |
512 CREATE_QUAD_2_NEW(SurfaceDrawQuad, visible_rect, surface_id); | 512 CREATE_QUAD_2_NEW(SurfaceDrawQuad, visible_rect, surface_id); |
513 EXPECT_EQ(DrawQuad::SURFACE_CONTENT, copy_quad->material); | 513 EXPECT_EQ(DrawQuad::SURFACE_CONTENT, copy_quad->material); |
514 EXPECT_EQ(visible_rect, copy_quad->visible_rect); | 514 EXPECT_EQ(visible_rect, copy_quad->visible_rect); |
515 EXPECT_EQ(surface_id, copy_quad->surface_id); | 515 EXPECT_EQ(surface_id, copy_quad->surface_id); |
516 | 516 |
517 CREATE_QUAD_1_ALL(SurfaceDrawQuad, surface_id); | 517 CREATE_QUAD_1_ALL(SurfaceDrawQuad, surface_id); |
518 EXPECT_EQ(DrawQuad::SURFACE_CONTENT, copy_quad->material); | 518 EXPECT_EQ(DrawQuad::SURFACE_CONTENT, copy_quad->material); |
519 EXPECT_EQ(surface_id, copy_quad->surface_id); | 519 EXPECT_EQ(surface_id, copy_quad->surface_id); |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 CREATE_QUAD_5_NEW(StreamVideoDrawQuad, opaque_rect, visible_rect, resource_id, | 788 CREATE_QUAD_5_NEW(StreamVideoDrawQuad, opaque_rect, visible_rect, resource_id, |
789 resource_size_in_pixels, matrix); | 789 resource_size_in_pixels, matrix); |
790 EXPECT_EQ(resource_id, quad_new->resource_id()); | 790 EXPECT_EQ(resource_id, quad_new->resource_id()); |
791 EXPECT_EQ(resource_size_in_pixels, quad_new->resource_size_in_pixels()); | 791 EXPECT_EQ(resource_size_in_pixels, quad_new->resource_size_in_pixels()); |
792 EXPECT_EQ(1, IterateAndCount(quad_new)); | 792 EXPECT_EQ(1, IterateAndCount(quad_new)); |
793 EXPECT_EQ(resource_id + 1, quad_new->resource_id()); | 793 EXPECT_EQ(resource_id + 1, quad_new->resource_id()); |
794 } | 794 } |
795 | 795 |
796 TEST_F(DrawQuadIteratorTest, SurfaceDrawQuad) { | 796 TEST_F(DrawQuadIteratorTest, SurfaceDrawQuad) { |
797 gfx::Rect visible_rect(40, 50, 30, 20); | 797 gfx::Rect visible_rect(40, 50, 30, 20); |
798 SurfaceId surface_id(0, 4321, 0); | 798 SurfaceId surface_id(0, 0, 4321, 0); |
799 | 799 |
800 CREATE_SHARED_STATE(); | 800 CREATE_SHARED_STATE(); |
801 CREATE_QUAD_2_NEW(SurfaceDrawQuad, visible_rect, surface_id); | 801 CREATE_QUAD_2_NEW(SurfaceDrawQuad, visible_rect, surface_id); |
802 EXPECT_EQ(0, IterateAndCount(quad_new)); | 802 EXPECT_EQ(0, IterateAndCount(quad_new)); |
803 } | 803 } |
804 | 804 |
805 TEST_F(DrawQuadIteratorTest, TextureDrawQuad) { | 805 TEST_F(DrawQuadIteratorTest, TextureDrawQuad) { |
806 gfx::Rect opaque_rect(33, 47, 10, 12); | 806 gfx::Rect opaque_rect(33, 47, 10, 12); |
807 gfx::Rect visible_rect(40, 50, 30, 20); | 807 gfx::Rect visible_rect(40, 50, 30, 20); |
808 unsigned resource_id = 82; | 808 unsigned resource_id = 82; |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 LOG(ERROR) << "YUVVideoDrawQuad " << sizeof(YUVVideoDrawQuad); | 973 LOG(ERROR) << "YUVVideoDrawQuad " << sizeof(YUVVideoDrawQuad); |
974 break; | 974 break; |
975 case DrawQuad::INVALID: | 975 case DrawQuad::INVALID: |
976 break; | 976 break; |
977 } | 977 } |
978 } | 978 } |
979 } | 979 } |
980 | 980 |
981 } // namespace | 981 } // namespace |
982 } // namespace cc | 982 } // namespace cc |
OLD | NEW |