| 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 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 class LayerTreeHostCommonTestBase : public LayerTestCommon::LayerImplTest { | 33 class LayerTreeHostCommonTestBase : public LayerTestCommon::LayerImplTest { |
| 34 protected: | 34 protected: |
| 35 explicit LayerTreeHostCommonTestBase(const LayerTreeSettings& settings); | 35 explicit LayerTreeHostCommonTestBase(const LayerTreeSettings& settings); |
| 36 virtual ~LayerTreeHostCommonTestBase(); | 36 virtual ~LayerTreeHostCommonTestBase(); |
| 37 | 37 |
| 38 template <typename LayerType> | 38 template <typename LayerType> |
| 39 void SetLayerPropertiesForTestingInternal( | 39 void SetLayerPropertiesForTestingInternal( |
| 40 LayerType* layer, | 40 LayerType* layer, |
| 41 const gfx::Transform& transform, | 41 const gfx::Transform& transform, |
| 42 const gfx::Point3F& transform_origin, | |
| 43 const gfx::PointF& position, | 42 const gfx::PointF& position, |
| 44 const gfx::Size& bounds, | 43 const gfx::Size& bounds, |
| 45 bool flatten_transform, | 44 bool flatten_transform, |
| 46 bool is_3d_sorted) { | 45 bool is_3d_sorted) { |
| 47 layer->SetTransform(transform); | 46 layer->SetTransform(transform); |
| 48 layer->SetTransformOrigin(transform_origin); | |
| 49 layer->SetPosition(position); | 47 layer->SetPosition(position); |
| 50 layer->SetBounds(bounds); | 48 layer->SetBounds(bounds); |
| 51 layer->SetShouldFlattenTransform(flatten_transform); | 49 layer->SetShouldFlattenTransform(flatten_transform); |
| 52 layer->Set3dSortingContextId(is_3d_sorted ? 1 : 0); | 50 layer->Set3dSortingContextId(is_3d_sorted ? 1 : 0); |
| 53 } | 51 } |
| 54 | 52 |
| 55 void SetLayerPropertiesForTesting(Layer* layer, | 53 void SetLayerPropertiesForTesting(Layer* layer, |
| 56 const gfx::Transform& transform, | 54 const gfx::Transform& transform, |
| 57 const gfx::Point3F& transform_origin, | 55 const gfx::Point3F& transform_origin, |
| 58 const gfx::PointF& position, | 56 const gfx::PointF& position, |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 ->scroll_tree.SetScrollOffsetDeltaForTesting(layer_impl->id(), | 162 ->scroll_tree.SetScrollOffsetDeltaForTesting(layer_impl->id(), |
| 165 delta)) | 163 delta)) |
| 166 layer_impl->layer_tree_impl()->DidUpdateScrollOffset( | 164 layer_impl->layer_tree_impl()->DidUpdateScrollOffset( |
| 167 layer_impl->id(), layer_impl->transform_tree_index()); | 165 layer_impl->id(), layer_impl->transform_tree_index()); |
| 168 } | 166 } |
| 169 }; | 167 }; |
| 170 | 168 |
| 171 } // namespace cc | 169 } // namespace cc |
| 172 | 170 |
| 173 #endif // CC_TEST_LAYER_TREE_HOST_COMMON_TEST_H_ | 171 #endif // CC_TEST_LAYER_TREE_HOST_COMMON_TEST_H_ |
| OLD | NEW |