Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(626)

Side by Side Diff: cc/layers/picture_layer_impl_unittest.cc

Issue 551013002: Use Custome ListContainer to Allocate SharedQuadState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DQAllo
Patch Set: rebase Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/nine_patch_layer_impl_unittest.cc ('k') | cc/layers/render_surface_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3483 matching lines...) Expand 10 before | Expand all | Expand 10 after
3494 SK_MScalar1 / max_contents_scale); 3494 SK_MScalar1 / max_contents_scale);
3495 3495
3496 AppendQuadsData data; 3496 AppendQuadsData data;
3497 active_layer_->AppendQuads(render_pass.get(), occlusion_tracker, &data); 3497 active_layer_->AppendQuads(render_pass.get(), occlusion_tracker, &data);
3498 3498
3499 // SharedQuadState should have be of size 1, as we are doing AppenQuad once. 3499 // SharedQuadState should have be of size 1, as we are doing AppenQuad once.
3500 EXPECT_EQ(1u, render_pass->shared_quad_state_list.size()); 3500 EXPECT_EQ(1u, render_pass->shared_quad_state_list.size());
3501 // The content_to_target_transform should be scaled by the 3501 // The content_to_target_transform should be scaled by the
3502 // MaximumTilingContentsScale on the layer. 3502 // MaximumTilingContentsScale on the layer.
3503 EXPECT_EQ(scaled_draw_transform.ToString(), 3503 EXPECT_EQ(scaled_draw_transform.ToString(),
3504 render_pass->shared_quad_state_list[0] 3504 render_pass->shared_quad_state_list.front()
3505 ->content_to_target_transform.ToString()); 3505 ->content_to_target_transform.ToString());
3506 // The content_bounds should be scaled by the 3506 // The content_bounds should be scaled by the
3507 // MaximumTilingContentsScale on the layer. 3507 // MaximumTilingContentsScale on the layer.
3508 EXPECT_EQ(gfx::Size(2500u, 5000u).ToString(), 3508 EXPECT_EQ(
3509 render_pass->shared_quad_state_list[0]->content_bounds.ToString()); 3509 gfx::Size(2500u, 5000u).ToString(),
3510 render_pass->shared_quad_state_list.front()->content_bounds.ToString());
3510 // The visible_content_rect should be scaled by the 3511 // The visible_content_rect should be scaled by the
3511 // MaximumTilingContentsScale on the layer. 3512 // MaximumTilingContentsScale on the layer.
3512 EXPECT_EQ( 3513 EXPECT_EQ(gfx::Rect(0u, 0u, 2500u, 5000u).ToString(),
3513 gfx::Rect(0u, 0u, 2500u, 5000u).ToString(), 3514 render_pass->shared_quad_state_list.front()
3514 render_pass->shared_quad_state_list[0]->visible_content_rect.ToString()); 3515 ->visible_content_rect.ToString());
3515 } 3516 }
3516 3517
3517 TEST_F(PictureLayerImplTest, UpdateTilesForMasksWithNoVisibleContent) { 3518 TEST_F(PictureLayerImplTest, UpdateTilesForMasksWithNoVisibleContent) {
3518 gfx::Size tile_size(400, 400); 3519 gfx::Size tile_size(400, 400);
3519 gfx::Size bounds(100000, 100); 3520 gfx::Size bounds(100000, 100);
3520 3521
3521 host_impl_.CreatePendingTree(); 3522 host_impl_.CreatePendingTree();
3522 3523
3523 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_.pending_tree(), 1); 3524 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_.pending_tree(), 1);
3524 3525
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after
4401 SetupPendingTree(pending_pile2); 4402 SetupPendingTree(pending_pile2);
4402 ActivateTree(); 4403 ActivateTree();
4403 4404
4404 // We've switched to a solid color, so we should end up with no tilings. 4405 // We've switched to a solid color, so we should end up with no tilings.
4405 ASSERT_TRUE(active_layer_->tilings()); 4406 ASSERT_TRUE(active_layer_->tilings());
4406 EXPECT_EQ(0u, active_layer_->tilings()->num_tilings()); 4407 EXPECT_EQ(0u, active_layer_->tilings()->num_tilings());
4407 } 4408 }
4408 4409
4409 } // namespace 4410 } // namespace
4410 } // namespace cc 4411 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/nine_patch_layer_impl_unittest.cc ('k') | cc/layers/render_surface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698