| 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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 EXPECT_TRUE(success); | 398 EXPECT_TRUE(success); |
| 399 | 399 |
| 400 viewport_rect_for_tile_priority_in_view_space = | 400 viewport_rect_for_tile_priority_in_view_space = |
| 401 gfx::ToEnclosingRect(MathUtil::ProjectClippedRect( | 401 gfx::ToEnclosingRect(MathUtil::ProjectClippedRect( |
| 402 screen_to_view, viewport_rect_for_tile_priority)); | 402 screen_to_view, viewport_rect_for_tile_priority)); |
| 403 | 403 |
| 404 // Verify the viewport rect for tile priority is used in PictureLayerImpl. | 404 // Verify the viewport rect for tile priority is used in PictureLayerImpl. |
| 405 EXPECT_EQ(active_layer_->viewport_rect_for_tile_priority(), | 405 EXPECT_EQ(active_layer_->viewport_rect_for_tile_priority(), |
| 406 viewport_rect_for_tile_priority_in_view_space); | 406 viewport_rect_for_tile_priority_in_view_space); |
| 407 | 407 |
| 408 // Interset viewport_rect_for_tile_priority_in_view_space with the layer | |
| 409 // bounds and the result should be used in PictureLayerTiling. | |
| 410 viewport_rect_for_tile_priority_in_view_space.Intersect( | |
| 411 gfx::Rect(layer_bounds)); | |
| 412 tilings = active_layer_->tilings(); | 408 tilings = active_layer_->tilings(); |
| 413 for (size_t i = 0; i < tilings->num_tilings(); i++) { | 409 for (size_t i = 0; i < tilings->num_tilings(); i++) { |
| 414 PictureLayerTiling* tiling = tilings->tiling_at(i); | 410 PictureLayerTiling* tiling = tilings->tiling_at(i); |
| 415 EXPECT_EQ( | 411 EXPECT_EQ( |
| 416 tiling->GetCurrentVisibleRectForTesting(), | 412 tiling->GetCurrentVisibleRectForTesting(), |
| 417 gfx::ScaleToEnclosingRect(viewport_rect_for_tile_priority_in_view_space, | 413 gfx::ScaleToEnclosingRect(viewport_rect_for_tile_priority_in_view_space, |
| 418 tiling->contents_scale())); | 414 tiling->contents_scale())); |
| 419 } | 415 } |
| 420 } | 416 } |
| 421 | 417 |
| (...skipping 3795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4217 ActivateTree(); | 4213 ActivateTree(); |
| 4218 EXPECT_TRUE(active_layer_->GetRecycledTwinLayer()); | 4214 EXPECT_TRUE(active_layer_->GetRecycledTwinLayer()); |
| 4219 EXPECT_EQ(old_pending_layer_, active_layer_->GetRecycledTwinLayer()); | 4215 EXPECT_EQ(old_pending_layer_, active_layer_->GetRecycledTwinLayer()); |
| 4220 | 4216 |
| 4221 host_impl_.ResetRecycleTreeForTesting(); | 4217 host_impl_.ResetRecycleTreeForTesting(); |
| 4222 EXPECT_FALSE(active_layer_->GetRecycledTwinLayer()); | 4218 EXPECT_FALSE(active_layer_->GetRecycledTwinLayer()); |
| 4223 } | 4219 } |
| 4224 | 4220 |
| 4225 } // namespace | 4221 } // namespace |
| 4226 } // namespace cc | 4222 } // namespace cc |
| OLD | NEW |