OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_frame_provider_client_impl.h" | 5 #include "cc/layers/video_frame_provider_client_impl.h" |
6 #include "cc/layers/video_layer_impl.h" | 6 #include "cc/layers/video_layer_impl.h" |
7 #include "cc/output/begin_frame_args.h" | 7 #include "cc/output/begin_frame_args.h" |
8 #include "cc/test/fake_video_frame_provider.h" | 8 #include "cc/test/fake_video_frame_provider.h" |
9 #include "cc/test/layer_test_common.h" | 9 #include "cc/test/layer_test_common.h" |
10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 EXPECT_EQ(gfx::Rect(), video_layer_impl_->update_rect()); | 69 EXPECT_EQ(gfx::Rect(), video_layer_impl_->update_rect()); |
70 client_impl_->OnBeginFrame(BeginFrameArgs()); | 70 client_impl_->OnBeginFrame(BeginFrameArgs()); |
71 EXPECT_NE(gfx::Rect(), video_layer_impl_->update_rect()); | 71 EXPECT_NE(gfx::Rect(), video_layer_impl_->update_rect()); |
72 } | 72 } |
73 | 73 |
74 void CreateActiveVideoLayer() { | 74 void CreateActiveVideoLayer() { |
75 gfx::Size layer_size(100, 100); | 75 gfx::Size layer_size(100, 100); |
76 video_layer_impl_ = impl_.AddChildToRoot<VideoLayerImpl>( | 76 video_layer_impl_ = impl_.AddChildToRoot<VideoLayerImpl>( |
77 &provider_, media::VIDEO_ROTATION_0); | 77 &provider_, media::VIDEO_ROTATION_0); |
78 video_layer_impl_->SetBounds(layer_size); | 78 video_layer_impl_->SetBounds(layer_size); |
79 video_layer_impl_->SetContentBounds(layer_size); | |
80 video_layer_impl_->SetDrawsContent(true); | 79 video_layer_impl_->SetDrawsContent(true); |
81 client_impl_->SetActiveVideoLayer(video_layer_impl_); | 80 client_impl_->SetActiveVideoLayer(video_layer_impl_); |
82 ASSERT_TRUE(client_impl_->ActiveVideoLayer()); | 81 ASSERT_TRUE(client_impl_->ActiveVideoLayer()); |
83 } | 82 } |
84 | 83 |
85 MOCK_METHOD1(AddVideoFrameController, void(VideoFrameController*)); | 84 MOCK_METHOD1(AddVideoFrameController, void(VideoFrameController*)); |
86 MOCK_METHOD1(RemoveVideoFrameController, void(VideoFrameController*)); | 85 MOCK_METHOD1(RemoveVideoFrameController, void(VideoFrameController*)); |
87 | 86 |
88 protected: | 87 protected: |
89 FakeVideoFrameProvider provider_; | 88 FakeVideoFrameProvider provider_; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 0.0, | 157 0.0, |
159 1.0, | 158 1.0, |
160 }; | 159 }; |
161 | 160 |
162 EXPECT_FALSE(client_impl_->StreamTextureMatrix().IsIdentity()); | 161 EXPECT_FALSE(client_impl_->StreamTextureMatrix().IsIdentity()); |
163 client_impl_->DidUpdateMatrix(kIdentityMatrix); | 162 client_impl_->DidUpdateMatrix(kIdentityMatrix); |
164 EXPECT_TRUE(client_impl_->StreamTextureMatrix().IsIdentity()); | 163 EXPECT_TRUE(client_impl_->StreamTextureMatrix().IsIdentity()); |
165 } | 164 } |
166 | 165 |
167 } // namespace cc | 166 } // namespace cc |
OLD | NEW |