| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 void AssertNoTilesRequired(PictureLayerTiling* tiling) { | 263 void AssertNoTilesRequired(PictureLayerTiling* tiling) { |
| 264 std::vector<Tile*> tiles = tiling->AllTilesForTesting(); | 264 std::vector<Tile*> tiles = tiling->AllTilesForTesting(); |
| 265 for (size_t i = 0; i < tiles.size(); ++i) | 265 for (size_t i = 0; i < tiles.size(); ++i) |
| 266 EXPECT_FALSE(tiles[i]->required_for_activation()) << "i: " << i; | 266 EXPECT_FALSE(tiles[i]->required_for_activation()) << "i: " << i; |
| 267 EXPECT_GT(tiles.size(), 0u); | 267 EXPECT_GT(tiles.size(), 0u); |
| 268 } | 268 } |
| 269 | 269 |
| 270 void SetInitialDeviceScaleFactor(float device_scale_factor) { | 270 void SetInitialDeviceScaleFactor(float device_scale_factor) { |
| 271 // Device scale factor is a per-tree property. However, tests can't directly | 271 // Device scale factor is a per-tree property. However, tests can't directly |
| 272 // set the pending tree's device scale factor before the pending tree is | 272 // set the pending tree's device scale factor before the pending tree is |
| 273 // created, and setting it after SetupPendingTreeis too late, since | 273 // created, and setting it after SetupPendingTree is too late, since |
| 274 // draw properties will already have been updated on the tree. To handle | 274 // draw properties will already have been updated on the tree. To handle |
| 275 // this, we initially set only the active tree's device scale factor, and we | 275 // this, we initially set only the active tree's device scale factor, and we |
| 276 // copy this over to the pending tree inside SetupPendingTree. | 276 // copy this over to the pending tree inside SetupPendingTree. |
| 277 host_impl()->active_tree()->SetDeviceScaleFactor(device_scale_factor); | 277 host_impl()->active_tree()->SetDeviceScaleFactor(device_scale_factor); |
| 278 } | 278 } |
| 279 | 279 |
| 280 void TestQuadsForSolidColor(bool test_for_solid); | 280 void TestQuadsForSolidColor(bool test_for_solid); |
| 281 }; | 281 }; |
| 282 | 282 |
| 283 class NoLowResPictureLayerImplTest : public PictureLayerImplTest { | 283 class NoLowResPictureLayerImplTest : public PictureLayerImplTest { |
| (...skipping 4732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5016 EXPECT_FLOAT_EQ(expected_contents_scale, | 5016 EXPECT_FLOAT_EQ(expected_contents_scale, |
| 5017 pending_layer_ptr->picture_layer_tiling_set() | 5017 pending_layer_ptr->picture_layer_tiling_set() |
| 5018 ->FindTilingWithResolution(HIGH_RESOLUTION) | 5018 ->FindTilingWithResolution(HIGH_RESOLUTION) |
| 5019 ->contents_scale()) | 5019 ->contents_scale()) |
| 5020 << "ideal_contents_scale: " << ideal_contents_scale; | 5020 << "ideal_contents_scale: " << ideal_contents_scale; |
| 5021 } | 5021 } |
| 5022 } | 5022 } |
| 5023 | 5023 |
| 5024 } // namespace | 5024 } // namespace |
| 5025 } // namespace cc | 5025 } // namespace cc |
| OLD | NEW |