| 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()); | 37 video_layer_impl->SetTransformOrigin(gfx::Point3F()); |
| 38 video_layer_impl->SetBounds(layer_size); | 38 video_layer_impl->SetBounds(layer_size); |
| 39 video_layer_impl->SetContentBounds(layer_size); | 39 video_layer_impl->SetContentBounds(layer_size); |
| 40 video_layer_impl->SetDrawsContent(true); | 40 video_layer_impl->SetDrawsContent(true); |
| 41 | 41 |
| 42 impl.CalcDrawProps(viewport_size); | 42 impl.CalcDrawProps(viewport_size); |
| 43 | 43 |
| 44 { | 44 { |
| 45 SCOPED_TRACE("No occlusion"); | 45 SCOPED_TRACE("No occlusion"); |
| 46 gfx::Rect occluded; | 46 gfx::Rect occluded; |
| 47 impl.AppendQuadsWithOcclusion(video_layer_impl, occluded); | 47 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()); | 89 static_cast<VideoFrameProviderClientImpl*>(provider.client()); |
| 90 ASSERT_TRUE(client); | 90 ASSERT_TRUE(client); |
| 91 EXPECT_FALSE(client->active_video_layer()); | 91 EXPECT_FALSE(client->active_video_layer()); |
| 92 | 92 |
| 93 video_layer_impl->DidBecomeActive(); | 93 video_layer_impl->DidBecomeActive(); |
| 94 EXPECT_EQ(video_layer_impl, client->active_video_layer()); | 94 EXPECT_EQ(video_layer_impl, client->active_video_layer()); |
| 95 } | 95 } |
| 96 | 96 |
| 97 } // namespace | 97 } // namespace |
| 98 } // namespace cc | 98 } // namespace cc |
| OLD | NEW |