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 #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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 160 } | 160 } |
| 161 | 161 |
| 162 void LayerTreeHostCommonTestBase::ExecuteCalculateDrawProperties( | 162 void LayerTreeHostCommonTestBase::ExecuteCalculateDrawProperties( |
| 163 LayerImpl* root_layer, | 163 LayerImpl* root_layer, |
| 164 float device_scale_factor, | 164 float device_scale_factor, |
| 165 float page_scale_factor, | 165 float page_scale_factor, |
| 166 LayerImpl* page_scale_layer, | 166 LayerImpl* page_scale_layer, |
| 167 bool can_use_lcd_text, | 167 bool can_use_lcd_text, |
| 168 bool layers_always_allowed_lcd_text) { | 168 bool layers_always_allowed_lcd_text) { |
| 169 host_impl()->active_tree()->SetDeviceScaleFactor(device_scale_factor); | 169 host_impl()->active_tree()->SetDeviceScaleFactor(device_scale_factor); |
| 170 host_impl()->active_tree()->SetPageScaleOnActiveTree(page_scale_factor); | 170 if (host_impl()->active_tree()->property_trees()->needs_rebuild) |
|
ajuma
2016/03/22 14:41:54
Why does this depend on whether we need to rebuild
jaydasika
2016/03/22 20:48:34
Whoops, it should be the other way around, if we a
| |
| 171 host_impl()->active_tree()->SetPageScaleOnActiveTree(page_scale_factor); | |
| 171 | 172 |
| 172 gfx::Transform identity_matrix; | 173 gfx::Transform identity_matrix; |
| 173 gfx::Size device_viewport_size = | 174 gfx::Size device_viewport_size = |
| 174 gfx::Size(root_layer->bounds().width() * device_scale_factor, | 175 gfx::Size(root_layer->bounds().width() * device_scale_factor, |
| 175 root_layer->bounds().height() * device_scale_factor); | 176 root_layer->bounds().height() * device_scale_factor); |
| 176 | 177 |
| 177 render_surface_layer_list_impl_.reset(new LayerImplList); | 178 render_surface_layer_list_impl_.reset(new LayerImplList); |
| 178 | 179 |
| 179 // We are probably not testing what is intended if the root_layer bounds are | 180 // We are probably not testing what is intended if the root_layer bounds are |
| 180 // empty. | 181 // empty. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 228 | 229 |
| 229 LayerTreeHostCommonTest::LayerTreeHostCommonTest() | 230 LayerTreeHostCommonTest::LayerTreeHostCommonTest() |
| 230 : LayerTreeHostCommonTestBase(LayerTreeSettings()) {} | 231 : LayerTreeHostCommonTestBase(LayerTreeSettings()) {} |
| 231 | 232 |
| 232 LayerTreeHostCommonTest::LayerTreeHostCommonTest( | 233 LayerTreeHostCommonTest::LayerTreeHostCommonTest( |
| 233 const LayerTreeSettings& settings) | 234 const LayerTreeSettings& settings) |
| 234 : LayerTreeHostCommonTestBase(settings) { | 235 : LayerTreeHostCommonTestBase(settings) { |
| 235 } | 236 } |
| 236 | 237 |
| 237 } // namespace cc | 238 } // namespace cc |
| OLD | NEW |