OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 4559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4570 | 4570 |
4571 scoped_ptr<LayerImpl> root_layer = | 4571 scoped_ptr<LayerImpl> root_layer = |
4572 LayerImpl::Create(host_impl_->active_tree(), 1); | 4572 LayerImpl::Create(host_impl_->active_tree(), 1); |
4573 root_layer->SetBounds(gfx::Size(10, 10)); | 4573 root_layer->SetBounds(gfx::Size(10, 10)); |
4574 | 4574 |
4575 scoped_refptr<VideoFrame> softwareFrame = | 4575 scoped_refptr<VideoFrame> softwareFrame = |
4576 media::VideoFrame::CreateColorFrame( | 4576 media::VideoFrame::CreateColorFrame( |
4577 gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta()); | 4577 gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta()); |
4578 FakeVideoFrameProvider provider; | 4578 FakeVideoFrameProvider provider; |
4579 provider.set_frame(softwareFrame); | 4579 provider.set_frame(softwareFrame); |
4580 scoped_ptr<VideoLayerImpl> video_layer = | 4580 scoped_ptr<VideoLayerImpl> video_layer = VideoLayerImpl::Create( |
4581 VideoLayerImpl::Create(host_impl_->active_tree(), 4, &provider); | 4581 host_impl_->active_tree(), 4, &provider, media::VIDEO_ROTATION_0); |
4582 video_layer->SetBounds(gfx::Size(10, 10)); | 4582 video_layer->SetBounds(gfx::Size(10, 10)); |
4583 video_layer->SetContentBounds(gfx::Size(10, 10)); | 4583 video_layer->SetContentBounds(gfx::Size(10, 10)); |
4584 video_layer->SetDrawsContent(true); | 4584 video_layer->SetDrawsContent(true); |
4585 root_layer->AddChild(video_layer.PassAs<LayerImpl>()); | 4585 root_layer->AddChild(video_layer.PassAs<LayerImpl>()); |
4586 | 4586 |
4587 scoped_ptr<IOSurfaceLayerImpl> io_surface_layer = | 4587 scoped_ptr<IOSurfaceLayerImpl> io_surface_layer = |
4588 IOSurfaceLayerImpl::Create(host_impl_->active_tree(), 5); | 4588 IOSurfaceLayerImpl::Create(host_impl_->active_tree(), 5); |
4589 io_surface_layer->SetBounds(gfx::Size(10, 10)); | 4589 io_surface_layer->SetBounds(gfx::Size(10, 10)); |
4590 io_surface_layer->SetContentBounds(gfx::Size(10, 10)); | 4590 io_surface_layer->SetContentBounds(gfx::Size(10, 10)); |
4591 io_surface_layer->SetDrawsContent(true); | 4591 io_surface_layer->SetDrawsContent(true); |
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5615 external_viewport, | 5615 external_viewport, |
5616 external_transform, | 5616 external_transform, |
5617 resourceless_software_draw); | 5617 resourceless_software_draw); |
5618 | 5618 |
5619 // SolidColorLayerImpl will be drawn. | 5619 // SolidColorLayerImpl will be drawn. |
5620 scoped_ptr<SolidColorLayerImpl> root_layer = | 5620 scoped_ptr<SolidColorLayerImpl> root_layer = |
5621 SolidColorLayerImpl::Create(host_impl_->active_tree(), 1); | 5621 SolidColorLayerImpl::Create(host_impl_->active_tree(), 1); |
5622 | 5622 |
5623 // VideoLayerImpl will not be drawn. | 5623 // VideoLayerImpl will not be drawn. |
5624 FakeVideoFrameProvider provider; | 5624 FakeVideoFrameProvider provider; |
5625 scoped_ptr<VideoLayerImpl> video_layer = | 5625 scoped_ptr<VideoLayerImpl> video_layer = VideoLayerImpl::Create( |
5626 VideoLayerImpl::Create(host_impl_->active_tree(), 2, &provider); | 5626 host_impl_->active_tree(), 2, &provider, media::VIDEO_ROTATION_0); |
5627 video_layer->SetBounds(gfx::Size(10, 10)); | 5627 video_layer->SetBounds(gfx::Size(10, 10)); |
5628 video_layer->SetContentBounds(gfx::Size(10, 10)); | 5628 video_layer->SetContentBounds(gfx::Size(10, 10)); |
5629 video_layer->SetDrawsContent(true); | 5629 video_layer->SetDrawsContent(true); |
5630 root_layer->AddChild(video_layer.PassAs<LayerImpl>()); | 5630 root_layer->AddChild(video_layer.PassAs<LayerImpl>()); |
5631 SetupRootLayerImpl(root_layer.PassAs<LayerImpl>()); | 5631 SetupRootLayerImpl(root_layer.PassAs<LayerImpl>()); |
5632 | 5632 |
5633 LayerTreeHostImpl::FrameData frame; | 5633 LayerTreeHostImpl::FrameData frame; |
5634 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); | 5634 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); |
5635 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now()); | 5635 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now()); |
5636 host_impl_->DidDrawAllLayers(frame); | 5636 host_impl_->DidDrawAllLayers(frame); |
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6759 layer_pairs.clear(); | 6759 layer_pairs.clear(); |
6760 host_impl_->GetPictureLayerImplPairs(&layer_pairs); | 6760 host_impl_->GetPictureLayerImplPairs(&layer_pairs); |
6761 EXPECT_EQ(1u, layer_pairs.size()); | 6761 EXPECT_EQ(1u, layer_pairs.size()); |
6762 | 6762 |
6763 EXPECT_EQ(active_layer.get(), layer_pairs[0].active); | 6763 EXPECT_EQ(active_layer.get(), layer_pairs[0].active); |
6764 EXPECT_EQ(pending_layer.get(), layer_pairs[0].pending); | 6764 EXPECT_EQ(pending_layer.get(), layer_pairs[0].pending); |
6765 } | 6765 } |
6766 | 6766 |
6767 } // namespace | 6767 } // namespace |
6768 } // namespace cc | 6768 } // namespace cc |
OLD | NEW |