| 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 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1126 EXPECT_EQ(active_layer()->num_tilings(), 2u); | 1126 EXPECT_EQ(active_layer()->num_tilings(), 2u); |
| 1127 EXPECT_EQ(pending_layer()->num_tilings(), 1u); | 1127 EXPECT_EQ(pending_layer()->num_tilings(), 1u); |
| 1128 | 1128 |
| 1129 // Mask layers dont create low res since they always fit on one tile. | 1129 // Mask layers dont create low res since they always fit on one tile. |
| 1130 std::unique_ptr<FakePictureLayerImpl> mask = | 1130 std::unique_ptr<FakePictureLayerImpl> mask = |
| 1131 FakePictureLayerImpl::CreateMaskWithRasterSource( | 1131 FakePictureLayerImpl::CreateMaskWithRasterSource( |
| 1132 host_impl()->pending_tree(), 3, pending_raster_source); | 1132 host_impl()->pending_tree(), 3, pending_raster_source); |
| 1133 mask->SetBounds(layer_bounds); | 1133 mask->SetBounds(layer_bounds); |
| 1134 mask->SetDrawsContent(true); | 1134 mask->SetDrawsContent(true); |
| 1135 pending_layer()->test_properties()->SetMaskLayer(std::move(mask)); | 1135 pending_layer()->test_properties()->SetMaskLayer(std::move(mask)); |
| 1136 pending_layer()->SetHasRenderSurface(true); | 1136 pending_layer()->test_properties()->force_render_surface = true; |
| 1137 RebuildPropertyTreesOnPendingTree(); | 1137 RebuildPropertyTreesOnPendingTree(); |
| 1138 host_impl()->pending_tree()->UpdateDrawProperties(false); | 1138 host_impl()->pending_tree()->UpdateDrawProperties(false); |
| 1139 | 1139 |
| 1140 FakePictureLayerImpl* mask_raw = static_cast<FakePictureLayerImpl*>( | 1140 FakePictureLayerImpl* mask_raw = static_cast<FakePictureLayerImpl*>( |
| 1141 pending_layer()->test_properties()->mask_layer); | 1141 pending_layer()->test_properties()->mask_layer); |
| 1142 // We did an UpdateDrawProperties above, which will set a contents scale on | 1142 // We did an UpdateDrawProperties above, which will set a contents scale on |
| 1143 // the mask layer, so allow us to reset the contents scale. | 1143 // the mask layer, so allow us to reset the contents scale. |
| 1144 mask_raw->ReleaseTileResources(); | 1144 mask_raw->ReleaseTileResources(); |
| 1145 mask_raw->RecreateTileResources(); | 1145 mask_raw->RecreateTileResources(); |
| 1146 | 1146 |
| (...skipping 3776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4923 EXPECT_FLOAT_EQ(expected_contents_scale, | 4923 EXPECT_FLOAT_EQ(expected_contents_scale, |
| 4924 pending_layer_ptr->picture_layer_tiling_set() | 4924 pending_layer_ptr->picture_layer_tiling_set() |
| 4925 ->FindTilingWithResolution(HIGH_RESOLUTION) | 4925 ->FindTilingWithResolution(HIGH_RESOLUTION) |
| 4926 ->contents_scale()) | 4926 ->contents_scale()) |
| 4927 << "ideal_contents_scale: " << ideal_contents_scale; | 4927 << "ideal_contents_scale: " << ideal_contents_scale; |
| 4928 } | 4928 } |
| 4929 } | 4929 } |
| 4930 | 4930 |
| 4931 } // namespace | 4931 } // namespace |
| 4932 } // namespace cc | 4932 } // namespace cc |
| OLD | NEW |