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 |