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/render_surface_impl.h" | 8 #include "cc/layers/render_surface_impl.h" |
9 #include "cc/layers/video_layer.h" | 9 #include "cc/layers/video_layer.h" |
10 #include "cc/layers/video_layer_impl.h" | 10 #include "cc/layers/video_layer_impl.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 return draw_result; | 70 return draw_result; |
71 } | 71 } |
72 | 72 |
73 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { | 73 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { |
74 VideoLayerImpl* video = static_cast<VideoLayerImpl*>( | 74 VideoLayerImpl* video = static_cast<VideoLayerImpl*>( |
75 host_impl->active_tree()->root_layer()->children()[0]); | 75 host_impl->active_tree()->root_layer()->children()[0]); |
76 | 76 |
77 EXPECT_EQ(media::VIDEO_ROTATION_90, video->video_rotation()); | 77 EXPECT_EQ(media::VIDEO_ROTATION_90, video->video_rotation()); |
78 | 78 |
79 if (num_draws_ == 0) | 79 if (num_draws_ == 0) |
80 video->SetNeedsRedraw(); | 80 video_frame_provider_.SendDidReceiveFrame(); |
81 | 81 |
82 ++num_draws_; | 82 ++num_draws_; |
83 } | 83 } |
84 | 84 |
85 void AfterTest() override { EXPECT_EQ(2, num_draws_); } | 85 void AfterTest() override { EXPECT_EQ(2, num_draws_); } |
86 | 86 |
87 private: | 87 private: |
88 int num_draws_; | 88 int num_draws_; |
89 | 89 |
90 FakeVideoFrameProvider video_frame_provider_; | 90 FakeVideoFrameProvider video_frame_provider_; |
91 }; | 91 }; |
92 | 92 |
93 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostVideoTestSetNeedsDisplay); | 93 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostVideoTestSetNeedsDisplay); |
94 | 94 |
95 } // namespace | 95 } // namespace |
96 } // namespace cc | 96 } // namespace cc |
OLD | NEW |