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

Side by Side Diff: cc/resources/tile_manager_unittest.cc

Issue 49163004: cc: Reduce command buffer flushes related to creating texture ids. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « cc/resources/tile_manager_perftest.cc ('k') | cc/resources/video_resource_updater_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/resources/tile.h" 5 #include "cc/resources/tile.h"
6 #include "cc/resources/tile_priority.h" 6 #include "cc/resources/tile_priority.h"
7 #include "cc/test/fake_output_surface.h" 7 #include "cc/test/fake_output_surface.h"
8 #include "cc/test/fake_output_surface_client.h" 8 #include "cc/test/fake_output_surface_client.h"
9 #include "cc/test/fake_picture_pile_impl.h" 9 #include "cc/test/fake_picture_pile_impl.h"
10 #include "cc/test/fake_tile_manager.h" 10 #include "cc/test/fake_tile_manager.h"
11 #include "cc/test/fake_tile_manager_client.h" 11 #include "cc/test/fake_tile_manager_client.h"
12 #include "cc/test/test_tile_priorities.h" 12 #include "cc/test/test_tile_priorities.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 namespace cc { 15 namespace cc {
16 namespace { 16 namespace {
17 17
18 class TileManagerTest : public testing::TestWithParam<bool> { 18 class TileManagerTest : public testing::TestWithParam<bool> {
19 public: 19 public:
20 typedef std::vector<scoped_refptr<Tile> > TileVector; 20 typedef std::vector<scoped_refptr<Tile> > TileVector;
21 21
22 void Initialize(int max_tiles, 22 void Initialize(int max_tiles,
23 TileMemoryLimitPolicy memory_limit_policy, 23 TileMemoryLimitPolicy memory_limit_policy,
24 TreePriority tree_priority) { 24 TreePriority tree_priority) {
25 output_surface_ = FakeOutputSurface::Create3d(); 25 output_surface_ = FakeOutputSurface::Create3d();
26 CHECK(output_surface_->BindToClient(&output_surface_client_)); 26 CHECK(output_surface_->BindToClient(&output_surface_client_));
27 27
28 resource_provider_ = 28 resource_provider_ =
29 ResourceProvider::Create(output_surface_.get(), NULL, 0, false); 29 ResourceProvider::Create(output_surface_.get(), NULL, 0, false, 1);
30 tile_manager_ = make_scoped_ptr( 30 tile_manager_ = make_scoped_ptr(
31 new FakeTileManager(&tile_manager_client_, resource_provider_.get())); 31 new FakeTileManager(&tile_manager_client_, resource_provider_.get()));
32 32
33 memory_limit_policy_ = memory_limit_policy; 33 memory_limit_policy_ = memory_limit_policy;
34 max_memory_tiles_ = max_tiles; 34 max_memory_tiles_ = max_tiles;
35 GlobalStateThatImpactsTilePriority state; 35 GlobalStateThatImpactsTilePriority state;
36 gfx::Size tile_size = settings_.default_tile_size; 36 gfx::Size tile_size = settings_.default_tile_size;
37 37
38 // The parametrization specifies whether the max tile limit should 38 // The parametrization specifies whether the max tile limit should
39 // be applied to RAM or to tile limit. 39 // be applied to RAM or to tile limit.
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 } 521 }
522 522
523 // If true, the max tile limit should be applied as bytes; if false, 523 // If true, the max tile limit should be applied as bytes; if false,
524 // as num_resources_limit. 524 // as num_resources_limit.
525 INSTANTIATE_TEST_CASE_P(TileManagerTests, 525 INSTANTIATE_TEST_CASE_P(TileManagerTests,
526 TileManagerTest, 526 TileManagerTest,
527 ::testing::Values(true, false)); 527 ::testing::Values(true, false));
528 528
529 } // namespace 529 } // namespace
530 } // namespace cc 530 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/tile_manager_perftest.cc ('k') | cc/resources/video_resource_updater_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698