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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 // We don't create tiles in non-invalidated regions. | 531 // We don't create tiles in non-invalidated regions. |
532 EXPECT_FALSE(iter.geometry_rect().Intersects(content_invalidation)); | 532 EXPECT_FALSE(iter.geometry_rect().Intersects(content_invalidation)); |
533 } | 533 } |
534 } | 534 } |
535 } | 535 } |
536 | 536 |
537 tilings = active_layer()->tilings(); | 537 tilings = active_layer()->tilings(); |
538 EXPECT_GT(tilings->num_tilings(), 0u); | 538 EXPECT_GT(tilings->num_tilings(), 0u); |
539 for (size_t i = 0; i < tilings->num_tilings(); ++i) { | 539 for (size_t i = 0; i < tilings->num_tilings(); ++i) { |
540 const PictureLayerTiling* tiling = tilings->tiling_at(i); | 540 const PictureLayerTiling* tiling = tilings->tiling_at(i); |
541 gfx::Rect content_invalidation = | |
542 gfx::ScaleToEnclosingRect(layer_invalidation, tiling->contents_scale()); | |
543 auto prioritized_tiles = | 541 auto prioritized_tiles = |
544 tiling->UpdateAndGetAllPrioritizedTilesForTesting(); | 542 tiling->UpdateAndGetAllPrioritizedTilesForTesting(); |
545 for (PictureLayerTiling::CoverageIterator iter( | 543 for (PictureLayerTiling::CoverageIterator iter( |
546 tiling, | 544 tiling, |
547 tiling->contents_scale(), | 545 tiling->contents_scale(), |
548 gfx::Rect(tiling->tiling_size())); | 546 gfx::Rect(tiling->tiling_size())); |
549 iter; | 547 iter; |
550 ++iter) { | 548 ++iter) { |
551 EXPECT_TRUE(*iter); | 549 EXPECT_TRUE(*iter); |
552 EXPECT_FALSE(iter.geometry_rect().IsEmpty()); | 550 EXPECT_FALSE(iter.geometry_rect().IsEmpty()); |
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1633 gfx::Size layer_bounds(400, 400); | 1631 gfx::Size layer_bounds(400, 400); |
1634 gfx::Rect external_viewport_for_tile_priority(400, 200); | 1632 gfx::Rect external_viewport_for_tile_priority(400, 200); |
1635 gfx::Rect visible_layer_rect(200, 400); | 1633 gfx::Rect visible_layer_rect(200, 400); |
1636 | 1634 |
1637 SetupDefaultTreesWithFixedTileSize(layer_bounds, tile_size, Region()); | 1635 SetupDefaultTreesWithFixedTileSize(layer_bounds, tile_size, Region()); |
1638 | 1636 |
1639 ASSERT_EQ(1u, pending_layer()->num_tilings()); | 1637 ASSERT_EQ(1u, pending_layer()->num_tilings()); |
1640 ASSERT_EQ(1.f, pending_layer()->HighResTiling()->contents_scale()); | 1638 ASSERT_EQ(1.f, pending_layer()->HighResTiling()->contents_scale()); |
1641 | 1639 |
1642 // Set external viewport for tile priority. | 1640 // Set external viewport for tile priority. |
1643 gfx::Rect viewport = gfx::Rect(layer_bounds); | |
1644 gfx::Transform transform; | 1641 gfx::Transform transform; |
1645 gfx::Transform transform_for_tile_priority; | 1642 gfx::Transform transform_for_tile_priority; |
1646 host_impl()->SetExternalTilePriorityConstraints( | 1643 host_impl()->SetExternalTilePriorityConstraints( |
1647 external_viewport_for_tile_priority, transform_for_tile_priority); | 1644 external_viewport_for_tile_priority, transform_for_tile_priority); |
1648 host_impl()->AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(1)); | 1645 host_impl()->AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(1)); |
1649 bool update_lcd_text = false; | 1646 bool update_lcd_text = false; |
1650 host_impl()->pending_tree()->UpdateDrawProperties(update_lcd_text); | 1647 host_impl()->pending_tree()->UpdateDrawProperties(update_lcd_text); |
1651 | 1648 |
1652 // Set visible content rect that is different from | 1649 // Set visible content rect that is different from |
1653 // external_viewport_for_tile_priority. | 1650 // external_viewport_for_tile_priority. |
(...skipping 3109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4763 // New low res tiling. | 4760 // New low res tiling. |
4764 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); | 4761 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); |
4765 | 4762 |
4766 // This tiling will be high res now, it won't contain low res content since it | 4763 // This tiling will be high res now, it won't contain low res content since it |
4767 // was all destroyed. | 4764 // was all destroyed. |
4768 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); | 4765 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); |
4769 } | 4766 } |
4770 | 4767 |
4771 } // namespace | 4768 } // namespace |
4772 } // namespace cc | 4769 } // namespace cc |
OLD | NEW |