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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 pending_layer->SetScrollClipLayer(new_pending_root->id()); | 241 pending_layer->SetScrollClipLayer(new_pending_root->id()); |
242 pending_root = new_pending_root.get(); | 242 pending_root = new_pending_root.get(); |
243 pending_tree->SetRootLayer(std::move(new_pending_root)); | 243 pending_tree->SetRootLayer(std::move(new_pending_root)); |
244 } else { | 244 } else { |
245 pending_layer.reset(static_cast<FakePictureLayerImpl*>( | 245 pending_layer.reset(static_cast<FakePictureLayerImpl*>( |
246 pending_root->RemoveChildForTesting(pending_root->children()[0]) | 246 pending_root->RemoveChildForTesting(pending_root->children()[0]) |
247 .release())); | 247 .release())); |
248 if (!tile_size.IsEmpty()) | 248 if (!tile_size.IsEmpty()) |
249 pending_layer->set_fixed_tile_size(tile_size); | 249 pending_layer->set_fixed_tile_size(tile_size); |
250 } | 250 } |
251 pending_root->SetForceRenderSurface(true); | 251 pending_root->test_properties()->force_render_surface = true; |
252 // The bounds() just mirror the raster source size. | 252 // The bounds() just mirror the raster source size. |
253 pending_layer->SetBounds(raster_source->GetSize()); | 253 pending_layer->SetBounds(raster_source->GetSize()); |
254 pending_layer->SetRasterSourceOnPending(raster_source, invalidation); | 254 pending_layer->SetRasterSourceOnPending(raster_source, invalidation); |
255 | 255 |
256 pending_root->AddChild(std::move(pending_layer)); | 256 pending_root->AddChild(std::move(pending_layer)); |
257 pending_tree->SetViewportLayersFromIds( | 257 pending_tree->SetViewportLayersFromIds( |
258 Layer::INVALID_ID, pending_tree->root_layer()->id(), Layer::INVALID_ID, | 258 Layer::INVALID_ID, pending_tree->root_layer()->id(), Layer::INVALID_ID, |
259 Layer::INVALID_ID); | 259 Layer::INVALID_ID); |
260 | 260 |
261 pending_layer_ = static_cast<FakePictureLayerImpl*>( | 261 pending_layer_ = static_cast<FakePictureLayerImpl*>( |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1299 scoped_refptr<FakeRasterSource> valid_raster_source = | 1299 scoped_refptr<FakeRasterSource> valid_raster_source = |
1300 FakeRasterSource::CreateFilled(layer_bounds); | 1300 FakeRasterSource::CreateFilled(layer_bounds); |
1301 SetupPendingTree(valid_raster_source); | 1301 SetupPendingTree(valid_raster_source); |
1302 | 1302 |
1303 std::unique_ptr<FakePictureLayerImpl> mask_ptr = | 1303 std::unique_ptr<FakePictureLayerImpl> mask_ptr = |
1304 FakePictureLayerImpl::CreateMaskWithRasterSource( | 1304 FakePictureLayerImpl::CreateMaskWithRasterSource( |
1305 host_impl_.pending_tree(), 3, valid_raster_source); | 1305 host_impl_.pending_tree(), 3, valid_raster_source); |
1306 mask_ptr->SetBounds(layer_bounds); | 1306 mask_ptr->SetBounds(layer_bounds); |
1307 mask_ptr->SetDrawsContent(true); | 1307 mask_ptr->SetDrawsContent(true); |
1308 pending_layer_->SetMaskLayer(std::move(mask_ptr)); | 1308 pending_layer_->SetMaskLayer(std::move(mask_ptr)); |
1309 pending_layer_->SetForceRenderSurface(true); | 1309 pending_layer_->test_properties()->force_render_surface = true; |
1310 | 1310 |
1311 RebuildPropertyTreesOnPendingTree(); | 1311 RebuildPropertyTreesOnPendingTree(); |
1312 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(1)); | 1312 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(1)); |
1313 bool update_lcd_text = false; | 1313 bool update_lcd_text = false; |
1314 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); | 1314 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); |
1315 | 1315 |
1316 FakePictureLayerImpl* pending_mask = | 1316 FakePictureLayerImpl* pending_mask = |
1317 static_cast<FakePictureLayerImpl*>(pending_layer_->mask_layer()); | 1317 static_cast<FakePictureLayerImpl*>(pending_layer_->mask_layer()); |
1318 | 1318 |
1319 EXPECT_EQ(1.f, pending_mask->HighResTiling()->contents_scale()); | 1319 EXPECT_EQ(1.f, pending_mask->HighResTiling()->contents_scale()); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1428 scoped_refptr<FakeRasterSource> valid_raster_source = | 1428 scoped_refptr<FakeRasterSource> valid_raster_source = |
1429 FakeRasterSource::CreateFilled(layer_bounds); | 1429 FakeRasterSource::CreateFilled(layer_bounds); |
1430 SetupPendingTree(valid_raster_source); | 1430 SetupPendingTree(valid_raster_source); |
1431 | 1431 |
1432 std::unique_ptr<FakePictureLayerImpl> mask_ptr = | 1432 std::unique_ptr<FakePictureLayerImpl> mask_ptr = |
1433 FakePictureLayerImpl::CreateMaskWithRasterSource( | 1433 FakePictureLayerImpl::CreateMaskWithRasterSource( |
1434 host_impl_.pending_tree(), 3, valid_raster_source); | 1434 host_impl_.pending_tree(), 3, valid_raster_source); |
1435 mask_ptr->SetBounds(layer_bounds); | 1435 mask_ptr->SetBounds(layer_bounds); |
1436 mask_ptr->SetDrawsContent(true); | 1436 mask_ptr->SetDrawsContent(true); |
1437 pending_layer_->SetMaskLayer(std::move(mask_ptr)); | 1437 pending_layer_->SetMaskLayer(std::move(mask_ptr)); |
1438 pending_layer_->SetForceRenderSurface(true); | 1438 pending_layer_->test_properties()->force_render_surface = true; |
1439 | 1439 |
1440 RebuildPropertyTreesOnPendingTree(); | 1440 RebuildPropertyTreesOnPendingTree(); |
1441 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(1)); | 1441 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(1)); |
1442 bool update_lcd_text = false; | 1442 bool update_lcd_text = false; |
1443 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); | 1443 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); |
1444 | 1444 |
1445 FakePictureLayerImpl* pending_mask = | 1445 FakePictureLayerImpl* pending_mask = |
1446 static_cast<FakePictureLayerImpl*>(pending_layer_->mask_layer()); | 1446 static_cast<FakePictureLayerImpl*>(pending_layer_->mask_layer()); |
1447 | 1447 |
1448 // Masks are scaled, and do not have a low res tiling. | 1448 // Masks are scaled, and do not have a low res tiling. |
(...skipping 3440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4889 // New low res tiling. | 4889 // New low res tiling. |
4890 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); | 4890 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); |
4891 | 4891 |
4892 // This tiling will be high res now, it won't contain low res content since it | 4892 // This tiling will be high res now, it won't contain low res content since it |
4893 // was all destroyed. | 4893 // was all destroyed. |
4894 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); | 4894 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); |
4895 } | 4895 } |
4896 | 4896 |
4897 } // namespace | 4897 } // namespace |
4898 } // namespace cc | 4898 } // namespace cc |
OLD | NEW |