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

Unified Diff: cc/trees/layer_tree_host_unittest_context.cc

Issue 14199002: Send hardware video frames with mailboxes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ifdefed Created 7 years, 8 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
Index: cc/trees/layer_tree_host_unittest_context.cc
diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc
index abde0a85a4b874d7d2b6ff4a876efb3d2ae9e5ef..f5d742beae9cea5f33d6228198b24588781bacd2 100644
--- a/cc/trees/layer_tree_host_unittest_context.cc
+++ b/cc/trees/layer_tree_host_unittest_context.cc
@@ -1020,21 +1020,40 @@ class LayerTreeHostContextTestDontUseLostResources
delegated_impl->SetFrameDataForRenderPasses(&pass_list);
EXPECT_TRUE(pass_list.empty());
+#ifdef VIDEO_FRAME_MAILBOX
+ gpu::Mailbox mailbox;
+ resource_provider->GraphicsContext3D()->genMailboxCHROMIUM(mailbox.name);
+ unsigned sync_point =
+ resource_provider->GraphicsContext3D()->insertSyncPoint();
+#endif
+
color_video_frame_ = VideoFrame::CreateColorFrame(
gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta());
hw_video_frame_ = VideoFrame::WrapNativeTexture(
+#ifdef VIDEO_FRAME_MAILBOX
+ mailbox,
+ sync_point,
+#else
resource_provider->GraphicsContext3D()->createTexture(),
+#endif
GL_TEXTURE_2D,
gfx::Size(4, 4), gfx::Rect(0, 0, 4, 4), gfx::Size(4, 4),
base::TimeDelta(),
VideoFrame::ReadPixelsCB(),
+ VideoFrame::TextureNoLongerNeededCallback(),
base::Closure());
scaled_hw_video_frame_ = VideoFrame::WrapNativeTexture(
+#ifdef VIDEO_FRAME_MAILBOX
+ mailbox,
+ sync_point,
+#else
resource_provider->GraphicsContext3D()->createTexture(),
+#endif
GL_TEXTURE_2D,
gfx::Size(4, 4), gfx::Rect(0, 0, 3, 2), gfx::Size(4, 4),
base::TimeDelta(),
VideoFrame::ReadPixelsCB(),
+ VideoFrame::TextureNoLongerNeededCallback(),
base::Closure());
color_frame_provider_.set_frame(color_video_frame_);

Powered by Google App Engine
This is Rietveld 408576698