| 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" |
| 11 #include "cc/test/fake_layer_tree_host.h" | 11 #include "cc/test/fake_layer_tree_host.h" |
| 12 #include "cc/trees/draw_property_utils.h" | 12 #include "cc/trees/draw_property_utils.h" |
| 13 #include "cc/trees/layer_tree_host_common.h" | 13 #include "cc/trees/layer_tree_host_common.h" |
| 14 #include "cc/trees/property_tree_builder.h" |
| 14 | 15 |
| 15 namespace cc { | 16 namespace cc { |
| 16 LayerTreeHostCommonTestBase::LayerTreeHostCommonTestBase( | 17 LayerTreeHostCommonTestBase::LayerTreeHostCommonTestBase( |
| 17 const LayerTreeSettings& settings) | 18 const LayerTreeSettings& settings) |
| 18 : LayerTestCommon::LayerImplTest(settings), | 19 : LayerTestCommon::LayerImplTest(settings), |
| 19 render_surface_layer_list_count_(0) { | 20 render_surface_layer_list_count_(0) { |
| 20 } | 21 } |
| 21 | 22 |
| 22 LayerTreeHostCommonTestBase::~LayerTreeHostCommonTestBase() { | 23 LayerTreeHostCommonTestBase::~LayerTreeHostCommonTestBase() { |
| 23 } | 24 } |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 root_layer->layer_tree_host()->outer_viewport_scroll_layer(); | 109 root_layer->layer_tree_host()->outer_viewport_scroll_layer(); |
| 109 const Layer* overscroll_elasticity_layer = | 110 const Layer* overscroll_elasticity_layer = |
| 110 root_layer->layer_tree_host()->overscroll_elasticity_layer(); | 111 root_layer->layer_tree_host()->overscroll_elasticity_layer(); |
| 111 gfx::Vector2dF elastic_overscroll = | 112 gfx::Vector2dF elastic_overscroll = |
| 112 root_layer->layer_tree_host()->elastic_overscroll(); | 113 root_layer->layer_tree_host()->elastic_overscroll(); |
| 113 float page_scale_factor = 1.f; | 114 float page_scale_factor = 1.f; |
| 114 float device_scale_factor = 1.f; | 115 float device_scale_factor = 1.f; |
| 115 gfx::Size device_viewport_size = | 116 gfx::Size device_viewport_size = |
| 116 gfx::Size(root_layer->bounds().width() * device_scale_factor, | 117 gfx::Size(root_layer->bounds().width() * device_scale_factor, |
| 117 root_layer->bounds().height() * device_scale_factor); | 118 root_layer->bounds().height() * device_scale_factor); |
| 118 draw_property_utils::BuildPropertyTreesAndComputeVisibleRects( | 119 PropertyTrees* property_trees = |
| 120 root_layer->layer_tree_host()->property_trees(); |
| 121 update_layer_list_.clear(); |
| 122 PropertyTreeBuilder::BuildPropertyTrees( |
| 119 root_layer, page_scale_layer, inner_viewport_scroll_layer, | 123 root_layer, page_scale_layer, inner_viewport_scroll_layer, |
| 120 outer_viewport_scroll_layer, overscroll_elasticity_layer, | 124 outer_viewport_scroll_layer, overscroll_elasticity_layer, |
| 121 elastic_overscroll, page_scale_factor, device_scale_factor, | 125 elastic_overscroll, page_scale_factor, device_scale_factor, |
| 122 gfx::Rect(device_viewport_size), identity_transform, | 126 gfx::Rect(device_viewport_size), identity_transform, property_trees); |
| 123 can_render_to_separate_surface, | 127 draw_property_utils::UpdateRenderSurfaces(root_layer, property_trees); |
| 124 root_layer->layer_tree_host()->property_trees(), &update_layer_list_); | 128 draw_property_utils::UpdatePropertyTrees(property_trees, |
| 129 can_render_to_separate_surface); |
| 130 draw_property_utils::FindLayersThatNeedUpdates( |
| 131 root_layer, property_trees->transform_tree, property_trees->effect_tree, |
| 132 &update_layer_list_); |
| 133 draw_property_utils::ComputeVisibleRectsForTesting( |
| 134 property_trees, can_render_to_separate_surface, &update_layer_list_); |
| 125 } | 135 } |
| 126 | 136 |
| 127 void LayerTreeHostCommonTestBase:: | 137 void LayerTreeHostCommonTestBase:: |
| 128 ExecuteCalculateDrawPropertiesWithPropertyTrees(LayerImpl* root_layer) { | 138 ExecuteCalculateDrawPropertiesWithPropertyTrees(LayerImpl* root_layer) { |
| 129 DCHECK(root_layer->layer_tree_impl()); | 139 DCHECK(root_layer->layer_tree_impl()); |
| 130 LayerTreeHostCommon::PreCalculateMetaInformationForTesting(root_layer); | 140 LayerTreeHostCommon::PreCalculateMetaInformationForTesting(root_layer); |
| 131 | 141 |
| 132 gfx::Transform identity_transform; | 142 gfx::Transform identity_transform; |
| 133 | 143 |
| 134 bool can_render_to_separate_surface = true; | 144 bool can_render_to_separate_surface = true; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 | 237 |
| 228 LayerTreeHostCommonTest::LayerTreeHostCommonTest() | 238 LayerTreeHostCommonTest::LayerTreeHostCommonTest() |
| 229 : LayerTreeHostCommonTestBase(LayerTreeSettings()) {} | 239 : LayerTreeHostCommonTestBase(LayerTreeSettings()) {} |
| 230 | 240 |
| 231 LayerTreeHostCommonTest::LayerTreeHostCommonTest( | 241 LayerTreeHostCommonTest::LayerTreeHostCommonTest( |
| 232 const LayerTreeSettings& settings) | 242 const LayerTreeSettings& settings) |
| 233 : LayerTreeHostCommonTestBase(settings) { | 243 : LayerTreeHostCommonTestBase(settings) { |
| 234 } | 244 } |
| 235 | 245 |
| 236 } // namespace cc | 246 } // namespace cc |
| OLD | NEW |