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" |
11 #include "cc/test/fake_video_frame_provider.h" | 11 #include "cc/test/fake_video_frame_provider.h" |
12 #include "cc/test/layer_tree_test.h" | 12 #include "cc/test/layer_tree_test.h" |
13 #include "cc/trees/damage_tracker.h" | 13 #include "cc/trees/damage_tracker.h" |
14 #include "cc/trees/layer_tree_impl.h" | 14 #include "cc/trees/layer_tree_impl.h" |
15 | 15 |
16 namespace cc { | 16 namespace cc { |
17 namespace { | 17 namespace { |
18 | 18 |
19 // These tests deal with compositing video. | 19 // These tests deal with compositing video. |
20 class LayerTreeHostVideoTest : public LayerTreeTest {}; | 20 class LayerTreeHostVideoTest : public LayerTreeTest {}; |
21 | 21 |
22 class LayerTreeHostVideoTestSetNeedsDisplay | 22 class LayerTreeHostVideoTestSetNeedsDisplay |
23 : public LayerTreeHostVideoTest { | 23 : public LayerTreeHostVideoTest { |
24 public: | 24 public: |
25 virtual void SetupTree() OVERRIDE { | 25 virtual void SetupTree() OVERRIDE { |
26 scoped_refptr<Layer> root = Layer::Create(); | 26 scoped_refptr<Layer> root = Layer::Create(); |
27 root->SetBounds(gfx::Size(10, 10)); | 27 root->SetBounds(gfx::Size(10, 10)); |
28 root->SetAnchorPoint(gfx::PointF()); | 28 root->SetTransformOrigin(gfx::Point3F()); |
29 root->SetIsDrawable(true); | 29 root->SetIsDrawable(true); |
30 | 30 |
31 scoped_refptr<VideoLayer> video = VideoLayer::Create( | 31 scoped_refptr<VideoLayer> video = VideoLayer::Create( |
32 &video_frame_provider_); | 32 &video_frame_provider_); |
33 video->SetPosition(gfx::PointF(3.f, 3.f)); | 33 video->SetPosition(gfx::PointF(3.f, 3.f)); |
34 video->SetBounds(gfx::Size(4, 4)); | 34 video->SetBounds(gfx::Size(4, 4)); |
35 video->SetAnchorPoint(gfx::PointF()); | 35 video->SetTransformOrigin(gfx::Point3F()); |
36 video->SetIsDrawable(true); | 36 video->SetIsDrawable(true); |
37 root->AddChild(video); | 37 root->AddChild(video); |
38 | 38 |
39 layer_tree_host()->SetRootLayer(root); | 39 layer_tree_host()->SetRootLayer(root); |
40 layer_tree_host()->SetDeviceScaleFactor(2.f); | 40 layer_tree_host()->SetDeviceScaleFactor(2.f); |
41 LayerTreeHostVideoTest::SetupTree(); | 41 LayerTreeHostVideoTest::SetupTree(); |
42 } | 42 } |
43 | 43 |
44 virtual void BeginTest() OVERRIDE { | 44 virtual void BeginTest() OVERRIDE { |
45 num_draws_ = 0; | 45 num_draws_ = 0; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 private: | 89 private: |
90 int num_draws_; | 90 int num_draws_; |
91 | 91 |
92 FakeVideoFrameProvider video_frame_provider_; | 92 FakeVideoFrameProvider video_frame_provider_; |
93 }; | 93 }; |
94 | 94 |
95 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostVideoTestSetNeedsDisplay); | 95 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostVideoTestSetNeedsDisplay); |
96 | 96 |
97 } // namespace | 97 } // namespace |
98 } // namespace cc | 98 } // namespace cc |
OLD | NEW |