| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 EndTest(); | 62 EndTest(); |
| 63 break; | 63 break; |
| 64 } | 64 } |
| 65 | 65 |
| 66 EXPECT_EQ(DRAW_SUCCESS, draw_result); | 66 EXPECT_EQ(DRAW_SUCCESS, draw_result); |
| 67 return draw_result; | 67 return draw_result; |
| 68 } | 68 } |
| 69 | 69 |
| 70 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { | 70 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { |
| 71 VideoLayerImpl* video = static_cast<VideoLayerImpl*>( | 71 VideoLayerImpl* video = static_cast<VideoLayerImpl*>( |
| 72 host_impl->active_tree()->root_layer()->children()[0].get()); | 72 host_impl->active_tree()->root_layer()->children()[0]); |
| 73 | 73 |
| 74 EXPECT_EQ(media::VIDEO_ROTATION_90, video->video_rotation()); | 74 EXPECT_EQ(media::VIDEO_ROTATION_90, video->video_rotation()); |
| 75 | 75 |
| 76 if (num_draws_ == 0) | 76 if (num_draws_ == 0) |
| 77 video->SetNeedsRedraw(); | 77 video->SetNeedsRedraw(); |
| 78 | 78 |
| 79 ++num_draws_; | 79 ++num_draws_; |
| 80 } | 80 } |
| 81 | 81 |
| 82 void AfterTest() override { EXPECT_EQ(2, num_draws_); } | 82 void AfterTest() override { EXPECT_EQ(2, num_draws_); } |
| 83 | 83 |
| 84 private: | 84 private: |
| 85 int num_draws_; | 85 int num_draws_; |
| 86 | 86 |
| 87 FakeVideoFrameProvider video_frame_provider_; | 87 FakeVideoFrameProvider video_frame_provider_; |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostVideoTestSetNeedsDisplay); | 90 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostVideoTestSetNeedsDisplay); |
| 91 | 91 |
| 92 } // namespace | 92 } // namespace |
| 93 } // namespace cc | 93 } // namespace cc |
| OLD | NEW |