| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 EXPECT_EQ(matrix, copy_quad->matrix); | 483 EXPECT_EQ(matrix, copy_quad->matrix); |
| 484 | 484 |
| 485 CREATE_QUAD_2_ALL(StreamVideoDrawQuad, resource_id, matrix); | 485 CREATE_QUAD_2_ALL(StreamVideoDrawQuad, resource_id, matrix); |
| 486 EXPECT_EQ(DrawQuad::STREAM_VIDEO_CONTENT, copy_quad->material); | 486 EXPECT_EQ(DrawQuad::STREAM_VIDEO_CONTENT, copy_quad->material); |
| 487 EXPECT_EQ(resource_id, copy_quad->resource_id); | 487 EXPECT_EQ(resource_id, copy_quad->resource_id); |
| 488 EXPECT_EQ(matrix, copy_quad->matrix); | 488 EXPECT_EQ(matrix, copy_quad->matrix); |
| 489 } | 489 } |
| 490 | 490 |
| 491 TEST(DrawQuadTest, CopySurfaceDrawQuad) { | 491 TEST(DrawQuadTest, CopySurfaceDrawQuad) { |
| 492 gfx::Rect visible_rect(40, 50, 30, 20); | 492 gfx::Rect visible_rect(40, 50, 30, 20); |
| 493 int surface_id = 1234; | 493 SurfaceId surface_id; |
| 494 surface_id.id = 1234; |
| 494 CREATE_SHARED_STATE(); | 495 CREATE_SHARED_STATE(); |
| 495 | 496 |
| 496 CREATE_QUAD_2_NEW(SurfaceDrawQuad, visible_rect, surface_id); | 497 CREATE_QUAD_2_NEW(SurfaceDrawQuad, visible_rect, surface_id); |
| 497 EXPECT_EQ(DrawQuad::SURFACE_CONTENT, copy_quad->material); | 498 EXPECT_EQ(DrawQuad::SURFACE_CONTENT, copy_quad->material); |
| 498 EXPECT_RECT_EQ(visible_rect, copy_quad->visible_rect); | 499 EXPECT_RECT_EQ(visible_rect, copy_quad->visible_rect); |
| 499 EXPECT_EQ(surface_id, copy_quad->surface_id); | 500 EXPECT_EQ(surface_id, copy_quad->surface_id); |
| 500 | 501 |
| 501 CREATE_QUAD_1_ALL(SurfaceDrawQuad, surface_id); | 502 CREATE_QUAD_1_ALL(SurfaceDrawQuad, surface_id); |
| 502 EXPECT_EQ(DrawQuad::SURFACE_CONTENT, copy_quad->material); | 503 EXPECT_EQ(DrawQuad::SURFACE_CONTENT, copy_quad->material); |
| 503 EXPECT_EQ(surface_id, copy_quad->surface_id); | 504 EXPECT_EQ(surface_id, copy_quad->surface_id); |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 CREATE_SHARED_STATE(); | 792 CREATE_SHARED_STATE(); |
| 792 CREATE_QUAD_4_NEW( | 793 CREATE_QUAD_4_NEW( |
| 793 StreamVideoDrawQuad, opaque_rect, visible_rect, resource_id, matrix); | 794 StreamVideoDrawQuad, opaque_rect, visible_rect, resource_id, matrix); |
| 794 EXPECT_EQ(resource_id, quad_new->resource_id); | 795 EXPECT_EQ(resource_id, quad_new->resource_id); |
| 795 EXPECT_EQ(1, IterateAndCount(quad_new.get())); | 796 EXPECT_EQ(1, IterateAndCount(quad_new.get())); |
| 796 EXPECT_EQ(resource_id + 1, quad_new->resource_id); | 797 EXPECT_EQ(resource_id + 1, quad_new->resource_id); |
| 797 } | 798 } |
| 798 | 799 |
| 799 TEST_F(DrawQuadIteratorTest, SurfaceDrawQuad) { | 800 TEST_F(DrawQuadIteratorTest, SurfaceDrawQuad) { |
| 800 gfx::Rect visible_rect(40, 50, 30, 20); | 801 gfx::Rect visible_rect(40, 50, 30, 20); |
| 801 int surface_id = 4321; | 802 SurfaceId surface_id; |
| 803 surface_id.id = 4321; |
| 802 | 804 |
| 803 CREATE_SHARED_STATE(); | 805 CREATE_SHARED_STATE(); |
| 804 CREATE_QUAD_2_NEW(SurfaceDrawQuad, visible_rect, surface_id); | 806 CREATE_QUAD_2_NEW(SurfaceDrawQuad, visible_rect, surface_id); |
| 805 EXPECT_EQ(0, IterateAndCount(quad_new.get())); | 807 EXPECT_EQ(0, IterateAndCount(quad_new.get())); |
| 806 } | 808 } |
| 807 | 809 |
| 808 TEST_F(DrawQuadIteratorTest, TextureDrawQuad) { | 810 TEST_F(DrawQuadIteratorTest, TextureDrawQuad) { |
| 809 gfx::Rect opaque_rect(33, 47, 10, 12); | 811 gfx::Rect opaque_rect(33, 47, 10, 12); |
| 810 gfx::Rect visible_rect(40, 50, 30, 20); | 812 gfx::Rect visible_rect(40, 50, 30, 20); |
| 811 unsigned resource_id = 82; | 813 unsigned resource_id = 82; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 904 texture_size, | 906 texture_size, |
| 905 texture_format, | 907 texture_format, |
| 906 content_rect, | 908 content_rect, |
| 907 contents_scale, | 909 contents_scale, |
| 908 picture_pile); | 910 picture_pile); |
| 909 EXPECT_EQ(0, IterateAndCount(quad_new.get())); | 911 EXPECT_EQ(0, IterateAndCount(quad_new.get())); |
| 910 } | 912 } |
| 911 | 913 |
| 912 } // namespace | 914 } // namespace |
| 913 } // namespace cc | 915 } // namespace cc |
| OLD | NEW |