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/heads_up_display_layer.h" | 9 #include "cc/layers/heads_up_display_layer.h" |
10 #include "cc/layers/io_surface_layer.h" | 10 #include "cc/layers/io_surface_layer.h" |
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 pass_list.push_back(pass_for_quad.PassAs<RenderPass>()); | 1013 pass_list.push_back(pass_for_quad.PassAs<RenderPass>()); |
1014 pass_list.push_back(pass.PassAs<RenderPass>()); | 1014 pass_list.push_back(pass.PassAs<RenderPass>()); |
1015 | 1015 |
1016 // First child is the delegated layer. | 1016 // First child is the delegated layer. |
1017 FakeDelegatedRendererLayerImpl* delegated_impl = | 1017 FakeDelegatedRendererLayerImpl* delegated_impl = |
1018 static_cast<FakeDelegatedRendererLayerImpl*>( | 1018 static_cast<FakeDelegatedRendererLayerImpl*>( |
1019 host_impl->active_tree()->root_layer()->children()[0]); | 1019 host_impl->active_tree()->root_layer()->children()[0]); |
1020 delegated_impl->SetFrameDataForRenderPasses(&pass_list); | 1020 delegated_impl->SetFrameDataForRenderPasses(&pass_list); |
1021 EXPECT_TRUE(pass_list.empty()); | 1021 EXPECT_TRUE(pass_list.empty()); |
1022 | 1022 |
| 1023 #ifdef VIDEO_FRAME_MAILBOX |
| 1024 gpu::Mailbox mailbox; |
| 1025 resource_provider->GraphicsContext3D()->genMailboxCHROMIUM(mailbox.name); |
| 1026 unsigned sync_point = |
| 1027 resource_provider->GraphicsContext3D()->insertSyncPoint(); |
| 1028 #endif |
| 1029 |
1023 color_video_frame_ = VideoFrame::CreateColorFrame( | 1030 color_video_frame_ = VideoFrame::CreateColorFrame( |
1024 gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta()); | 1031 gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta()); |
1025 hw_video_frame_ = VideoFrame::WrapNativeTexture( | 1032 hw_video_frame_ = VideoFrame::WrapNativeTexture( |
| 1033 #ifdef VIDEO_FRAME_MAILBOX |
| 1034 mailbox, |
| 1035 sync_point, |
| 1036 #else |
1026 resource_provider->GraphicsContext3D()->createTexture(), | 1037 resource_provider->GraphicsContext3D()->createTexture(), |
| 1038 #endif |
1027 GL_TEXTURE_2D, | 1039 GL_TEXTURE_2D, |
1028 gfx::Size(4, 4), gfx::Rect(0, 0, 4, 4), gfx::Size(4, 4), | 1040 gfx::Size(4, 4), gfx::Rect(0, 0, 4, 4), gfx::Size(4, 4), |
1029 base::TimeDelta(), | 1041 base::TimeDelta(), |
1030 VideoFrame::ReadPixelsCB(), | 1042 VideoFrame::ReadPixelsCB(), |
| 1043 VideoFrame::TextureNoLongerNeededCallback(), |
1031 base::Closure()); | 1044 base::Closure()); |
1032 scaled_hw_video_frame_ = VideoFrame::WrapNativeTexture( | 1045 scaled_hw_video_frame_ = VideoFrame::WrapNativeTexture( |
| 1046 #ifdef VIDEO_FRAME_MAILBOX |
| 1047 mailbox, |
| 1048 sync_point, |
| 1049 #else |
1033 resource_provider->GraphicsContext3D()->createTexture(), | 1050 resource_provider->GraphicsContext3D()->createTexture(), |
| 1051 #endif |
1034 GL_TEXTURE_2D, | 1052 GL_TEXTURE_2D, |
1035 gfx::Size(4, 4), gfx::Rect(0, 0, 3, 2), gfx::Size(4, 4), | 1053 gfx::Size(4, 4), gfx::Rect(0, 0, 3, 2), gfx::Size(4, 4), |
1036 base::TimeDelta(), | 1054 base::TimeDelta(), |
1037 VideoFrame::ReadPixelsCB(), | 1055 VideoFrame::ReadPixelsCB(), |
| 1056 VideoFrame::TextureNoLongerNeededCallback(), |
1038 base::Closure()); | 1057 base::Closure()); |
1039 | 1058 |
1040 color_frame_provider_.set_frame(color_video_frame_); | 1059 color_frame_provider_.set_frame(color_video_frame_); |
1041 hw_frame_provider_.set_frame(hw_video_frame_); | 1060 hw_frame_provider_.set_frame(hw_video_frame_); |
1042 scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_); | 1061 scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_); |
1043 return; | 1062 return; |
1044 } | 1063 } |
1045 | 1064 |
1046 if (host_impl->active_tree()->source_frame_number() == 3) { | 1065 if (host_impl->active_tree()->source_frame_number() == 3) { |
1047 // On the third commit we're recovering from context loss. Hardware | 1066 // On the third commit we're recovering from context loss. Hardware |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1221 | 1240 |
1222 private: | 1241 private: |
1223 int commits_; | 1242 int commits_; |
1224 scoped_refptr<FakeScrollbarLayer> scrollbar_layer_; | 1243 scoped_refptr<FakeScrollbarLayer> scrollbar_layer_; |
1225 }; | 1244 }; |
1226 | 1245 |
1227 SINGLE_AND_MULTI_THREAD_TEST_F(ScrollbarLayerLostContext); | 1246 SINGLE_AND_MULTI_THREAD_TEST_F(ScrollbarLayerLostContext); |
1228 | 1247 |
1229 } // namespace | 1248 } // namespace |
1230 } // namespace cc | 1249 } // namespace cc |
OLD | NEW |