| 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 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 | 659 |
| 660 TEST(DrawQuadTest, CopyPictureDrawQuad) { | 660 TEST(DrawQuadTest, CopyPictureDrawQuad) { |
| 661 gfx::Rect opaque_rect(33, 44, 22, 33); | 661 gfx::Rect opaque_rect(33, 44, 22, 33); |
| 662 gfx::Rect visible_rect(40, 50, 30, 20); | 662 gfx::Rect visible_rect(40, 50, 30, 20); |
| 663 gfx::RectF tex_coord_rect(31.f, 12.f, 54.f, 20.f); | 663 gfx::RectF tex_coord_rect(31.f, 12.f, 54.f, 20.f); |
| 664 gfx::Size texture_size(85, 32); | 664 gfx::Size texture_size(85, 32); |
| 665 bool nearest_neighbor = true; | 665 bool nearest_neighbor = true; |
| 666 ResourceFormat texture_format = RGBA_8888; | 666 ResourceFormat texture_format = RGBA_8888; |
| 667 gfx::Rect content_rect(30, 40, 20, 30); | 667 gfx::Rect content_rect(30, 40, 20, 30); |
| 668 float contents_scale = 3.141592f; | 668 float contents_scale = 3.141592f; |
| 669 scoped_refptr<RasterSource> raster_source = | 669 scoped_refptr<DisplayListRasterSource> raster_source = |
| 670 FakeDisplayListRasterSource::CreateEmpty(gfx::Size(100, 100)); | 670 FakeDisplayListRasterSource::CreateEmpty(gfx::Size(100, 100)); |
| 671 CREATE_SHARED_STATE(); | 671 CREATE_SHARED_STATE(); |
| 672 | 672 |
| 673 CREATE_QUAD_9_NEW(PictureDrawQuad, opaque_rect, visible_rect, tex_coord_rect, | 673 CREATE_QUAD_9_NEW(PictureDrawQuad, opaque_rect, visible_rect, tex_coord_rect, |
| 674 texture_size, nearest_neighbor, texture_format, | 674 texture_size, nearest_neighbor, texture_format, |
| 675 content_rect, contents_scale, raster_source); | 675 content_rect, contents_scale, raster_source); |
| 676 EXPECT_EQ(DrawQuad::PICTURE_CONTENT, copy_quad->material); | 676 EXPECT_EQ(DrawQuad::PICTURE_CONTENT, copy_quad->material); |
| 677 EXPECT_EQ(opaque_rect, copy_quad->opaque_rect); | 677 EXPECT_EQ(opaque_rect, copy_quad->opaque_rect); |
| 678 EXPECT_EQ(visible_rect, copy_quad->visible_rect); | 678 EXPECT_EQ(visible_rect, copy_quad->visible_rect); |
| 679 EXPECT_EQ(tex_coord_rect, copy_quad->tex_coord_rect); | 679 EXPECT_EQ(tex_coord_rect, copy_quad->tex_coord_rect); |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 // Disabled until picture draw quad is supported for ubercomp: crbug.com/231715 | 897 // Disabled until picture draw quad is supported for ubercomp: crbug.com/231715 |
| 898 TEST_F(DrawQuadIteratorTest, DISABLED_PictureDrawQuad) { | 898 TEST_F(DrawQuadIteratorTest, DISABLED_PictureDrawQuad) { |
| 899 gfx::Rect opaque_rect(33, 44, 22, 33); | 899 gfx::Rect opaque_rect(33, 44, 22, 33); |
| 900 gfx::Rect visible_rect(40, 50, 30, 20); | 900 gfx::Rect visible_rect(40, 50, 30, 20); |
| 901 gfx::RectF tex_coord_rect(31.f, 12.f, 54.f, 20.f); | 901 gfx::RectF tex_coord_rect(31.f, 12.f, 54.f, 20.f); |
| 902 gfx::Size texture_size(85, 32); | 902 gfx::Size texture_size(85, 32); |
| 903 bool nearest_neighbor = true; | 903 bool nearest_neighbor = true; |
| 904 ResourceFormat texture_format = RGBA_8888; | 904 ResourceFormat texture_format = RGBA_8888; |
| 905 gfx::Rect content_rect(30, 40, 20, 30); | 905 gfx::Rect content_rect(30, 40, 20, 30); |
| 906 float contents_scale = 3.141592f; | 906 float contents_scale = 3.141592f; |
| 907 scoped_refptr<RasterSource> raster_source = | 907 scoped_refptr<DisplayListRasterSource> raster_source = |
| 908 FakeDisplayListRasterSource::CreateEmpty(gfx::Size(100, 100)); | 908 FakeDisplayListRasterSource::CreateEmpty(gfx::Size(100, 100)); |
| 909 | 909 |
| 910 CREATE_SHARED_STATE(); | 910 CREATE_SHARED_STATE(); |
| 911 CREATE_QUAD_9_NEW(PictureDrawQuad, opaque_rect, visible_rect, tex_coord_rect, | 911 CREATE_QUAD_9_NEW(PictureDrawQuad, opaque_rect, visible_rect, tex_coord_rect, |
| 912 texture_size, nearest_neighbor, texture_format, | 912 texture_size, nearest_neighbor, texture_format, |
| 913 content_rect, contents_scale, raster_source); | 913 content_rect, contents_scale, raster_source); |
| 914 EXPECT_EQ(0, IterateAndCount(quad_new)); | 914 EXPECT_EQ(0, IterateAndCount(quad_new)); |
| 915 } | 915 } |
| 916 | 916 |
| 917 TEST(DrawQuadTest, LargestQuadType) { | 917 TEST(DrawQuadTest, LargestQuadType) { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 994 LOG(ERROR) << "YUVVideoDrawQuad " << sizeof(YUVVideoDrawQuad); | 994 LOG(ERROR) << "YUVVideoDrawQuad " << sizeof(YUVVideoDrawQuad); |
| 995 break; | 995 break; |
| 996 case DrawQuad::INVALID: | 996 case DrawQuad::INVALID: |
| 997 break; | 997 break; |
| 998 } | 998 } |
| 999 } | 999 } |
| 1000 } | 1000 } |
| 1001 | 1001 |
| 1002 } // namespace | 1002 } // namespace |
| 1003 } // namespace cc | 1003 } // namespace cc |
| OLD | NEW |