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

Unified Diff: cc/quads/draw_quad_unittest.cc

Issue 881963002: Clamp YUV videos to their visible size in the shader (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: danakj review, build fix Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/output/shader.cc ('k') | cc/quads/yuv_video_draw_quad.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/quads/draw_quad_unittest.cc
diff --git a/cc/quads/draw_quad_unittest.cc b/cc/quads/draw_quad_unittest.cc
index b9a4d1a26fffe94dab3ab95bae0b50121b478d83..6b51398a21b525efdbd03f2567d07761fc9037d8 100644
--- a/cc/quads/draw_quad_unittest.cc
+++ b/cc/quads/draw_quad_unittest.cc
@@ -638,6 +638,7 @@ TEST(DrawQuadTest, CopyYUVVideoDrawQuad) {
gfx::Rect opaque_rect(33, 47, 10, 12);
gfx::Rect visible_rect(40, 50, 30, 20);
gfx::RectF tex_coord_rect(0.0f, 0.0f, 0.75f, 0.5f);
+ gfx::Size tex_size(32, 68);
ResourceProvider::ResourceId y_plane_resource_id = 45;
ResourceProvider::ResourceId u_plane_resource_id = 532;
ResourceProvider::ResourceId v_plane_resource_id = 4;
@@ -645,34 +646,26 @@ TEST(DrawQuadTest, CopyYUVVideoDrawQuad) {
YUVVideoDrawQuad::ColorSpace color_space = YUVVideoDrawQuad::REC_601_JPEG;
CREATE_SHARED_STATE();
- CREATE_QUAD_8_NEW(YUVVideoDrawQuad,
- opaque_rect,
- visible_rect,
- tex_coord_rect,
- y_plane_resource_id,
- u_plane_resource_id,
- v_plane_resource_id,
- a_plane_resource_id,
- color_space);
+ CREATE_QUAD_9_NEW(YUVVideoDrawQuad, opaque_rect, visible_rect, tex_coord_rect,
+ tex_size, y_plane_resource_id, u_plane_resource_id,
+ v_plane_resource_id, a_plane_resource_id, color_space);
EXPECT_EQ(DrawQuad::YUV_VIDEO_CONTENT, copy_quad->material);
EXPECT_EQ(opaque_rect, copy_quad->opaque_rect);
EXPECT_EQ(visible_rect, copy_quad->visible_rect);
EXPECT_EQ(tex_coord_rect, copy_quad->tex_coord_rect);
+ EXPECT_EQ(tex_size, copy_quad->tex_size);
EXPECT_EQ(y_plane_resource_id, copy_quad->y_plane_resource_id);
EXPECT_EQ(u_plane_resource_id, copy_quad->u_plane_resource_id);
EXPECT_EQ(v_plane_resource_id, copy_quad->v_plane_resource_id);
EXPECT_EQ(a_plane_resource_id, copy_quad->a_plane_resource_id);
EXPECT_EQ(color_space, copy_quad->color_space);
- CREATE_QUAD_6_ALL(YUVVideoDrawQuad,
- tex_coord_rect,
- y_plane_resource_id,
- u_plane_resource_id,
- v_plane_resource_id,
- a_plane_resource_id,
- color_space);
+ CREATE_QUAD_7_ALL(YUVVideoDrawQuad, tex_coord_rect, tex_size,
+ y_plane_resource_id, u_plane_resource_id,
+ v_plane_resource_id, a_plane_resource_id, color_space);
EXPECT_EQ(DrawQuad::YUV_VIDEO_CONTENT, copy_quad->material);
EXPECT_EQ(tex_coord_rect, copy_quad->tex_coord_rect);
+ EXPECT_EQ(tex_size, copy_quad->tex_size);
EXPECT_EQ(y_plane_resource_id, copy_quad->y_plane_resource_id);
EXPECT_EQ(u_plane_resource_id, copy_quad->u_plane_resource_id);
EXPECT_EQ(v_plane_resource_id, copy_quad->v_plane_resource_id);
@@ -901,6 +894,7 @@ TEST_F(DrawQuadIteratorTest, YUVVideoDrawQuad) {
gfx::Rect opaque_rect(33, 47, 10, 12);
gfx::Rect visible_rect(40, 50, 30, 20);
gfx::RectF tex_coord_rect(0.0f, 0.0f, 0.75f, 0.5f);
+ gfx::Size tex_size(32, 68);
ResourceProvider::ResourceId y_plane_resource_id = 45;
ResourceProvider::ResourceId u_plane_resource_id = 532;
ResourceProvider::ResourceId v_plane_resource_id = 4;
@@ -908,15 +902,9 @@ TEST_F(DrawQuadIteratorTest, YUVVideoDrawQuad) {
YUVVideoDrawQuad::ColorSpace color_space = YUVVideoDrawQuad::REC_601_JPEG;
CREATE_SHARED_STATE();
- CREATE_QUAD_8_NEW(YUVVideoDrawQuad,
- opaque_rect,
- visible_rect,
- tex_coord_rect,
- y_plane_resource_id,
- u_plane_resource_id,
- v_plane_resource_id,
- a_plane_resource_id,
- color_space);
+ CREATE_QUAD_9_NEW(YUVVideoDrawQuad, opaque_rect, visible_rect, tex_coord_rect,
+ tex_size, y_plane_resource_id, u_plane_resource_id,
+ v_plane_resource_id, a_plane_resource_id, color_space);
EXPECT_EQ(DrawQuad::YUV_VIDEO_CONTENT, copy_quad->material);
EXPECT_EQ(y_plane_resource_id, quad_new->y_plane_resource_id);
EXPECT_EQ(u_plane_resource_id, quad_new->u_plane_resource_id);
« no previous file with comments | « cc/output/shader.cc ('k') | cc/quads/yuv_video_draw_quad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698