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