Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(890)

Side by Side Diff: cc/quads/draw_quad_unittest.cc

Issue 1837263005: cc: Rename DisplayListRasterSource to just RasterSource. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/playback/raster_source_unittest.cc ('k') | cc/quads/picture_draw_quad.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "cc/base/math_util.h" 13 #include "cc/base/math_util.h"
14 #include "cc/output/filter_operations.h" 14 #include "cc/output/filter_operations.h"
15 #include "cc/quads/debug_border_draw_quad.h" 15 #include "cc/quads/debug_border_draw_quad.h"
16 #include "cc/quads/io_surface_draw_quad.h" 16 #include "cc/quads/io_surface_draw_quad.h"
17 #include "cc/quads/largest_draw_quad.h" 17 #include "cc/quads/largest_draw_quad.h"
18 #include "cc/quads/picture_draw_quad.h" 18 #include "cc/quads/picture_draw_quad.h"
19 #include "cc/quads/render_pass.h" 19 #include "cc/quads/render_pass.h"
20 #include "cc/quads/render_pass_draw_quad.h" 20 #include "cc/quads/render_pass_draw_quad.h"
21 #include "cc/quads/solid_color_draw_quad.h" 21 #include "cc/quads/solid_color_draw_quad.h"
22 #include "cc/quads/stream_video_draw_quad.h" 22 #include "cc/quads/stream_video_draw_quad.h"
23 #include "cc/quads/surface_draw_quad.h" 23 #include "cc/quads/surface_draw_quad.h"
24 #include "cc/quads/texture_draw_quad.h" 24 #include "cc/quads/texture_draw_quad.h"
25 #include "cc/quads/tile_draw_quad.h" 25 #include "cc/quads/tile_draw_quad.h"
26 #include "cc/quads/yuv_video_draw_quad.h" 26 #include "cc/quads/yuv_video_draw_quad.h"
27 #include "cc/test/fake_display_list_raster_source.h" 27 #include "cc/test/fake_raster_source.h"
28 #include "cc/test/geometry_test_utils.h" 28 #include "cc/test/geometry_test_utils.h"
29 #include "testing/gtest/include/gtest/gtest.h" 29 #include "testing/gtest/include/gtest/gtest.h"
30 #include "third_party/skia/include/effects/SkBlurImageFilter.h" 30 #include "third_party/skia/include/effects/SkBlurImageFilter.h"
31 #include "ui/gfx/transform.h" 31 #include "ui/gfx/transform.h"
32 32
33 namespace cc { 33 namespace cc {
34 namespace { 34 namespace {
35 35
36 TEST(DrawQuadTest, CopySharedQuadState) { 36 TEST(DrawQuadTest, CopySharedQuadState) {
37 gfx::Transform quad_transform = gfx::Transform(1.0, 0.0, 0.5, 1.0, 0.5, 0.0); 37 gfx::Transform quad_transform = gfx::Transform(1.0, 0.0, 0.5, 1.0, 0.5, 0.0);
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 694
695 TEST(DrawQuadTest, CopyPictureDrawQuad) { 695 TEST(DrawQuadTest, CopyPictureDrawQuad) {
696 gfx::Rect opaque_rect(33, 44, 22, 33); 696 gfx::Rect opaque_rect(33, 44, 22, 33);
697 gfx::Rect visible_rect(40, 50, 30, 20); 697 gfx::Rect visible_rect(40, 50, 30, 20);
698 gfx::RectF tex_coord_rect(31.f, 12.f, 54.f, 20.f); 698 gfx::RectF tex_coord_rect(31.f, 12.f, 54.f, 20.f);
699 gfx::Size texture_size(85, 32); 699 gfx::Size texture_size(85, 32);
700 bool nearest_neighbor = true; 700 bool nearest_neighbor = true;
701 ResourceFormat texture_format = RGBA_8888; 701 ResourceFormat texture_format = RGBA_8888;
702 gfx::Rect content_rect(30, 40, 20, 30); 702 gfx::Rect content_rect(30, 40, 20, 30);
703 float contents_scale = 3.141592f; 703 float contents_scale = 3.141592f;
704 scoped_refptr<DisplayListRasterSource> raster_source = 704 scoped_refptr<RasterSource> raster_source =
705 FakeDisplayListRasterSource::CreateEmpty(gfx::Size(100, 100)); 705 FakeRasterSource::CreateEmpty(gfx::Size(100, 100));
706 CREATE_SHARED_STATE(); 706 CREATE_SHARED_STATE();
707 707
708 CREATE_QUAD_9_NEW(PictureDrawQuad, opaque_rect, visible_rect, tex_coord_rect, 708 CREATE_QUAD_9_NEW(PictureDrawQuad, opaque_rect, visible_rect, tex_coord_rect,
709 texture_size, nearest_neighbor, texture_format, 709 texture_size, nearest_neighbor, texture_format,
710 content_rect, contents_scale, raster_source); 710 content_rect, contents_scale, raster_source);
711 EXPECT_EQ(DrawQuad::PICTURE_CONTENT, copy_quad->material); 711 EXPECT_EQ(DrawQuad::PICTURE_CONTENT, copy_quad->material);
712 EXPECT_EQ(opaque_rect, copy_quad->opaque_rect); 712 EXPECT_EQ(opaque_rect, copy_quad->opaque_rect);
713 EXPECT_EQ(visible_rect, copy_quad->visible_rect); 713 EXPECT_EQ(visible_rect, copy_quad->visible_rect);
714 EXPECT_EQ(tex_coord_rect, copy_quad->tex_coord_rect); 714 EXPECT_EQ(tex_coord_rect, copy_quad->tex_coord_rect);
715 EXPECT_EQ(texture_size, copy_quad->texture_size); 715 EXPECT_EQ(texture_size, copy_quad->texture_size);
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 // Disabled until picture draw quad is supported for ubercomp: crbug.com/231715 933 // Disabled until picture draw quad is supported for ubercomp: crbug.com/231715
934 TEST_F(DrawQuadIteratorTest, DISABLED_PictureDrawQuad) { 934 TEST_F(DrawQuadIteratorTest, DISABLED_PictureDrawQuad) {
935 gfx::Rect opaque_rect(33, 44, 22, 33); 935 gfx::Rect opaque_rect(33, 44, 22, 33);
936 gfx::Rect visible_rect(40, 50, 30, 20); 936 gfx::Rect visible_rect(40, 50, 30, 20);
937 gfx::RectF tex_coord_rect(31.f, 12.f, 54.f, 20.f); 937 gfx::RectF tex_coord_rect(31.f, 12.f, 54.f, 20.f);
938 gfx::Size texture_size(85, 32); 938 gfx::Size texture_size(85, 32);
939 bool nearest_neighbor = true; 939 bool nearest_neighbor = true;
940 ResourceFormat texture_format = RGBA_8888; 940 ResourceFormat texture_format = RGBA_8888;
941 gfx::Rect content_rect(30, 40, 20, 30); 941 gfx::Rect content_rect(30, 40, 20, 30);
942 float contents_scale = 3.141592f; 942 float contents_scale = 3.141592f;
943 scoped_refptr<DisplayListRasterSource> raster_source = 943 scoped_refptr<RasterSource> raster_source =
944 FakeDisplayListRasterSource::CreateEmpty(gfx::Size(100, 100)); 944 FakeRasterSource::CreateEmpty(gfx::Size(100, 100));
945 945
946 CREATE_SHARED_STATE(); 946 CREATE_SHARED_STATE();
947 CREATE_QUAD_9_NEW(PictureDrawQuad, opaque_rect, visible_rect, tex_coord_rect, 947 CREATE_QUAD_9_NEW(PictureDrawQuad, opaque_rect, visible_rect, tex_coord_rect,
948 texture_size, nearest_neighbor, texture_format, 948 texture_size, nearest_neighbor, texture_format,
949 content_rect, contents_scale, raster_source); 949 content_rect, contents_scale, raster_source);
950 EXPECT_EQ(0, IterateAndCount(quad_new)); 950 EXPECT_EQ(0, IterateAndCount(quad_new));
951 } 951 }
952 952
953 TEST(DrawQuadTest, LargestQuadType) { 953 TEST(DrawQuadTest, LargestQuadType) {
954 size_t largest = 0; 954 size_t largest = 0;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 LOG(ERROR) << "YUVVideoDrawQuad " << sizeof(YUVVideoDrawQuad); 1030 LOG(ERROR) << "YUVVideoDrawQuad " << sizeof(YUVVideoDrawQuad);
1031 break; 1031 break;
1032 case DrawQuad::INVALID: 1032 case DrawQuad::INVALID:
1033 break; 1033 break;
1034 } 1034 }
1035 } 1035 }
1036 } 1036 }
1037 1037
1038 } // namespace 1038 } // namespace
1039 } // namespace cc 1039 } // namespace cc
OLDNEW
« no previous file with comments | « cc/playback/raster_source_unittest.cc ('k') | cc/quads/picture_draw_quad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698