| 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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 | 517 |
| 518 gfx::Transform screen_to_view(gfx::Transform::kSkipInitialization); | 518 gfx::Transform screen_to_view(gfx::Transform::kSkipInitialization); |
| 519 bool success = transform_for_tile_priority.GetInverse(&screen_to_view); | 519 bool success = transform_for_tile_priority.GetInverse(&screen_to_view); |
| 520 EXPECT_TRUE(success); | 520 EXPECT_TRUE(success); |
| 521 | 521 |
| 522 // Note that we don't clip this to the layer bounds, since it is expected that | 522 // Note that we don't clip this to the layer bounds, since it is expected that |
| 523 // the rect will sometimes be outside of the layer bounds. If we clip to | 523 // the rect will sometimes be outside of the layer bounds. If we clip to |
| 524 // bounds, then tile priorities will end up being incorrect in cases of fully | 524 // bounds, then tile priorities will end up being incorrect in cases of fully |
| 525 // offscreen layer. | 525 // offscreen layer. |
| 526 viewport_rect_for_tile_priority_in_view_space = | 526 viewport_rect_for_tile_priority_in_view_space = |
| 527 gfx::ToEnclosingRect(MathUtil::ProjectClippedRect( | 527 MathUtil::ProjectEnclosingClippedRect(screen_to_view, |
| 528 screen_to_view, viewport_rect_for_tile_priority)); | 528 viewport_rect_for_tile_priority); |
| 529 | 529 |
| 530 EXPECT_EQ(viewport_rect_for_tile_priority_in_view_space, | 530 EXPECT_EQ(viewport_rect_for_tile_priority_in_view_space, |
| 531 active_layer_->viewport_rect_for_tile_priority_in_content_space()); | 531 active_layer_->viewport_rect_for_tile_priority_in_content_space()); |
| 532 tilings = active_layer_->tilings(); | 532 tilings = active_layer_->tilings(); |
| 533 for (size_t i = 0; i < tilings->num_tilings(); i++) { | 533 for (size_t i = 0; i < tilings->num_tilings(); i++) { |
| 534 PictureLayerTiling* tiling = tilings->tiling_at(i); | 534 PictureLayerTiling* tiling = tilings->tiling_at(i); |
| 535 EXPECT_EQ( | 535 EXPECT_EQ( |
| 536 tiling->GetCurrentVisibleRectForTesting(), | 536 tiling->GetCurrentVisibleRectForTesting(), |
| 537 gfx::ScaleToEnclosingRect(viewport_rect_for_tile_priority_in_view_space, | 537 gfx::ScaleToEnclosingRect(viewport_rect_for_tile_priority_in_view_space, |
| 538 tiling->contents_scale())); | 538 tiling->contents_scale())); |
| (...skipping 4559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5098 // New low res tiling. | 5098 // New low res tiling. |
| 5099 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); | 5099 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); |
| 5100 | 5100 |
| 5101 // This tiling will be high res now, it won't contain low res content since it | 5101 // This tiling will be high res now, it won't contain low res content since it |
| 5102 // was all destroyed. | 5102 // was all destroyed. |
| 5103 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); | 5103 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); |
| 5104 } | 5104 } |
| 5105 | 5105 |
| 5106 } // namespace | 5106 } // namespace |
| 5107 } // namespace cc | 5107 } // namespace cc |
| OLD | NEW |