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

Unified Diff: cc/layers/video_layer_impl_unittest.cc

Issue 1125303005: cc: VideoLayerImpl VideoFrame::TEXTURE_YUV_420 support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« cc/layers/video_layer_impl.cc ('K') | « cc/layers/video_layer_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/video_layer_impl_unittest.cc
diff --git a/cc/layers/video_layer_impl_unittest.cc b/cc/layers/video_layer_impl_unittest.cc
index 57ad33a5840e2137cf3f7987776ff44b495735d1..6155a8d6357d91ffd6ad8439c0cc02f8e75d985e 100644
--- a/cc/layers/video_layer_impl_unittest.cc
+++ b/cc/layers/video_layer_impl_unittest.cc
@@ -245,5 +245,39 @@ TEST(VideoLayerImplTest, Rotated270) {
EXPECT_EQ(gfx::Point3F(0, 0, 0), p2);
}
+void EmptyCallback(unsigned sync_point) {
+}
+TEST(VideoLayerImplTest, NativeYUVFrameGeneratesYUVQuad) {
+ gfx::Size layer_size(1000, 1000);
+ gfx::Size viewport_size(1000, 1000);
+
+ LayerTestCommon::LayerImplTest impl;
+ DebugSetImplThreadAndMainThreadBlocked(impl.proxy());
+
+ gpu::MailboxHolder mailbox_holder;
+ mailbox_holder.mailbox.name[0] = 1;
+
+ scoped_refptr<media::VideoFrame> video_frame =
+ media::VideoFrame::WrapYUV420NativeTextures(
+ mailbox_holder, mailbox_holder, mailbox_holder,
+ base::Bind(EmptyCallback), gfx::Size(10, 10), gfx::Rect(10, 10),
+ gfx::Size(10, 10), base::TimeDelta(), true);
+ FakeVideoFrameProvider provider;
+ provider.set_frame(video_frame);
+
+ VideoLayerImpl* video_layer_impl =
+ impl.AddChildToRoot<VideoLayerImpl>(&provider, media::VIDEO_ROTATION_0);
+ video_layer_impl->SetBounds(layer_size);
+ video_layer_impl->SetContentBounds(layer_size);
+ video_layer_impl->SetDrawsContent(true);
+
+ gfx::Rect occluded;
+ impl.AppendQuadsWithOcclusion(video_layer_impl, occluded);
+
+ EXPECT_EQ(1u, impl.quad_list().size());
+ const DrawQuad* draw_quad = impl.quad_list().ElementAt(0);
+ EXPECT_EQ(DrawQuad::YUV_VIDEO_CONTENT, draw_quad->material);
+}
hendrikw 2015/05/14 22:11:19 Should we also check that uv*2==ya here?
Daniele Castagna 2015/05/14 22:23:03 Sure, we have to downcast though, are you ok with
+
} // namespace
} // namespace cc
« cc/layers/video_layer_impl.cc ('K') | « cc/layers/video_layer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698