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_common.h" | 5 #include "cc/trees/layer_tree_host_common.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "cc/animation/layer_animation_controller.h" | 9 #include "cc/animation/layer_animation_controller.h" |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 namespace cc { | 35 namespace cc { |
36 namespace { | 36 namespace { |
37 | 37 |
38 class LayerTreeHostCommonTestBase { | 38 class LayerTreeHostCommonTestBase { |
39 protected: | 39 protected: |
40 template <typename LayerType> | 40 template <typename LayerType> |
41 void SetLayerPropertiesForTestingInternal( | 41 void SetLayerPropertiesForTestingInternal( |
42 LayerType* layer, | 42 LayerType* layer, |
43 const gfx::Transform& transform, | 43 const gfx::Transform& transform, |
44 const gfx::Transform& sublayer_transform, | 44 const gfx::Transform& sublayer_transform, |
45 gfx::PointF anchor, | 45 const gfx::PointF& anchor, |
46 gfx::PointF position, | 46 const gfx::PointF& position, |
47 gfx::Size bounds, | 47 gfx::Size bounds, |
48 bool preserves3d) { | 48 bool preserves3d) { |
49 layer->SetTransform(transform); | 49 layer->SetTransform(transform); |
50 layer->SetSublayerTransform(sublayer_transform); | 50 layer->SetSublayerTransform(sublayer_transform); |
51 layer->SetAnchorPoint(anchor); | 51 layer->SetAnchorPoint(anchor); |
52 layer->SetPosition(position); | 52 layer->SetPosition(position); |
53 layer->SetBounds(bounds); | 53 layer->SetBounds(bounds); |
54 layer->SetPreserves3d(preserves3d); | 54 layer->SetPreserves3d(preserves3d); |
55 } | 55 } |
56 | 56 |
57 void SetLayerPropertiesForTesting(Layer* layer, | 57 void SetLayerPropertiesForTesting(Layer* layer, |
58 const gfx::Transform& transform, | 58 const gfx::Transform& transform, |
59 const gfx::Transform& sublayer_transform, | 59 const gfx::Transform& sublayer_transform, |
60 gfx::PointF anchor, | 60 const gfx::PointF& anchor, |
61 gfx::PointF position, | 61 const gfx::PointF& position, |
62 gfx::Size bounds, | 62 gfx::Size bounds, |
63 bool preserves3d) { | 63 bool preserves3d) { |
64 SetLayerPropertiesForTestingInternal<Layer>(layer, | 64 SetLayerPropertiesForTestingInternal<Layer>(layer, |
65 transform, | 65 transform, |
66 sublayer_transform, | 66 sublayer_transform, |
67 anchor, | 67 anchor, |
68 position, | 68 position, |
69 bounds, | 69 bounds, |
70 preserves3d); | 70 preserves3d); |
71 } | 71 } |
72 | 72 |
73 void SetLayerPropertiesForTesting(LayerImpl* layer, | 73 void SetLayerPropertiesForTesting(LayerImpl* layer, |
74 const gfx::Transform& transform, | 74 const gfx::Transform& transform, |
75 const gfx::Transform& sublayer_transform, | 75 const gfx::Transform& sublayer_transform, |
76 gfx::PointF anchor, | 76 const gfx::PointF& anchor, |
77 gfx::PointF position, | 77 const gfx::PointF& position, |
78 gfx::Size bounds, | 78 gfx::Size bounds, |
79 bool preserves3d) { | 79 bool preserves3d) { |
80 SetLayerPropertiesForTestingInternal<LayerImpl>(layer, | 80 SetLayerPropertiesForTestingInternal<LayerImpl>(layer, |
81 transform, | 81 transform, |
82 sublayer_transform, | 82 sublayer_transform, |
83 anchor, | 83 anchor, |
84 position, | 84 position, |
85 bounds, | 85 bounds, |
86 preserves3d); | 86 preserves3d); |
87 layer->SetContentBounds(bounds); | 87 layer->SetContentBounds(bounds); |
(...skipping 9652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9740 fixed_layer->draw_properties().screen_space_transform.To2dTranslation(), | 9740 fixed_layer->draw_properties().screen_space_transform.To2dTranslation(), |
9741 container_offset); | 9741 container_offset); |
9742 EXPECT_VECTOR_EQ(scroll_layer->draw_properties() | 9742 EXPECT_VECTOR_EQ(scroll_layer->draw_properties() |
9743 .screen_space_transform.To2dTranslation(), | 9743 .screen_space_transform.To2dTranslation(), |
9744 container_offset - rounded_scroll_delta); | 9744 container_offset - rounded_scroll_delta); |
9745 } | 9745 } |
9746 } | 9746 } |
9747 | 9747 |
9748 } // namespace | 9748 } // namespace |
9749 } // namespace cc | 9749 } // namespace cc |
OLD | NEW |