Chromium Code Reviews| 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 19 matching lines...) Expand all Loading... | |
| 30 virtual ~LayerTreeHostCommonTestBase(); | 30 virtual ~LayerTreeHostCommonTestBase(); |
| 31 | 31 |
| 32 template <typename LayerType> | 32 template <typename LayerType> |
| 33 void SetLayerPropertiesForTestingInternal( | 33 void SetLayerPropertiesForTestingInternal( |
| 34 LayerType* layer, | 34 LayerType* layer, |
| 35 const gfx::Transform& transform, | 35 const gfx::Transform& transform, |
| 36 const gfx::Point3F& transform_origin, | 36 const gfx::Point3F& transform_origin, |
| 37 const gfx::PointF& position, | 37 const gfx::PointF& position, |
| 38 const gfx::Size& bounds, | 38 const gfx::Size& bounds, |
| 39 bool flatten_transform, | 39 bool flatten_transform, |
| 40 bool is_3d_sorted) { | 40 bool is_3d_sorted, |
| 41 bool create_render_surface) { | |
| 41 layer->SetTransform(transform); | 42 layer->SetTransform(transform); |
| 42 layer->SetTransformOrigin(transform_origin); | 43 layer->SetTransformOrigin(transform_origin); |
| 43 layer->SetPosition(position); | 44 layer->SetPosition(position); |
| 44 layer->SetBounds(bounds); | 45 layer->SetBounds(bounds); |
| 45 layer->SetShouldFlattenTransform(flatten_transform); | 46 layer->SetShouldFlattenTransform(flatten_transform); |
| 46 layer->Set3dSortingContextId(is_3d_sorted ? 1 : 0); | 47 layer->Set3dSortingContextId(is_3d_sorted ? 1 : 0); |
| 48 if (create_render_surface) { | |
| 49 layer->CreateRenderSurface(); | |
| 50 } | |
| 47 } | 51 } |
| 48 | 52 |
| 49 void SetLayerPropertiesForTesting(Layer* layer, | 53 void SetLayerPropertiesForTesting(Layer* layer, |
| 50 const gfx::Transform& transform, | 54 const gfx::Transform& transform, |
| 51 const gfx::Point3F& transform_origin, | 55 const gfx::Point3F& transform_origin, |
| 52 const gfx::PointF& position, | 56 const gfx::PointF& position, |
| 53 const gfx::Size& bounds, | 57 const gfx::Size& bounds, |
| 54 bool flatten_transform, | 58 bool flatten_transform, |
| 55 bool is_3d_sorted); | 59 bool is_3d_sorted); |
| 56 | 60 |
| 57 void SetLayerPropertiesForTesting(LayerImpl* layer, | 61 void SetLayerPropertiesForTesting(LayerImpl* layer, |
| 58 const gfx::Transform& transform, | 62 const gfx::Transform& transform, |
| 59 const gfx::Point3F& transform_origin, | 63 const gfx::Point3F& transform_origin, |
| 60 const gfx::PointF& position, | 64 const gfx::PointF& position, |
| 61 const gfx::Size& bounds, | 65 const gfx::Size& bounds, |
| 62 bool flatten_transform, | 66 bool flatten_transform, |
| 63 bool is_3d_sorted); | 67 bool is_3d_sorted, |
| 68 bool create_render_surface = false); | |
|
danakj
2014/08/26 18:06:13
no default parameters please. this violates the st
awoloszyn
2014/08/28 19:31:43
Done.
| |
| 64 | 69 |
| 65 void ExecuteCalculateDrawProperties(Layer* root_layer, | 70 void ExecuteCalculateDrawProperties(Layer* root_layer, |
| 66 float device_scale_factor, | 71 float device_scale_factor, |
| 67 float page_scale_factor, | 72 float page_scale_factor, |
| 68 Layer* page_scale_application_layer, | 73 Layer* page_scale_application_layer, |
| 69 bool can_use_lcd_text); | 74 bool can_use_lcd_text); |
| 70 | 75 |
| 71 void ExecuteCalculateDrawProperties(LayerImpl* root_layer, | 76 void ExecuteCalculateDrawProperties(LayerImpl* root_layer, |
| 72 float device_scale_factor, | 77 float device_scale_factor, |
| 73 float page_scale_factor, | 78 float page_scale_factor, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 122 | 127 |
| 123 int render_surface_layer_list_count_; | 128 int render_surface_layer_list_count_; |
| 124 }; | 129 }; |
| 125 | 130 |
| 126 class LayerTreeHostCommonTest : public LayerTreeHostCommonTestBase, | 131 class LayerTreeHostCommonTest : public LayerTreeHostCommonTestBase, |
| 127 public testing::Test {}; | 132 public testing::Test {}; |
| 128 | 133 |
| 129 } // namespace cc | 134 } // namespace cc |
| 130 | 135 |
| 131 #endif // CC_TEST_LAYER_TREE_HOST_COMMON_TEST_H_ | 136 #endif // CC_TEST_LAYER_TREE_HOST_COMMON_TEST_H_ |
| OLD | NEW |