| 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 3446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3457 SK_MScalar1 / max_contents_scale); | 3457 SK_MScalar1 / max_contents_scale); |
| 3458 | 3458 |
| 3459 AppendQuadsData data; | 3459 AppendQuadsData data; |
| 3460 active_layer_->AppendQuads(render_pass.get(), occlusion_tracker, &data); | 3460 active_layer_->AppendQuads(render_pass.get(), occlusion_tracker, &data); |
| 3461 | 3461 |
| 3462 // SharedQuadState should have be of size 1, as we are doing AppenQuad once. | 3462 // SharedQuadState should have be of size 1, as we are doing AppenQuad once. |
| 3463 EXPECT_EQ(1u, render_pass->shared_quad_state_list.size()); | 3463 EXPECT_EQ(1u, render_pass->shared_quad_state_list.size()); |
| 3464 // The content_to_target_transform should be scaled by the | 3464 // The content_to_target_transform should be scaled by the |
| 3465 // MaximumTilingContentsScale on the layer. | 3465 // MaximumTilingContentsScale on the layer. |
| 3466 EXPECT_EQ(scaled_draw_transform.ToString(), | 3466 EXPECT_EQ(scaled_draw_transform.ToString(), |
| 3467 render_pass->shared_quad_state_list[0] | 3467 render_pass->shared_quad_state_list.front() |
| 3468 ->content_to_target_transform.ToString()); | 3468 ->content_to_target_transform.ToString()); |
| 3469 // The content_bounds should be scaled by the | 3469 // The content_bounds should be scaled by the |
| 3470 // MaximumTilingContentsScale on the layer. | 3470 // MaximumTilingContentsScale on the layer. |
| 3471 EXPECT_EQ(gfx::Size(2500u, 5000u).ToString(), | 3471 EXPECT_EQ( |
| 3472 render_pass->shared_quad_state_list[0]->content_bounds.ToString()); | 3472 gfx::Size(2500u, 5000u).ToString(), |
| 3473 render_pass->shared_quad_state_list.front()->content_bounds.ToString()); |
| 3473 // The visible_content_rect should be scaled by the | 3474 // The visible_content_rect should be scaled by the |
| 3474 // MaximumTilingContentsScale on the layer. | 3475 // MaximumTilingContentsScale on the layer. |
| 3475 EXPECT_EQ( | 3476 EXPECT_EQ(gfx::Rect(0u, 0u, 2500u, 5000u).ToString(), |
| 3476 gfx::Rect(0u, 0u, 2500u, 5000u).ToString(), | 3477 render_pass->shared_quad_state_list.front() |
| 3477 render_pass->shared_quad_state_list[0]->visible_content_rect.ToString()); | 3478 ->visible_content_rect.ToString()); |
| 3478 } | 3479 } |
| 3479 | 3480 |
| 3480 TEST_F(PictureLayerImplTest, UpdateTilesForMasksWithNoVisibleContent) { | 3481 TEST_F(PictureLayerImplTest, UpdateTilesForMasksWithNoVisibleContent) { |
| 3481 gfx::Size tile_size(400, 400); | 3482 gfx::Size tile_size(400, 400); |
| 3482 gfx::Size bounds(100000, 100); | 3483 gfx::Size bounds(100000, 100); |
| 3483 | 3484 |
| 3484 host_impl_.CreatePendingTree(); | 3485 host_impl_.CreatePendingTree(); |
| 3485 | 3486 |
| 3486 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_.pending_tree(), 1); | 3487 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_.pending_tree(), 1); |
| 3487 | 3488 |
| (...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4365 SetupPendingTree(pending_pile2); | 4366 SetupPendingTree(pending_pile2); |
| 4366 ActivateTree(); | 4367 ActivateTree(); |
| 4367 | 4368 |
| 4368 // We've switched to a solid color, so we should end up with no tilings. | 4369 // We've switched to a solid color, so we should end up with no tilings. |
| 4369 ASSERT_TRUE(active_layer_->tilings()); | 4370 ASSERT_TRUE(active_layer_->tilings()); |
| 4370 EXPECT_EQ(0u, active_layer_->tilings()->num_tilings()); | 4371 EXPECT_EQ(0u, active_layer_->tilings()->num_tilings()); |
| 4371 } | 4372 } |
| 4372 | 4373 |
| 4373 } // namespace | 4374 } // namespace |
| 4374 } // namespace cc | 4375 } // namespace cc |
| OLD | NEW |