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 gpu::Mailbox mailbox; |
| 1024 resource_provider->GraphicsContext3D()->genMailboxCHROMIUM(mailbox.name); |
| 1025 |
1023 color_video_frame_ = VideoFrame::CreateColorFrame( | 1026 color_video_frame_ = VideoFrame::CreateColorFrame( |
1024 gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta()); | 1027 gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta()); |
1025 hw_video_frame_ = VideoFrame::WrapNativeTexture( | 1028 hw_video_frame_ = VideoFrame::WrapNativeTexture( |
1026 resource_provider->GraphicsContext3D()->createTexture(), | 1029 mailbox, |
1027 GL_TEXTURE_2D, | 1030 GL_TEXTURE_2D, |
1028 gfx::Size(4, 4), gfx::Rect(0, 0, 4, 4), gfx::Size(4, 4), | 1031 gfx::Size(4, 4), gfx::Rect(0, 0, 4, 4), gfx::Size(4, 4), |
1029 base::TimeDelta(), | 1032 base::TimeDelta(), |
1030 VideoFrame::ReadPixelsCB(), | 1033 VideoFrame::ReadPixelsCB(), |
1031 base::Closure()); | 1034 base::Closure()); |
1032 scaled_hw_video_frame_ = VideoFrame::WrapNativeTexture( | 1035 scaled_hw_video_frame_ = VideoFrame::WrapNativeTexture( |
1033 resource_provider->GraphicsContext3D()->createTexture(), | 1036 mailbox, |
1034 GL_TEXTURE_2D, | 1037 GL_TEXTURE_2D, |
1035 gfx::Size(4, 4), gfx::Rect(0, 0, 3, 2), gfx::Size(4, 4), | 1038 gfx::Size(4, 4), gfx::Rect(0, 0, 3, 2), gfx::Size(4, 4), |
1036 base::TimeDelta(), | 1039 base::TimeDelta(), |
1037 VideoFrame::ReadPixelsCB(), | 1040 VideoFrame::ReadPixelsCB(), |
1038 base::Closure()); | 1041 base::Closure()); |
1039 | 1042 |
1040 color_frame_provider_.set_frame(color_video_frame_); | 1043 color_frame_provider_.set_frame(color_video_frame_); |
1041 hw_frame_provider_.set_frame(hw_video_frame_); | 1044 hw_frame_provider_.set_frame(hw_video_frame_); |
1042 scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_); | 1045 scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_); |
1043 return; | 1046 return; |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1221 | 1224 |
1222 private: | 1225 private: |
1223 int commits_; | 1226 int commits_; |
1224 scoped_refptr<FakeScrollbarLayer> scrollbar_layer_; | 1227 scoped_refptr<FakeScrollbarLayer> scrollbar_layer_; |
1225 }; | 1228 }; |
1226 | 1229 |
1227 SINGLE_AND_MULTI_THREAD_TEST_F(ScrollbarLayerLostContext); | 1230 SINGLE_AND_MULTI_THREAD_TEST_F(ScrollbarLayerLostContext); |
1228 | 1231 |
1229 } // namespace | 1232 } // namespace |
1230 } // namespace cc | 1233 } // namespace cc |
OLD | NEW |