Index: cc/quads/draw_quad_unittest.cc |
diff --git a/cc/quads/draw_quad_unittest.cc b/cc/quads/draw_quad_unittest.cc |
index e91fb0737145e6aa43ecca90a4c4f7abd7573b61..9fdf48588f9d031c78f3b60afc66876b7dd9a689 100644 |
--- a/cc/quads/draw_quad_unittest.cc |
+++ b/cc/quads/draw_quad_unittest.cc |
@@ -22,6 +22,7 @@ |
#include "cc/quads/surface_draw_quad.h" |
#include "cc/quads/texture_draw_quad.h" |
#include "cc/quads/tile_draw_quad.h" |
+#include "cc/quads/y_video_draw_quad.h" |
#include "cc/quads/yuv_video_draw_quad.h" |
#include "cc/test/fake_raster_source.h" |
#include "cc/test/geometry_test_utils.h" |
@@ -685,6 +686,30 @@ TEST(DrawQuadTest, CopyYUVVideoDrawQuad) { |
EXPECT_EQ(bits_per_channel, copy_quad->bits_per_channel); |
} |
+TEST(DrawQuadTest, CopyYVideoDrawQuad) { |
+ gfx::Rect opaque_rect(33, 47, 10, 12); |
+ gfx::Rect visible_rect(40, 50, 30, 20); |
+ unsigned resource_id = 82; |
+ gfx::PointF uv_top_left(0.5f, 224.f); |
+ gfx::PointF uv_bottom_right(51.5f, 260.f); |
+ CREATE_SHARED_STATE(); |
+ |
+ CREATE_QUAD_5_NEW(YVideoDrawQuad, opaque_rect, visible_rect, resource_id, |
+ uv_top_left, uv_bottom_right); |
+ EXPECT_EQ(DrawQuad::Y_VIDEO_CONTENT, copy_quad->material); |
+ EXPECT_EQ(visible_rect, copy_quad->visible_rect); |
+ EXPECT_EQ(opaque_rect, copy_quad->opaque_rect); |
+ EXPECT_EQ(resource_id, copy_quad->resource_id()); |
+ EXPECT_EQ(uv_top_left, copy_quad->uv_top_left); |
+ EXPECT_EQ(uv_bottom_right, copy_quad->uv_bottom_right); |
+ |
+ CREATE_QUAD_3_ALL(YVideoDrawQuad, resource_id, uv_top_left, uv_bottom_right); |
+ EXPECT_EQ(DrawQuad::Y_VIDEO_CONTENT, copy_quad->material); |
+ EXPECT_EQ(resource_id, copy_quad->resource_id()); |
+ EXPECT_EQ(uv_top_left, copy_quad->uv_top_left); |
+ EXPECT_EQ(uv_bottom_right, copy_quad->uv_bottom_right); |
+} |
+ |
TEST(DrawQuadTest, CopyPictureDrawQuad) { |
gfx::Rect opaque_rect(33, 44, 22, 33); |
gfx::Rect visible_rect(40, 50, 30, 20); |
@@ -898,6 +923,21 @@ TEST_F(DrawQuadIteratorTest, YUVVideoDrawQuad) { |
EXPECT_EQ(a_plane_resource_id + 1, quad_new->a_plane_resource_id()); |
} |
+TEST_F(DrawQuadIteratorTest, YVideoDrawQuad) { |
+ gfx::Rect opaque_rect(33, 47, 10, 12); |
+ gfx::Rect visible_rect(40, 50, 30, 20); |
+ unsigned resource_id = 82; |
+ gfx::PointF uv_top_left(0.5f, 224.f); |
+ gfx::PointF uv_bottom_right(51.5f, 260.f); |
+ |
+ CREATE_SHARED_STATE(); |
+ CREATE_QUAD_5_NEW(YVideoDrawQuad, opaque_rect, visible_rect, resource_id, |
+ uv_top_left, uv_bottom_right); |
+ EXPECT_EQ(resource_id, quad_new->resource_id()); |
+ EXPECT_EQ(1, IterateAndCount(quad_new)); |
+ EXPECT_EQ(resource_id + 1, quad_new->resource_id()); |
+} |
+ |
// Disabled until picture draw quad is supported for ubercomp: crbug.com/231715 |
TEST_F(DrawQuadIteratorTest, DISABLED_PictureDrawQuad) { |
gfx::Rect opaque_rect(33, 44, 22, 33); |
@@ -947,6 +987,9 @@ TEST(DrawQuadTest, LargestQuadType) { |
case DrawQuad::STREAM_VIDEO_CONTENT: |
largest = std::max(largest, sizeof(StreamVideoDrawQuad)); |
break; |
+ case DrawQuad::Y_VIDEO_CONTENT: |
+ largest = std::max(largest, sizeof(YVideoDrawQuad)); |
+ break; |
case DrawQuad::YUV_VIDEO_CONTENT: |
largest = std::max(largest, sizeof(YUVVideoDrawQuad)); |
break; |
@@ -988,6 +1031,9 @@ TEST(DrawQuadTest, LargestQuadType) { |
case DrawQuad::STREAM_VIDEO_CONTENT: |
LOG(ERROR) << "StreamVideoDrawQuad " << sizeof(StreamVideoDrawQuad); |
break; |
+ case DrawQuad::Y_VIDEO_CONTENT: |
+ LOG(ERROR) << "YVideoDrawQuad " << sizeof(YVideoDrawQuad); |
+ break; |
case DrawQuad::YUV_VIDEO_CONTENT: |
LOG(ERROR) << "YUVVideoDrawQuad " << sizeof(YUVVideoDrawQuad); |
break; |