OLD | NEW |
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 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 make_scoped_ptr( | 1079 make_scoped_ptr( |
1080 new gpu::MailboxHolder(mailbox, GL_TEXTURE_2D, sync_point)), | 1080 new gpu::MailboxHolder(mailbox, GL_TEXTURE_2D, sync_point)), |
1081 media::VideoFrame::ReleaseMailboxCB(), gfx::Size(4, 4), | 1081 media::VideoFrame::ReleaseMailboxCB(), gfx::Size(4, 4), |
1082 gfx::Rect(0, 0, 4, 4), gfx::Size(4, 4), base::TimeDelta(), false); | 1082 gfx::Rect(0, 0, 4, 4), gfx::Size(4, 4), base::TimeDelta(), |
| 1083 false /* allow_overlay */, true /* has_alpha */); |
1083 scaled_hw_video_frame_ = VideoFrame::WrapNativeTexture( | 1084 scaled_hw_video_frame_ = VideoFrame::WrapNativeTexture( |
1084 make_scoped_ptr( | 1085 make_scoped_ptr( |
1085 new gpu::MailboxHolder(mailbox, GL_TEXTURE_2D, sync_point)), | 1086 new gpu::MailboxHolder(mailbox, GL_TEXTURE_2D, sync_point)), |
1086 media::VideoFrame::ReleaseMailboxCB(), gfx::Size(4, 4), | 1087 media::VideoFrame::ReleaseMailboxCB(), gfx::Size(4, 4), |
1087 gfx::Rect(0, 0, 3, 2), gfx::Size(4, 4), base::TimeDelta(), false); | 1088 gfx::Rect(0, 0, 3, 2), gfx::Size(4, 4), base::TimeDelta(), |
| 1089 false /* allow_overlay */, true /* has_alpha */); |
1088 | 1090 |
1089 color_frame_provider_.set_frame(color_video_frame_); | 1091 color_frame_provider_.set_frame(color_video_frame_); |
1090 hw_frame_provider_.set_frame(hw_video_frame_); | 1092 hw_frame_provider_.set_frame(hw_video_frame_); |
1091 scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_); | 1093 scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_); |
1092 | 1094 |
1093 if (!delegating_renderer()) { | 1095 if (!delegating_renderer()) { |
1094 // TODO(danakj): IOSurface layer can not be transported. crbug.com/239335 | 1096 // TODO(danakj): IOSurface layer can not be transported. crbug.com/239335 |
1095 scoped_refptr<IOSurfaceLayer> io_surface = IOSurfaceLayer::Create(); | 1097 scoped_refptr<IOSurfaceLayer> io_surface = IOSurfaceLayer::Create(); |
1096 io_surface->SetBounds(gfx::Size(10, 10)); | 1098 io_surface->SetBounds(gfx::Size(10, 10)); |
1097 io_surface->SetIsDrawable(true); | 1099 io_surface->SetIsDrawable(true); |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1792 void AfterTest() override {} | 1794 void AfterTest() override {} |
1793 | 1795 |
1794 bool deferred_; | 1796 bool deferred_; |
1795 }; | 1797 }; |
1796 | 1798 |
1797 SINGLE_AND_MULTI_THREAD_TEST_F( | 1799 SINGLE_AND_MULTI_THREAD_TEST_F( |
1798 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame); | 1800 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame); |
1799 | 1801 |
1800 } // namespace | 1802 } // namespace |
1801 } // namespace cc | 1803 } // namespace cc |
OLD | NEW |