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

Side by Side Diff: cc/trees/layer_tree_host_unittest_context.cc

Issue 1960563002: Add media::VideoFrame::WrapNativeTextures() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "cc/layers/heads_up_display_layer.h" 9 #include "cc/layers/heads_up_display_layer.h"
10 #include "cc/layers/layer_impl.h" 10 #include "cc/layers/layer_impl.h"
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 997
998 scoped_refptr<VideoLayer> video_scaled_hw = 998 scoped_refptr<VideoLayer> video_scaled_hw =
999 VideoLayer::Create(&scaled_hw_frame_provider_, media::VIDEO_ROTATION_0); 999 VideoLayer::Create(&scaled_hw_frame_provider_, media::VIDEO_ROTATION_0);
1000 video_scaled_hw->SetBounds(gfx::Size(10, 10)); 1000 video_scaled_hw->SetBounds(gfx::Size(10, 10));
1001 video_scaled_hw->SetIsDrawable(true); 1001 video_scaled_hw->SetIsDrawable(true);
1002 root->AddChild(video_scaled_hw); 1002 root->AddChild(video_scaled_hw);
1003 1003
1004 color_video_frame_ = VideoFrame::CreateColorFrame( 1004 color_video_frame_ = VideoFrame::CreateColorFrame(
1005 gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta()); 1005 gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta());
1006 ASSERT_TRUE(color_video_frame_); 1006 ASSERT_TRUE(color_video_frame_);
1007 hw_video_frame_ = VideoFrame::WrapNativeTexture( 1007 gpu::MailboxHolder holders[media::VideoFrame::kMaxPlanes] = {
1008 media::PIXEL_FORMAT_ARGB, 1008 gpu::MailboxHolder(mailbox, sync_token, GL_TEXTURE_2D)};
1009 gpu::MailboxHolder(mailbox, sync_token, GL_TEXTURE_2D), 1009 hw_video_frame_ = VideoFrame::WrapNativeTextures(
1010 media::PIXEL_FORMAT_ARGB, holders,
1010 media::VideoFrame::ReleaseMailboxCB(), gfx::Size(4, 4), 1011 media::VideoFrame::ReleaseMailboxCB(), gfx::Size(4, 4),
1011 gfx::Rect(0, 0, 4, 4), gfx::Size(4, 4), base::TimeDelta()); 1012 gfx::Rect(0, 0, 4, 4), gfx::Size(4, 4), base::TimeDelta());
1012 ASSERT_TRUE(hw_video_frame_); 1013 ASSERT_TRUE(hw_video_frame_);
1013 scaled_hw_video_frame_ = VideoFrame::WrapNativeTexture( 1014 scaled_hw_video_frame_ = VideoFrame::WrapNativeTextures(
1014 media::PIXEL_FORMAT_ARGB, 1015 media::PIXEL_FORMAT_ARGB, holders,
1015 gpu::MailboxHolder(mailbox, sync_token, GL_TEXTURE_2D),
1016 media::VideoFrame::ReleaseMailboxCB(), gfx::Size(4, 4), 1016 media::VideoFrame::ReleaseMailboxCB(), gfx::Size(4, 4),
1017 gfx::Rect(0, 0, 3, 2), gfx::Size(4, 4), base::TimeDelta()); 1017 gfx::Rect(0, 0, 3, 2), gfx::Size(4, 4), base::TimeDelta());
1018 ASSERT_TRUE(scaled_hw_video_frame_); 1018 ASSERT_TRUE(scaled_hw_video_frame_);
1019 1019
1020 color_frame_provider_.set_frame(color_video_frame_); 1020 color_frame_provider_.set_frame(color_video_frame_);
1021 hw_frame_provider_.set_frame(hw_video_frame_); 1021 hw_frame_provider_.set_frame(hw_video_frame_);
1022 scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_); 1022 scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_);
1023 1023
1024 // Enable the hud. 1024 // Enable the hud.
1025 LayerTreeDebugState debug_state; 1025 LayerTreeDebugState debug_state;
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
1603 void AfterTest() override {} 1603 void AfterTest() override {}
1604 1604
1605 bool deferred_; 1605 bool deferred_;
1606 }; 1606 };
1607 1607
1608 SINGLE_AND_MULTI_THREAD_TEST_F( 1608 SINGLE_AND_MULTI_THREAD_TEST_F(
1609 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame); 1609 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame);
1610 1610
1611 } // namespace 1611 } // namespace
1612 } // namespace cc 1612 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/video_resource_updater_unittest.cc ('k') | chromecast/renderer/media/hole_frame_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698