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 "cc/layers/render_surface_impl.h" | 7 #include "cc/layers/render_surface_impl.h" |
8 #include "cc/layers/video_layer.h" | 8 #include "cc/layers/video_layer.h" |
9 #include "cc/layers/video_layer_impl.h" | 9 #include "cc/layers/video_layer_impl.h" |
10 #include "cc/test/fake_video_frame_provider.h" | 10 #include "cc/test/fake_video_frame_provider.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 root->SetIsDrawable(true); | 27 root->SetIsDrawable(true); |
28 | 28 |
29 scoped_refptr<VideoLayer> video = | 29 scoped_refptr<VideoLayer> video = |
30 VideoLayer::Create(&video_frame_provider_, media::VIDEO_ROTATION_90); | 30 VideoLayer::Create(&video_frame_provider_, media::VIDEO_ROTATION_90); |
31 video->SetPosition(gfx::PointF(3.f, 3.f)); | 31 video->SetPosition(gfx::PointF(3.f, 3.f)); |
32 video->SetBounds(gfx::Size(4, 5)); | 32 video->SetBounds(gfx::Size(4, 5)); |
33 video->SetIsDrawable(true); | 33 video->SetIsDrawable(true); |
34 root->AddChild(video); | 34 root->AddChild(video); |
35 video_layer_id_ = video->id(); | 35 video_layer_id_ = video->id(); |
36 | 36 |
37 layer_tree_host()->SetRootLayer(root); | 37 layer_tree()->SetRootLayer(root); |
38 layer_tree_host()->SetDeviceScaleFactor(2.f); | 38 layer_tree()->SetDeviceScaleFactor(2.f); |
39 LayerTreeHostVideoTest::SetupTree(); | 39 LayerTreeHostVideoTest::SetupTree(); |
40 } | 40 } |
41 | 41 |
42 void BeginTest() override { | 42 void BeginTest() override { |
43 num_draws_ = 0; | 43 num_draws_ = 0; |
44 PostSetNeedsCommitToMainThread(); | 44 PostSetNeedsCommitToMainThread(); |
45 } | 45 } |
46 | 46 |
47 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, | 47 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, |
48 LayerTreeHostImpl::FrameData* frame, | 48 LayerTreeHostImpl::FrameData* frame, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 int num_draws_; | 86 int num_draws_; |
87 int video_layer_id_; | 87 int video_layer_id_; |
88 | 88 |
89 FakeVideoFrameProvider video_frame_provider_; | 89 FakeVideoFrameProvider video_frame_provider_; |
90 }; | 90 }; |
91 | 91 |
92 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostVideoTestSetNeedsDisplay); | 92 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostVideoTestSetNeedsDisplay); |
93 | 93 |
94 } // namespace | 94 } // namespace |
95 } // namespace cc | 95 } // namespace cc |
OLD | NEW |