| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "cc/layers/delegated_frame_provider.h" | 10 #include "cc/layers/delegated_frame_provider.h" |
| (...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 root->AddChild(video_hw); | 1015 root->AddChild(video_hw); |
| 1016 | 1016 |
| 1017 scoped_refptr<VideoLayer> video_scaled_hw = VideoLayer::Create( | 1017 scoped_refptr<VideoLayer> video_scaled_hw = VideoLayer::Create( |
| 1018 layer_settings_, &scaled_hw_frame_provider_, media::VIDEO_ROTATION_0); | 1018 layer_settings_, &scaled_hw_frame_provider_, media::VIDEO_ROTATION_0); |
| 1019 video_scaled_hw->SetBounds(gfx::Size(10, 10)); | 1019 video_scaled_hw->SetBounds(gfx::Size(10, 10)); |
| 1020 video_scaled_hw->SetIsDrawable(true); | 1020 video_scaled_hw->SetIsDrawable(true); |
| 1021 root->AddChild(video_scaled_hw); | 1021 root->AddChild(video_scaled_hw); |
| 1022 | 1022 |
| 1023 color_video_frame_ = VideoFrame::CreateColorFrame( | 1023 color_video_frame_ = VideoFrame::CreateColorFrame( |
| 1024 gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta()); | 1024 gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta()); |
| 1025 ASSERT_TRUE(color_video_frame_); |
| 1025 hw_video_frame_ = VideoFrame::WrapNativeTexture( | 1026 hw_video_frame_ = VideoFrame::WrapNativeTexture( |
| 1026 media::PIXEL_FORMAT_ARGB, | 1027 media::PIXEL_FORMAT_ARGB, |
| 1027 gpu::MailboxHolder(mailbox, sync_token, GL_TEXTURE_2D), | 1028 gpu::MailboxHolder(mailbox, sync_token, GL_TEXTURE_2D), |
| 1028 media::VideoFrame::ReleaseMailboxCB(), gfx::Size(4, 4), | 1029 media::VideoFrame::ReleaseMailboxCB(), gfx::Size(4, 4), |
| 1029 gfx::Rect(0, 0, 4, 4), gfx::Size(4, 4), base::TimeDelta()); | 1030 gfx::Rect(0, 0, 4, 4), gfx::Size(4, 4), base::TimeDelta()); |
| 1031 ASSERT_TRUE(hw_video_frame_); |
| 1030 scaled_hw_video_frame_ = VideoFrame::WrapNativeTexture( | 1032 scaled_hw_video_frame_ = VideoFrame::WrapNativeTexture( |
| 1031 media::PIXEL_FORMAT_ARGB, | 1033 media::PIXEL_FORMAT_ARGB, |
| 1032 gpu::MailboxHolder(mailbox, sync_token, GL_TEXTURE_2D), | 1034 gpu::MailboxHolder(mailbox, sync_token, GL_TEXTURE_2D), |
| 1033 media::VideoFrame::ReleaseMailboxCB(), gfx::Size(4, 4), | 1035 media::VideoFrame::ReleaseMailboxCB(), gfx::Size(4, 4), |
| 1034 gfx::Rect(0, 0, 3, 2), gfx::Size(4, 4), base::TimeDelta()); | 1036 gfx::Rect(0, 0, 3, 2), gfx::Size(4, 4), base::TimeDelta()); |
| 1037 ASSERT_TRUE(scaled_hw_video_frame_); |
| 1035 | 1038 |
| 1036 color_frame_provider_.set_frame(color_video_frame_); | 1039 color_frame_provider_.set_frame(color_video_frame_); |
| 1037 hw_frame_provider_.set_frame(hw_video_frame_); | 1040 hw_frame_provider_.set_frame(hw_video_frame_); |
| 1038 scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_); | 1041 scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_); |
| 1039 | 1042 |
| 1040 scoped_refptr<IOSurfaceLayer> io_surface = | 1043 scoped_refptr<IOSurfaceLayer> io_surface = |
| 1041 IOSurfaceLayer::Create(layer_settings_); | 1044 IOSurfaceLayer::Create(layer_settings_); |
| 1042 io_surface->SetBounds(gfx::Size(10, 10)); | 1045 io_surface->SetBounds(gfx::Size(10, 10)); |
| 1043 io_surface->SetIsDrawable(true); | 1046 io_surface->SetIsDrawable(true); |
| 1044 io_surface->SetIOSurfaceProperties(1, gfx::Size(10, 10)); | 1047 io_surface->SetIOSurfaceProperties(1, gfx::Size(10, 10)); |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1634 void AfterTest() override {} | 1637 void AfterTest() override {} |
| 1635 | 1638 |
| 1636 bool deferred_; | 1639 bool deferred_; |
| 1637 }; | 1640 }; |
| 1638 | 1641 |
| 1639 SINGLE_AND_MULTI_THREAD_TEST_F( | 1642 SINGLE_AND_MULTI_THREAD_TEST_F( |
| 1640 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame); | 1643 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame); |
| 1641 | 1644 |
| 1642 } // namespace | 1645 } // namespace |
| 1643 } // namespace cc | 1646 } // namespace cc |
| OLD | NEW |