| 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 <algorithm> | 8 #include <algorithm> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 namespace cc { | 26 namespace cc { |
| 27 | 27 |
| 28 class Layer; | 28 class Layer; |
| 29 class LayerImpl; | 29 class LayerImpl; |
| 30 | 30 |
| 31 class LayerTreeHostCommonTestBase : public LayerTestCommon::LayerImplTest { | 31 class LayerTreeHostCommonTestBase : public LayerTestCommon::LayerImplTest { |
| 32 protected: | 32 protected: |
| 33 explicit LayerTreeHostCommonTestBase(const LayerTreeSettings& settings); | 33 explicit LayerTreeHostCommonTestBase(const LayerTreeSettings& settings); |
| 34 virtual ~LayerTreeHostCommonTestBase(); | 34 virtual ~LayerTreeHostCommonTestBase(); |
| 35 | 35 |
| 36 template <typename LayerType> | |
| 37 void SetLayerPropertiesForTestingInternal( | |
| 38 LayerType* layer, | |
| 39 const gfx::Transform& transform, | |
| 40 const gfx::PointF& position, | |
| 41 const gfx::Size& bounds, | |
| 42 bool is_3d_sorted) { | |
| 43 layer->SetTransform(transform); | |
| 44 layer->SetPosition(position); | |
| 45 layer->SetBounds(bounds); | |
| 46 layer->Set3dSortingContextId(is_3d_sorted ? 1 : 0); | |
| 47 } | |
| 48 | |
| 49 void SetLayerPropertiesForTesting(Layer* layer, | |
| 50 const gfx::Transform& transform, | |
| 51 const gfx::Point3F& transform_origin, | |
| 52 const gfx::PointF& position, | |
| 53 const gfx::Size& bounds, | |
| 54 bool flatten_transform, | |
| 55 bool is_3d_sorted); | |
| 56 | |
| 57 void SetLayerPropertiesForTesting(LayerImpl* layer, | |
| 58 const gfx::Transform& transform, | |
| 59 const gfx::Point3F& transform_origin, | |
| 60 const gfx::PointF& position, | |
| 61 const gfx::Size& bounds, | |
| 62 bool flatten_transform, | |
| 63 bool is_3d_sorted); | |
| 64 | |
| 65 void SetLayerPropertiesForTesting(LayerImpl* layer, | |
| 66 const gfx::Transform& transform, | |
| 67 const gfx::Point3F& transform_origin, | |
| 68 const gfx::PointF& position, | |
| 69 const gfx::Size& bounds, | |
| 70 bool flatten_transform, | |
| 71 bool is_3d_sorted, | |
| 72 bool create_render_surface); | |
| 73 | |
| 74 void ExecuteCalculateDrawProperties(Layer* root_layer, | 36 void ExecuteCalculateDrawProperties(Layer* root_layer, |
| 75 float device_scale_factor, | 37 float device_scale_factor, |
| 76 float page_scale_factor, | 38 float page_scale_factor, |
| 77 Layer* page_scale_application_layer); | 39 Layer* page_scale_application_layer); |
| 78 | 40 |
| 79 void ExecuteCalculateDrawProperties(LayerImpl* root_layer, | 41 void ExecuteCalculateDrawProperties(LayerImpl* root_layer, |
| 80 float device_scale_factor, | 42 float device_scale_factor, |
| 81 float page_scale_factor, | 43 float page_scale_factor, |
| 82 LayerImpl* page_scale_application_layer); | 44 LayerImpl* page_scale_application_layer); |
| 83 | 45 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 LayerTreeSettings LayerTreeHostCommonTestSettings() { | 122 LayerTreeSettings LayerTreeHostCommonTestSettings() { |
| 161 LayerTreeSettings settings; | 123 LayerTreeSettings settings; |
| 162 settings.verify_transform_tree_calculations = true; | 124 settings.verify_transform_tree_calculations = true; |
| 163 return settings; | 125 return settings; |
| 164 } | 126 } |
| 165 }; | 127 }; |
| 166 | 128 |
| 167 } // namespace cc | 129 } // namespace cc |
| 168 | 130 |
| 169 #endif // CC_TEST_LAYER_TREE_HOST_COMMON_TEST_H_ | 131 #endif // CC_TEST_LAYER_TREE_HOST_COMMON_TEST_H_ |
| OLD | NEW |