| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_layer_impl.h" | 5 #include "cc/layers/video_layer_impl.h" |
| 6 | 6 |
| 7 #include "cc/layers/video_frame_provider_client_impl.h" | 7 #include "cc/layers/video_frame_provider_client_impl.h" |
| 8 #include "cc/output/context_provider.h" | 8 #include "cc/output/context_provider.h" |
| 9 #include "cc/output/output_surface.h" | 9 #include "cc/output/output_surface.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 media::VideoFrame::CreateFrame(media::VideoFrame::YV12, | 27 media::VideoFrame::CreateFrame(media::VideoFrame::YV12, |
| 28 gfx::Size(10, 10), | 28 gfx::Size(10, 10), |
| 29 gfx::Rect(10, 10), | 29 gfx::Rect(10, 10), |
| 30 gfx::Size(10, 10), | 30 gfx::Size(10, 10), |
| 31 base::TimeDelta()); | 31 base::TimeDelta()); |
| 32 FakeVideoFrameProvider provider; | 32 FakeVideoFrameProvider provider; |
| 33 provider.set_frame(video_frame); | 33 provider.set_frame(video_frame); |
| 34 | 34 |
| 35 VideoLayerImpl* video_layer_impl = | 35 VideoLayerImpl* video_layer_impl = |
| 36 impl.AddChildToRoot<VideoLayerImpl>(&provider); | 36 impl.AddChildToRoot<VideoLayerImpl>(&provider); |
| 37 video_layer_impl->SetAnchorPoint(gfx::PointF()); | |
| 38 video_layer_impl->SetBounds(layer_size); | 37 video_layer_impl->SetBounds(layer_size); |
| 39 video_layer_impl->SetContentBounds(layer_size); | 38 video_layer_impl->SetContentBounds(layer_size); |
| 40 video_layer_impl->SetDrawsContent(true); | 39 video_layer_impl->SetDrawsContent(true); |
| 41 | 40 |
| 42 impl.CalcDrawProps(viewport_size); | 41 impl.CalcDrawProps(viewport_size); |
| 43 | 42 |
| 44 { | 43 { |
| 45 SCOPED_TRACE("No occlusion"); | 44 SCOPED_TRACE("No occlusion"); |
| 46 gfx::Rect occluded; | 45 gfx::Rect occluded; |
| 47 impl.AppendQuadsWithOcclusion(video_layer_impl, occluded); | 46 impl.AppendQuadsWithOcclusion(video_layer_impl, occluded); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 static_cast<VideoFrameProviderClientImpl*>(provider.client()); | 88 static_cast<VideoFrameProviderClientImpl*>(provider.client()); |
| 90 ASSERT_TRUE(client); | 89 ASSERT_TRUE(client); |
| 91 EXPECT_FALSE(client->active_video_layer()); | 90 EXPECT_FALSE(client->active_video_layer()); |
| 92 | 91 |
| 93 video_layer_impl->DidBecomeActive(); | 92 video_layer_impl->DidBecomeActive(); |
| 94 EXPECT_EQ(video_layer_impl, client->active_video_layer()); | 93 EXPECT_EQ(video_layer_impl, client->active_video_layer()); |
| 95 } | 94 } |
| 96 | 95 |
| 97 } // namespace | 96 } // namespace |
| 98 } // namespace cc | 97 } // namespace cc |
| OLD | NEW |