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

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

Issue 1134643002: Add distinction between RGB and RGBA native texture video frames and resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit test breakage from bad merge 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 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 "cc/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "cc/layers/content_layer.h" 8 #include "cc/layers/content_layer.h"
9 #include "cc/layers/delegated_frame_provider.h" 9 #include "cc/layers/delegated_frame_provider.h"
10 #include "cc/layers/delegated_frame_resource_collection.h" 10 #include "cc/layers/delegated_frame_resource_collection.h"
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 VideoLayer::Create(&scaled_hw_frame_provider_, media::VIDEO_ROTATION_0); 1071 VideoLayer::Create(&scaled_hw_frame_provider_, media::VIDEO_ROTATION_0);
1072 video_scaled_hw->SetBounds(gfx::Size(10, 10)); 1072 video_scaled_hw->SetBounds(gfx::Size(10, 10));
1073 video_scaled_hw->SetIsDrawable(true); 1073 video_scaled_hw->SetIsDrawable(true);
1074 root->AddChild(video_scaled_hw); 1074 root->AddChild(video_scaled_hw);
1075 1075
1076 color_video_frame_ = VideoFrame::CreateColorFrame( 1076 color_video_frame_ = VideoFrame::CreateColorFrame(
1077 gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta()); 1077 gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta());
1078 hw_video_frame_ = VideoFrame::WrapNativeTexture( 1078 hw_video_frame_ = VideoFrame::WrapNativeTexture(
1079 gpu::MailboxHolder(mailbox, GL_TEXTURE_2D, sync_point), 1079 gpu::MailboxHolder(mailbox, GL_TEXTURE_2D, sync_point),
1080 media::VideoFrame::ReleaseMailboxCB(), gfx::Size(4, 4), 1080 media::VideoFrame::ReleaseMailboxCB(), gfx::Size(4, 4),
1081 gfx::Rect(0, 0, 4, 4), gfx::Size(4, 4), base::TimeDelta(), false); 1081 gfx::Rect(0, 0, 4, 4), gfx::Size(4, 4), base::TimeDelta(),
1082 false /* allow_overlay */, true /* has_alpha */);
1082 scaled_hw_video_frame_ = VideoFrame::WrapNativeTexture( 1083 scaled_hw_video_frame_ = VideoFrame::WrapNativeTexture(
1083 gpu::MailboxHolder(mailbox, GL_TEXTURE_2D, sync_point), 1084 gpu::MailboxHolder(mailbox, GL_TEXTURE_2D, sync_point),
1084 media::VideoFrame::ReleaseMailboxCB(), gfx::Size(4, 4), 1085 media::VideoFrame::ReleaseMailboxCB(), gfx::Size(4, 4),
1085 gfx::Rect(0, 0, 3, 2), gfx::Size(4, 4), base::TimeDelta(), false); 1086 gfx::Rect(0, 0, 3, 2), gfx::Size(4, 4), base::TimeDelta(),
1087 false /* allow_overlay */, true /* has_alpha */);
1086 1088
1087 color_frame_provider_.set_frame(color_video_frame_); 1089 color_frame_provider_.set_frame(color_video_frame_);
1088 hw_frame_provider_.set_frame(hw_video_frame_); 1090 hw_frame_provider_.set_frame(hw_video_frame_);
1089 scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_); 1091 scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_);
1090 1092
1091 if (!delegating_renderer()) { 1093 if (!delegating_renderer()) {
1092 // TODO(danakj): IOSurface layer can not be transported. crbug.com/239335 1094 // TODO(danakj): IOSurface layer can not be transported. crbug.com/239335
1093 scoped_refptr<IOSurfaceLayer> io_surface = IOSurfaceLayer::Create(); 1095 scoped_refptr<IOSurfaceLayer> io_surface = IOSurfaceLayer::Create();
1094 io_surface->SetBounds(gfx::Size(10, 10)); 1096 io_surface->SetBounds(gfx::Size(10, 10));
1095 io_surface->SetIsDrawable(true); 1097 io_surface->SetIsDrawable(true);
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
1790 void AfterTest() override {} 1792 void AfterTest() override {}
1791 1793
1792 bool deferred_; 1794 bool deferred_;
1793 }; 1795 };
1794 1796
1795 SINGLE_AND_MULTI_THREAD_TEST_F( 1797 SINGLE_AND_MULTI_THREAD_TEST_F(
1796 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame); 1798 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame);
1797 1799
1798 } // namespace 1800 } // namespace
1799 } // namespace cc 1801 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/video_resource_updater_unittest.cc ('k') | content/browser/media/capture/aura_window_capture_machine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698