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 <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1561 pending_layer->SetDrawsContent(true); | 1561 pending_layer->SetDrawsContent(true); |
1562 pending_tree->SetRootLayer(pending_layer.PassAs<LayerImpl>()); | 1562 pending_tree->SetRootLayer(pending_layer.PassAs<LayerImpl>()); |
1563 | 1563 |
1564 pending_layer_ = static_cast<FakePictureLayerImpl*>( | 1564 pending_layer_ = static_cast<FakePictureLayerImpl*>( |
1565 host_impl_.pending_tree()->LayerById(id_)); | 1565 host_impl_.pending_tree()->LayerById(id_)); |
1566 | 1566 |
1567 // Set some state on the pending layer, make sure it is not clobbered | 1567 // Set some state on the pending layer, make sure it is not clobbered |
1568 // by a sync from the active layer. This could happen because if the | 1568 // by a sync from the active layer. This could happen because if the |
1569 // pending layer has not been post-commit initialized it will attempt | 1569 // pending layer has not been post-commit initialized it will attempt |
1570 // to sync from the active layer. | 1570 // to sync from the active layer. |
1571 bool default_lcd_text_setting = pending_layer_->is_using_lcd_text(); | 1571 float raster_page_scale = 10.f * pending_layer_->raster_page_scale(); |
1572 pending_layer_->force_set_lcd_text(!default_lcd_text_setting); | 1572 pending_layer_->set_raster_page_scale(raster_page_scale); |
1573 EXPECT_TRUE(pending_layer_->needs_post_commit_initialization()); | 1573 EXPECT_TRUE(pending_layer_->needs_post_commit_initialization()); |
1574 | 1574 |
1575 host_impl_.ActivatePendingTree(); | 1575 host_impl_.ActivatePendingTree(); |
1576 | 1576 |
1577 active_layer_ = static_cast<FakePictureLayerImpl*>( | 1577 active_layer_ = static_cast<FakePictureLayerImpl*>( |
1578 host_impl_.active_tree()->LayerById(id_)); | 1578 host_impl_.active_tree()->LayerById(id_)); |
1579 | 1579 |
1580 EXPECT_EQ(0u, active_layer_->num_tilings()); | 1580 EXPECT_EQ(0u, active_layer_->num_tilings()); |
1581 EXPECT_EQ(!default_lcd_text_setting, active_layer_->is_using_lcd_text()); | 1581 EXPECT_EQ(raster_page_scale, active_layer_->raster_page_scale()); |
1582 EXPECT_FALSE(active_layer_->needs_post_commit_initialization()); | 1582 EXPECT_FALSE(active_layer_->needs_post_commit_initialization()); |
1583 } | 1583 } |
1584 | 1584 |
1585 TEST_F(PictureLayerImplTest, RemoveInvalidTilesOnActivation) { | 1585 TEST_F(PictureLayerImplTest, RemoveInvalidTilesOnActivation) { |
1586 SetupDefaultTrees(gfx::Size(1500, 1500)); | 1586 SetupDefaultTrees(gfx::Size(1500, 1500)); |
1587 AddDefaultTilingsWithInvalidation(gfx::Rect(0, 0, 1, 1)); | 1587 AddDefaultTilingsWithInvalidation(gfx::Rect(0, 0, 1, 1)); |
1588 | 1588 |
1589 FakePictureLayerImpl* recycled_layer = pending_layer_; | 1589 FakePictureLayerImpl* recycled_layer = pending_layer_; |
1590 host_impl_.ActivatePendingTree(); | 1590 host_impl_.ActivatePendingTree(); |
1591 | 1591 |
(...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2875 1.f, // maximum animation scale | 2875 1.f, // maximum animation scale |
2876 false, | 2876 false, |
2877 &result_scale_x, | 2877 &result_scale_x, |
2878 &result_scale_y, | 2878 &result_scale_y, |
2879 &result_bounds); | 2879 &result_bounds); |
2880 EXPECT_EQ(1u, pending_layer_->tilings()->num_tilings()); | 2880 EXPECT_EQ(1u, pending_layer_->tilings()->num_tilings()); |
2881 } | 2881 } |
2882 | 2882 |
2883 } // namespace | 2883 } // namespace |
2884 } // namespace cc | 2884 } // namespace cc |
OLD | NEW |