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 4734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4745 | 4745 |
4746 SetupPendingTreeWithFixedTileSize(active_pile, tile_size, Region()); | 4746 SetupPendingTreeWithFixedTileSize(active_pile, tile_size, Region()); |
4747 | 4747 |
4748 ActivateTree(); | 4748 ActivateTree(); |
4749 EXPECT_TRUE(active_layer_->HighResTiling()->has_tiles()); | 4749 EXPECT_TRUE(active_layer_->HighResTiling()->has_tiles()); |
4750 | 4750 |
4751 host_impl_.SetExternalDrawConstraints( | 4751 host_impl_.SetExternalDrawConstraints( |
4752 gfx::Transform(), // transform | 4752 gfx::Transform(), // transform |
4753 gfx::Rect(), // clip | 4753 gfx::Rect(), // clip |
4754 gfx::Rect(), // viewport | 4754 gfx::Rect(), // viewport |
4755 gfx::Rect(0, 1000, 100, 100), // viewport_rect_for_tile_priority | 4755 gfx::Rect(0, 5000, 100, 100), // viewport_rect_for_tile_priority |
4756 gfx::Transform(), // transform_for_tile_priority | 4756 gfx::Transform(), // transform_for_tile_priority |
4757 false); | 4757 false); |
4758 | 4758 |
4759 SetupPendingTreeWithFixedTileSize(pending_pile, tile_size, gfx::Rect()); | 4759 SetupPendingTreeWithFixedTileSize(pending_pile, tile_size, gfx::Rect()); |
4760 | 4760 |
4761 EXPECT_FALSE(pending_layer_->HighResTiling()->has_tiles()); | 4761 EXPECT_FALSE(pending_layer_->HighResTiling()->has_tiles()); |
4762 EXPECT_TRUE(pending_layer_->HighResTiling()->live_tiles_rect().IsEmpty()); | 4762 EXPECT_TRUE(pending_layer_->HighResTiling()->live_tiles_rect().IsEmpty()); |
4763 ActivateTree(); | 4763 ActivateTree(); |
4764 EXPECT_FALSE(active_layer_->HighResTiling()->has_tiles()); | 4764 EXPECT_FALSE(active_layer_->HighResTiling()->has_tiles()); |
4765 EXPECT_TRUE(active_layer_->HighResTiling()->live_tiles_rect().IsEmpty()); | 4765 EXPECT_TRUE(active_layer_->HighResTiling()->live_tiles_rect().IsEmpty()); |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4993 // Zoom out to exactly the low res factor so that the previous high res | 4993 // Zoom out to exactly the low res factor so that the previous high res |
4994 // would be equal to the current low res (if it were possible to have one). | 4994 // would be equal to the current low res (if it were possible to have one). |
4995 float zoomed = page_scale / low_res_factor; | 4995 float zoomed = page_scale / low_res_factor; |
4996 SetContentsScaleOnBothLayers(zoomed, 1.0f, zoomed, 1.0f, 0.f, false); | 4996 SetContentsScaleOnBothLayers(zoomed, 1.0f, zoomed, 1.0f, 0.f, false); |
4997 EXPECT_EQ(1u, pending_layer_->num_tilings()); | 4997 EXPECT_EQ(1u, pending_layer_->num_tilings()); |
4998 EXPECT_EQ(zoomed, pending_layer_->tilings()->tiling_at(0)->contents_scale()); | 4998 EXPECT_EQ(zoomed, pending_layer_->tilings()->tiling_at(0)->contents_scale()); |
4999 } | 4999 } |
5000 | 5000 |
5001 } // namespace | 5001 } // namespace |
5002 } // namespace cc | 5002 } // namespace cc |
OLD | NEW |