OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/layers/video_layer_impl.h" | 5 #include "cc/layers/video_layer_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "cc/layers/video_frame_provider_client_impl.h" | 9 #include "cc/layers/video_frame_provider_client_impl.h" |
10 #include "cc/output/context_provider.h" | 10 #include "cc/output/context_provider.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 const auto& draw_properties = layer_impl->draw_properties(); | 101 const auto& draw_properties = layer_impl->draw_properties(); |
102 | 102 |
103 FakeVideoFrameProvider provider; | 103 FakeVideoFrameProvider provider; |
104 std::unique_ptr<VideoLayerImpl> video_layer_impl = VideoLayerImpl::Create( | 104 std::unique_ptr<VideoLayerImpl> video_layer_impl = VideoLayerImpl::Create( |
105 active_tree, 4, &provider, media::VIDEO_ROTATION_0); | 105 active_tree, 4, &provider, media::VIDEO_ROTATION_0); |
106 video_layer_impl->SetBounds(layer_size); | 106 video_layer_impl->SetBounds(layer_size); |
107 video_layer_impl->SetDrawsContent(true); | 107 video_layer_impl->SetDrawsContent(true); |
108 video_layer_impl->SetContentsOpaque(true); | 108 video_layer_impl->SetContentsOpaque(true); |
109 | 109 |
110 layer_impl->test_properties()->AddChild(std::move(video_layer_impl)); | 110 layer_impl->test_properties()->AddChild(std::move(video_layer_impl)); |
111 active_tree->SetRootLayer(std::move(layer_impl)); | 111 active_tree->SetRootLayerForTesting(std::move(layer_impl)); |
112 | 112 |
113 active_tree->BuildLayerListAndPropertyTreesForTesting(); | 113 active_tree->BuildLayerListAndPropertyTreesForTesting(); |
114 | 114 |
115 active_tree->UpdateDrawProperties(false); | 115 active_tree->UpdateDrawProperties(false); |
116 | 116 |
117 // We don't have a frame yet, so the video doesn't occlude the layer below it. | 117 // We don't have a frame yet, so the video doesn't occlude the layer below it. |
118 EXPECT_FALSE(draw_properties.occlusion_in_content_space.IsOccluded(visible)); | 118 EXPECT_FALSE(draw_properties.occlusion_in_content_space.IsOccluded(visible)); |
119 | 119 |
120 scoped_refptr<media::VideoFrame> video_frame = media::VideoFrame::CreateFrame( | 120 scoped_refptr<media::VideoFrame> video_frame = media::VideoFrame::CreateFrame( |
121 media::PIXEL_FORMAT_YV12, gfx::Size(10, 10), gfx::Rect(10, 10), | 121 media::PIXEL_FORMAT_YV12, gfx::Size(10, 10), gfx::Rect(10, 10), |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 const YUVVideoDrawQuad* yuv_draw_quad = | 368 const YUVVideoDrawQuad* yuv_draw_quad = |
369 static_cast<const YUVVideoDrawQuad*>(draw_quad); | 369 static_cast<const YUVVideoDrawQuad*>(draw_quad); |
370 EXPECT_EQ(yuv_draw_quad->uv_tex_size.height(), | 370 EXPECT_EQ(yuv_draw_quad->uv_tex_size.height(), |
371 (yuv_draw_quad->ya_tex_size.height() + 1) / 2); | 371 (yuv_draw_quad->ya_tex_size.height() + 1) / 2); |
372 EXPECT_EQ(yuv_draw_quad->uv_tex_size.width(), | 372 EXPECT_EQ(yuv_draw_quad->uv_tex_size.width(), |
373 (yuv_draw_quad->ya_tex_size.width() + 1) / 2); | 373 (yuv_draw_quad->ya_tex_size.width() + 1) / 2); |
374 } | 374 } |
375 | 375 |
376 } // namespace | 376 } // namespace |
377 } // namespace cc | 377 } // namespace cc |
OLD | NEW |