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

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

Issue 306683002: MockQC stops create its own RP and MockOcclusionTracker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@testocclusiontracking
Patch Set: rebase Created 6 years, 6 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/picture_image_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 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 high_res_tiling = pending_layer_->tilings()->tiling_at(0); 1209 high_res_tiling = pending_layer_->tilings()->tiling_at(0);
1210 EXPECT_LT(1u, high_res_tiling->AllTilesForTesting().size()); 1210 EXPECT_LT(1u, high_res_tiling->AllTilesForTesting().size());
1211 1211
1212 // Verify the tiles are not larger than the context's max texture size. 1212 // Verify the tiles are not larger than the context's max texture size.
1213 Tile* tile = pending_layer_->tilings()->tiling_at(0)->AllTilesForTesting()[0]; 1213 Tile* tile = pending_layer_->tilings()->tiling_at(0)->AllTilesForTesting()[0];
1214 EXPECT_GE(140, tile->content_rect().width()); 1214 EXPECT_GE(140, tile->content_rect().width());
1215 EXPECT_GE(140, tile->content_rect().height()); 1215 EXPECT_GE(140, tile->content_rect().height());
1216 } 1216 }
1217 1217
1218 TEST_F(PictureLayerImplTest, DisallowTileDrawQuads) { 1218 TEST_F(PictureLayerImplTest, DisallowTileDrawQuads) {
1219 MockQuadCuller quad_culler; 1219 MockOcclusionTracker<LayerImpl> occlusion_tracker;
1220 scoped_ptr<RenderPass> render_pass = RenderPass::Create();
1221 MockQuadCuller quad_culler(render_pass.get(), &occlusion_tracker);
1220 1222
1221 gfx::Size tile_size(400, 400); 1223 gfx::Size tile_size(400, 400);
1222 gfx::Size layer_bounds(1300, 1900); 1224 gfx::Size layer_bounds(1300, 1900);
1223 1225
1224 scoped_refptr<FakePicturePileImpl> pending_pile = 1226 scoped_refptr<FakePicturePileImpl> pending_pile =
1225 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); 1227 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
1226 scoped_refptr<FakePicturePileImpl> active_pile = 1228 scoped_refptr<FakePicturePileImpl> active_pile =
1227 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); 1229 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
1228 1230
1229 SetupTrees(pending_pile, active_pile); 1231 SetupTrees(pending_pile, active_pile);
(...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after
2717 SetupDrawPropertiesAndManageTilings(pending_layer_, 2719 SetupDrawPropertiesAndManageTilings(pending_layer_,
2718 1.3f, // ideal contents scale 2720 1.3f, // ideal contents scale
2719 2.7f, // device scale 2721 2.7f, // device scale
2720 3.2f, // page scale 2722 3.2f, // page scale
2721 1.f, // maximum animation scale 2723 1.f, // maximum animation scale
2722 false); 2724 false);
2723 EXPECT_EQ(1u, pending_layer_->tilings()->num_tilings()); 2725 EXPECT_EQ(1u, pending_layer_->tilings()->num_tilings());
2724 } 2726 }
2725 2727
2726 TEST_F(PictureLayerImplTest, SharedQuadStateContainsMaxTilingScale) { 2728 TEST_F(PictureLayerImplTest, SharedQuadStateContainsMaxTilingScale) {
2727 MockQuadCuller quad_culler; 2729 MockOcclusionTracker<LayerImpl> occlusion_tracker;
2730 scoped_ptr<RenderPass> render_pass = RenderPass::Create();
2731 MockQuadCuller quad_culler(render_pass.get(), &occlusion_tracker);
2728 2732
2729 gfx::Size tile_size(400, 400); 2733 gfx::Size tile_size(400, 400);
2730 gfx::Size layer_bounds(1000, 2000); 2734 gfx::Size layer_bounds(1000, 2000);
2731 2735
2732 scoped_refptr<FakePicturePileImpl> pending_pile = 2736 scoped_refptr<FakePicturePileImpl> pending_pile =
2733 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); 2737 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
2734 scoped_refptr<FakePicturePileImpl> active_pile = 2738 scoped_refptr<FakePicturePileImpl> active_pile =
2735 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); 2739 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
2736 2740
2737 SetupTrees(pending_pile, active_pile); 2741 SetupTrees(pending_pile, active_pile);
(...skipping 27 matching lines...) Expand all
2765 quad_culler.shared_quad_state_list()[0]->content_bounds.ToString()); 2769 quad_culler.shared_quad_state_list()[0]->content_bounds.ToString());
2766 // The visible_content_rect should be scaled by the 2770 // The visible_content_rect should be scaled by the
2767 // MaximumTilingContentsScale on the layer. 2771 // MaximumTilingContentsScale on the layer.
2768 EXPECT_EQ( 2772 EXPECT_EQ(
2769 gfx::Rect(0u, 0u, 2500u, 5000u).ToString(), 2773 gfx::Rect(0u, 0u, 2500u, 5000u).ToString(),
2770 quad_culler.shared_quad_state_list()[0]->visible_content_rect.ToString()); 2774 quad_culler.shared_quad_state_list()[0]->visible_content_rect.ToString());
2771 } 2775 }
2772 2776
2773 } // namespace 2777 } // namespace
2774 } // namespace cc 2778 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_image_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