| 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 #include "cc/test/layer_tree_host_common_test.h" | 5 #include "cc/test/layer_tree_host_common_test.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "cc/layers/layer.h" | 9 #include "cc/layers/layer.h" |
| 10 #include "cc/layers/layer_impl.h" | 10 #include "cc/layers/layer_impl.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 void LayerTreeHostCommonTestBase::SetLayerPropertiesForTesting( | 26 void LayerTreeHostCommonTestBase::SetLayerPropertiesForTesting( |
| 27 Layer* layer, | 27 Layer* layer, |
| 28 const gfx::Transform& transform, | 28 const gfx::Transform& transform, |
| 29 const gfx::Point3F& transform_origin, | 29 const gfx::Point3F& transform_origin, |
| 30 const gfx::PointF& position, | 30 const gfx::PointF& position, |
| 31 const gfx::Size& bounds, | 31 const gfx::Size& bounds, |
| 32 bool flatten_transform, | 32 bool flatten_transform, |
| 33 bool is_3d_sorted) { | 33 bool is_3d_sorted) { |
| 34 SetLayerPropertiesForTestingInternal(layer, transform, position, bounds, | 34 SetLayerPropertiesForTestingInternal(layer, transform, position, bounds, |
| 35 flatten_transform, is_3d_sorted); | 35 is_3d_sorted); |
| 36 layer->SetTransformOrigin(transform_origin); | 36 layer->SetTransformOrigin(transform_origin); |
| 37 layer->SetShouldFlattenTransform(flatten_transform); |
| 37 } | 38 } |
| 38 | 39 |
| 39 void LayerTreeHostCommonTestBase::SetLayerPropertiesForTesting( | 40 void LayerTreeHostCommonTestBase::SetLayerPropertiesForTesting( |
| 40 LayerImpl* layer, | 41 LayerImpl* layer, |
| 41 const gfx::Transform& transform, | 42 const gfx::Transform& transform, |
| 42 const gfx::Point3F& transform_origin, | 43 const gfx::Point3F& transform_origin, |
| 43 const gfx::PointF& position, | 44 const gfx::PointF& position, |
| 44 const gfx::Size& bounds, | 45 const gfx::Size& bounds, |
| 45 bool flatten_transform, | 46 bool flatten_transform, |
| 46 bool is_3d_sorted) { | 47 bool is_3d_sorted) { |
| 47 SetLayerPropertiesForTestingInternal(layer, transform, position, bounds, | 48 SetLayerPropertiesForTestingInternal(layer, transform, position, bounds, |
| 48 flatten_transform, is_3d_sorted); | 49 is_3d_sorted); |
| 49 layer->test_properties()->transform_origin = transform_origin; | 50 layer->test_properties()->transform_origin = transform_origin; |
| 51 layer->test_properties()->should_flatten_transform = flatten_transform; |
| 50 } | 52 } |
| 51 | 53 |
| 52 void LayerTreeHostCommonTestBase::SetLayerPropertiesForTesting( | 54 void LayerTreeHostCommonTestBase::SetLayerPropertiesForTesting( |
| 53 LayerImpl* layer, | 55 LayerImpl* layer, |
| 54 const gfx::Transform& transform, | 56 const gfx::Transform& transform, |
| 55 const gfx::Point3F& transform_origin, | 57 const gfx::Point3F& transform_origin, |
| 56 const gfx::PointF& position, | 58 const gfx::PointF& position, |
| 57 const gfx::Size& bounds, | 59 const gfx::Size& bounds, |
| 58 bool flatten_transform, | 60 bool flatten_transform, |
| 59 bool is_3d_sorted, | 61 bool is_3d_sorted, |
| 60 bool create_render_surface) { | 62 bool create_render_surface) { |
| 61 SetLayerPropertiesForTestingInternal(layer, transform, position, bounds, | 63 SetLayerPropertiesForTestingInternal(layer, transform, position, bounds, |
| 62 flatten_transform, is_3d_sorted); | 64 is_3d_sorted); |
| 63 layer->test_properties()->transform_origin = transform_origin; | 65 layer->test_properties()->transform_origin = transform_origin; |
| 66 layer->test_properties()->should_flatten_transform = flatten_transform; |
| 64 if (create_render_surface) { | 67 if (create_render_surface) { |
| 65 layer->test_properties()->force_render_surface = true; | 68 layer->test_properties()->force_render_surface = true; |
| 66 } | 69 } |
| 67 } | 70 } |
| 68 | 71 |
| 69 void LayerTreeHostCommonTestBase::ExecuteCalculateDrawProperties( | 72 void LayerTreeHostCommonTestBase::ExecuteCalculateDrawProperties( |
| 70 Layer* root_layer, | 73 Layer* root_layer, |
| 71 float device_scale_factor, | 74 float device_scale_factor, |
| 72 float page_scale_factor, | 75 float page_scale_factor, |
| 73 Layer* page_scale_layer, | 76 Layer* page_scale_layer, |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 | 240 |
| 238 LayerTreeHostCommonTest::LayerTreeHostCommonTest() | 241 LayerTreeHostCommonTest::LayerTreeHostCommonTest() |
| 239 : LayerTreeHostCommonTestBase(LayerTreeSettings()) {} | 242 : LayerTreeHostCommonTestBase(LayerTreeSettings()) {} |
| 240 | 243 |
| 241 LayerTreeHostCommonTest::LayerTreeHostCommonTest( | 244 LayerTreeHostCommonTest::LayerTreeHostCommonTest( |
| 242 const LayerTreeSettings& settings) | 245 const LayerTreeSettings& settings) |
| 243 : LayerTreeHostCommonTestBase(settings) { | 246 : LayerTreeHostCommonTestBase(settings) { |
| 244 } | 247 } |
| 245 | 248 |
| 246 } // namespace cc | 249 } // namespace cc |
| OLD | NEW |