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

Unified Diff: cc/quads/draw_quad_unittest.cc

Issue 2121043002: 16 bpp video stream capture, render and WebGL usage - Realsense R200 & SR300 support. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 2 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/quads/draw_quad.h ('k') | cc/quads/render_pass.cc » ('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 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;
« no previous file with comments | « cc/quads/draw_quad.h ('k') | cc/quads/render_pass.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698