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 #ifndef CC_TEST_LAYER_TREE_HOST_COMMON_TEST_H_ | 5 #ifndef CC_TEST_LAYER_TREE_HOST_COMMON_TEST_H_ |
6 #define CC_TEST_LAYER_TREE_HOST_COMMON_TEST_H_ | 6 #define CC_TEST_LAYER_TREE_HOST_COMMON_TEST_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 class Layer; | 23 class Layer; |
24 class LayerImpl; | 24 class LayerImpl; |
25 class RenderSurfaceLayerList; | 25 class RenderSurfaceLayerList; |
26 | 26 |
27 class LayerTreeHostCommonTestBase { | 27 class LayerTreeHostCommonTestBase { |
28 protected: | 28 protected: |
29 LayerTreeHostCommonTestBase(); | 29 LayerTreeHostCommonTestBase(); |
30 virtual ~LayerTreeHostCommonTestBase(); | 30 virtual ~LayerTreeHostCommonTestBase(); |
31 | 31 |
32 template <typename LayerType> | |
33 void SetLayerPropertiesForTestingInternal( | 32 void SetLayerPropertiesForTestingInternal( |
34 LayerType* layer, | 33 Layer* layer, |
35 const gfx::Transform& transform, | 34 const gfx::Transform& transform, |
36 const gfx::Point3F& transform_origin, | 35 const gfx::Point3F& transform_origin, |
37 const gfx::PointF& position, | 36 const gfx::PointF& position, |
38 const gfx::Size& bounds, | 37 const gfx::Size& bounds, |
39 bool flatten_transform, | 38 bool flatten_transform, |
40 bool is_3d_sorted) { | 39 bool is_3d_sorted, |
41 layer->SetTransform(transform); | 40 bool create_render_surface); |
42 layer->SetTransformOrigin(transform_origin); | 41 void SetLayerPropertiesForTestingInternal( |
43 layer->SetPosition(position); | 42 LayerImpl* layer, |
44 layer->SetBounds(bounds); | 43 const gfx::Transform& transform, |
45 layer->SetShouldFlattenTransform(flatten_transform); | 44 const gfx::Point3F& transform_origin, |
46 layer->Set3dSortingContextId(is_3d_sorted ? 1 : 0); | 45 const gfx::PointF& position, |
47 } | 46 const gfx::Size& bounds, |
| 47 bool flatten_transform, |
| 48 bool is_3d_sorted, |
| 49 bool create_render_surface); |
48 | 50 |
49 void SetLayerPropertiesForTesting(Layer* layer, | 51 void SetLayerPropertiesForTesting(Layer* layer, |
50 const gfx::Transform& transform, | 52 const gfx::Transform& transform, |
51 const gfx::Point3F& transform_origin, | 53 const gfx::Point3F& transform_origin, |
52 const gfx::PointF& position, | 54 const gfx::PointF& position, |
53 const gfx::Size& bounds, | 55 const gfx::Size& bounds, |
54 bool flatten_transform, | 56 bool flatten_transform, |
55 bool is_3d_sorted); | 57 bool is_3d_sorted); |
56 | 58 |
57 void SetLayerPropertiesForTesting(LayerImpl* layer, | 59 void SetLayerPropertiesForTesting(LayerImpl* layer, |
58 const gfx::Transform& transform, | 60 const gfx::Transform& transform, |
59 const gfx::Point3F& transform_origin, | 61 const gfx::Point3F& transform_origin, |
60 const gfx::PointF& position, | 62 const gfx::PointF& position, |
61 const gfx::Size& bounds, | 63 const gfx::Size& bounds, |
62 bool flatten_transform, | 64 bool flatten_transform, |
63 bool is_3d_sorted); | 65 bool is_3d_sorted, |
| 66 bool create_render_surface); |
64 | 67 |
65 void ExecuteCalculateDrawProperties(Layer* root_layer, | 68 void ExecuteCalculateDrawProperties(Layer* root_layer, |
66 float device_scale_factor, | 69 float device_scale_factor, |
67 float page_scale_factor, | 70 float page_scale_factor, |
68 Layer* page_scale_application_layer, | 71 Layer* page_scale_application_layer, |
69 bool can_use_lcd_text); | 72 bool can_use_lcd_text); |
70 | 73 |
71 void ExecuteCalculateDrawProperties(LayerImpl* root_layer, | 74 void ExecuteCalculateDrawProperties(LayerImpl* root_layer, |
72 float device_scale_factor, | 75 float device_scale_factor, |
73 float page_scale_factor, | 76 float page_scale_factor, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 125 |
123 int render_surface_layer_list_count_; | 126 int render_surface_layer_list_count_; |
124 }; | 127 }; |
125 | 128 |
126 class LayerTreeHostCommonTest : public LayerTreeHostCommonTestBase, | 129 class LayerTreeHostCommonTest : public LayerTreeHostCommonTestBase, |
127 public testing::Test {}; | 130 public testing::Test {}; |
128 | 131 |
129 } // namespace cc | 132 } // namespace cc |
130 | 133 |
131 #endif // CC_TEST_LAYER_TREE_HOST_COMMON_TEST_H_ | 134 #endif // CC_TEST_LAYER_TREE_HOST_COMMON_TEST_H_ |
OLD | NEW |