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

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

Issue 767083005: cc: Rename TileManager::ManageTiles to PrepareTiles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a Trace name. Created 6 years 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 | « no previous file | cc/resources/tile_manager.h » ('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 3806 matching lines...) Expand 10 before | Expand all | Expand 10 after
3817 // state. We also need to update tree priority separately. 3817 // state. We also need to update tree priority separately.
3818 GlobalStateThatImpactsTilePriority state; 3818 GlobalStateThatImpactsTilePriority state;
3819 size_t max_tiles = 1; 3819 size_t max_tiles = 1;
3820 size_t memory_limit = max_tiles * 4 * tile_size.width() * tile_size.height(); 3820 size_t memory_limit = max_tiles * 4 * tile_size.width() * tile_size.height();
3821 size_t resource_limit = max_tiles; 3821 size_t resource_limit = max_tiles;
3822 ManagedMemoryPolicy policy(memory_limit, 3822 ManagedMemoryPolicy policy(memory_limit,
3823 gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING, 3823 gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING,
3824 resource_limit); 3824 resource_limit);
3825 host_impl_.SetMemoryPolicy(policy); 3825 host_impl_.SetMemoryPolicy(policy);
3826 host_impl_.SetTreePriority(SAME_PRIORITY_FOR_BOTH_TREES); 3826 host_impl_.SetTreePriority(SAME_PRIORITY_FOR_BOTH_TREES);
3827 host_impl_.ManageTiles(); 3827 host_impl_.PrepareTiles();
3828 3828
3829 scoped_ptr<RenderPass> render_pass = RenderPass::Create(); 3829 scoped_ptr<RenderPass> render_pass = RenderPass::Create();
3830 AppendQuadsData data; 3830 AppendQuadsData data;
3831 active_layer_->WillDraw(DRAW_MODE_HARDWARE, nullptr); 3831 active_layer_->WillDraw(DRAW_MODE_HARDWARE, nullptr);
3832 active_layer_->AppendQuads(render_pass.get(), Occlusion(), &data); 3832 active_layer_->AppendQuads(render_pass.get(), Occlusion(), &data);
3833 active_layer_->DidDraw(nullptr); 3833 active_layer_->DidDraw(nullptr);
3834 3834
3835 // Even when OOM, quads should be produced, and should be different material 3835 // Even when OOM, quads should be produced, and should be different material
3836 // from quads with resource. 3836 // from quads with resource.
3837 EXPECT_LT(max_tiles, render_pass->quad_list.size()); 3837 EXPECT_LT(max_tiles, render_pass->quad_list.size());
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after
4756 result = layer->CalculateTileSize(gfx::Size(447, 400)); 4756 result = layer->CalculateTileSize(gfx::Size(447, 400));
4757 EXPECT_EQ(result.width(), 448); 4757 EXPECT_EQ(result.width(), 448);
4758 EXPECT_EQ(result.height(), 448); 4758 EXPECT_EQ(result.height(), 448);
4759 result = layer->CalculateTileSize(gfx::Size(500, 499)); 4759 result = layer->CalculateTileSize(gfx::Size(500, 499));
4760 EXPECT_EQ(result.width(), 512); 4760 EXPECT_EQ(result.width(), 512);
4761 EXPECT_EQ(result.height(), 500 + 2); 4761 EXPECT_EQ(result.height(), 500 + 2);
4762 } 4762 }
4763 4763
4764 } // namespace 4764 } // namespace
4765 } // namespace cc 4765 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/resources/tile_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698