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 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 CREATE_QUAD_3_ALL(StreamVideoDrawQuad, resource_id, resource_size_in_pixels, | 500 CREATE_QUAD_3_ALL(StreamVideoDrawQuad, resource_id, resource_size_in_pixels, |
501 matrix); | 501 matrix); |
502 EXPECT_EQ(DrawQuad::STREAM_VIDEO_CONTENT, copy_quad->material); | 502 EXPECT_EQ(DrawQuad::STREAM_VIDEO_CONTENT, copy_quad->material); |
503 EXPECT_EQ(resource_id, copy_quad->resource_id()); | 503 EXPECT_EQ(resource_id, copy_quad->resource_id()); |
504 EXPECT_EQ(resource_size_in_pixels, copy_quad->resource_size_in_pixels()); | 504 EXPECT_EQ(resource_size_in_pixels, copy_quad->resource_size_in_pixels()); |
505 EXPECT_EQ(matrix, copy_quad->matrix); | 505 EXPECT_EQ(matrix, copy_quad->matrix); |
506 } | 506 } |
507 | 507 |
508 TEST(DrawQuadTest, CopySurfaceDrawQuad) { | 508 TEST(DrawQuadTest, CopySurfaceDrawQuad) { |
509 gfx::Rect visible_rect(40, 50, 30, 20); | 509 gfx::Rect visible_rect(40, 50, 30, 20); |
510 SurfaceId surface_id(1234); | 510 SurfaceId surface_id = SurfaceId::FromUnsafeValue(1234); |
511 CREATE_SHARED_STATE(); | 511 CREATE_SHARED_STATE(); |
512 | 512 |
513 CREATE_QUAD_2_NEW(SurfaceDrawQuad, visible_rect, surface_id); | 513 CREATE_QUAD_2_NEW(SurfaceDrawQuad, visible_rect, surface_id); |
514 EXPECT_EQ(DrawQuad::SURFACE_CONTENT, copy_quad->material); | 514 EXPECT_EQ(DrawQuad::SURFACE_CONTENT, copy_quad->material); |
515 EXPECT_EQ(visible_rect, copy_quad->visible_rect); | 515 EXPECT_EQ(visible_rect, copy_quad->visible_rect); |
516 EXPECT_EQ(surface_id, copy_quad->surface_id); | 516 EXPECT_EQ(surface_id, copy_quad->surface_id); |
517 | 517 |
518 CREATE_QUAD_1_ALL(SurfaceDrawQuad, surface_id); | 518 CREATE_QUAD_1_ALL(SurfaceDrawQuad, surface_id); |
519 EXPECT_EQ(DrawQuad::SURFACE_CONTENT, copy_quad->material); | 519 EXPECT_EQ(DrawQuad::SURFACE_CONTENT, copy_quad->material); |
520 EXPECT_EQ(surface_id, copy_quad->surface_id); | 520 EXPECT_EQ(surface_id, copy_quad->surface_id); |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 CREATE_QUAD_5_NEW(StreamVideoDrawQuad, opaque_rect, visible_rect, resource_id, | 800 CREATE_QUAD_5_NEW(StreamVideoDrawQuad, opaque_rect, visible_rect, resource_id, |
801 resource_size_in_pixels, matrix); | 801 resource_size_in_pixels, matrix); |
802 EXPECT_EQ(resource_id, quad_new->resource_id()); | 802 EXPECT_EQ(resource_id, quad_new->resource_id()); |
803 EXPECT_EQ(resource_size_in_pixels, quad_new->resource_size_in_pixels()); | 803 EXPECT_EQ(resource_size_in_pixels, quad_new->resource_size_in_pixels()); |
804 EXPECT_EQ(1, IterateAndCount(quad_new)); | 804 EXPECT_EQ(1, IterateAndCount(quad_new)); |
805 EXPECT_EQ(resource_id + 1, quad_new->resource_id()); | 805 EXPECT_EQ(resource_id + 1, quad_new->resource_id()); |
806 } | 806 } |
807 | 807 |
808 TEST_F(DrawQuadIteratorTest, SurfaceDrawQuad) { | 808 TEST_F(DrawQuadIteratorTest, SurfaceDrawQuad) { |
809 gfx::Rect visible_rect(40, 50, 30, 20); | 809 gfx::Rect visible_rect(40, 50, 30, 20); |
810 SurfaceId surface_id(4321); | 810 SurfaceId surface_id = SurfaceId::FromUnsafeValue(4321); |
811 | 811 |
812 CREATE_SHARED_STATE(); | 812 CREATE_SHARED_STATE(); |
813 CREATE_QUAD_2_NEW(SurfaceDrawQuad, visible_rect, surface_id); | 813 CREATE_QUAD_2_NEW(SurfaceDrawQuad, visible_rect, surface_id); |
814 EXPECT_EQ(0, IterateAndCount(quad_new)); | 814 EXPECT_EQ(0, IterateAndCount(quad_new)); |
815 } | 815 } |
816 | 816 |
817 TEST_F(DrawQuadIteratorTest, TextureDrawQuad) { | 817 TEST_F(DrawQuadIteratorTest, TextureDrawQuad) { |
818 gfx::Rect opaque_rect(33, 47, 10, 12); | 818 gfx::Rect opaque_rect(33, 47, 10, 12); |
819 gfx::Rect visible_rect(40, 50, 30, 20); | 819 gfx::Rect visible_rect(40, 50, 30, 20); |
820 unsigned resource_id = 82; | 820 unsigned resource_id = 82; |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 LOG(ERROR) << "YUVVideoDrawQuad " << sizeof(YUVVideoDrawQuad); | 996 LOG(ERROR) << "YUVVideoDrawQuad " << sizeof(YUVVideoDrawQuad); |
997 break; | 997 break; |
998 case DrawQuad::INVALID: | 998 case DrawQuad::INVALID: |
999 break; | 999 break; |
1000 } | 1000 } |
1001 } | 1001 } |
1002 } | 1002 } |
1003 | 1003 |
1004 } // namespace | 1004 } // namespace |
1005 } // namespace cc | 1005 } // namespace cc |
OLD | NEW |