| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 can_render_to_separate_surface, | 166 can_render_to_separate_surface, |
| 167 root_layer->layer_tree_impl()->property_trees(), | 167 root_layer->layer_tree_impl()->property_trees(), |
| 168 update_layer_list_impl_.get()); | 168 update_layer_list_impl_.get()); |
| 169 } | 169 } |
| 170 | 170 |
| 171 void LayerTreeHostCommonTestBase::ExecuteCalculateDrawProperties( | 171 void LayerTreeHostCommonTestBase::ExecuteCalculateDrawProperties( |
| 172 LayerImpl* root_layer, | 172 LayerImpl* root_layer, |
| 173 float device_scale_factor, | 173 float device_scale_factor, |
| 174 float page_scale_factor, | 174 float page_scale_factor, |
| 175 LayerImpl* page_scale_layer) { | 175 LayerImpl* page_scale_layer) { |
| 176 if (device_scale_factor != |
| 177 root_layer->layer_tree_impl()->device_scale_factor()) |
| 178 root_layer->layer_tree_impl()->property_trees()->needs_rebuild = true; |
| 179 |
| 176 root_layer->layer_tree_impl()->SetDeviceScaleFactor(device_scale_factor); | 180 root_layer->layer_tree_impl()->SetDeviceScaleFactor(device_scale_factor); |
| 177 | 181 |
| 178 EXPECT_TRUE(page_scale_layer || (page_scale_factor == 1.f)); | 182 EXPECT_TRUE(page_scale_layer || (page_scale_factor == 1.f)); |
| 179 | 183 |
| 180 gfx::Transform identity_matrix; | 184 gfx::Transform identity_matrix; |
| 181 gfx::Size device_viewport_size = | 185 gfx::Size device_viewport_size = |
| 182 gfx::Size(root_layer->bounds().width() * device_scale_factor, | 186 gfx::Size(root_layer->bounds().width() * device_scale_factor, |
| 183 root_layer->bounds().height() * device_scale_factor); | 187 root_layer->bounds().height() * device_scale_factor); |
| 184 | 188 |
| 185 render_surface_layer_list_impl_.reset(new LayerImplList); | 189 render_surface_layer_list_impl_.reset(new LayerImplList); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 | 228 |
| 225 LayerTreeHostCommonTest::LayerTreeHostCommonTest() | 229 LayerTreeHostCommonTest::LayerTreeHostCommonTest() |
| 226 : LayerTreeHostCommonTestBase(LayerTreeSettings()) {} | 230 : LayerTreeHostCommonTestBase(LayerTreeSettings()) {} |
| 227 | 231 |
| 228 LayerTreeHostCommonTest::LayerTreeHostCommonTest( | 232 LayerTreeHostCommonTest::LayerTreeHostCommonTest( |
| 229 const LayerTreeSettings& settings) | 233 const LayerTreeSettings& settings) |
| 230 : LayerTreeHostCommonTestBase(settings) { | 234 : LayerTreeHostCommonTestBase(settings) { |
| 231 } | 235 } |
| 232 | 236 |
| 233 } // namespace cc | 237 } // namespace cc |
| OLD | NEW |