| Index: cc/resources/tile_manager_perftest.cc
 | 
| diff --git a/cc/resources/tile_manager_perftest.cc b/cc/resources/tile_manager_perftest.cc
 | 
| index 9a651a2afa45b74942e2f42f11b52ec4d1535559..5da12d0bcdc79acd3d5c811561dbdbc2e9ae3e75 100644
 | 
| --- a/cc/resources/tile_manager_perftest.cc
 | 
| +++ b/cc/resources/tile_manager_perftest.cc
 | 
| @@ -7,6 +7,7 @@
 | 
|  #include "cc/resources/tile_priority.h"
 | 
|  #include "cc/test/fake_output_surface.h"
 | 
|  #include "cc/test/fake_output_surface_client.h"
 | 
| +#include "cc/test/fake_picture_layer_tiling_client.h"
 | 
|  #include "cc/test/fake_picture_pile_impl.h"
 | 
|  #include "cc/test/fake_tile_manager.h"
 | 
|  #include "cc/test/fake_tile_manager_client.h"
 | 
| @@ -26,8 +27,8 @@ static const int kTimeCheckInterval = 10;
 | 
|  
 | 
|  class TileManagerPerfTest : public testing::Test {
 | 
|   public:
 | 
| -  typedef std::vector<std::pair<scoped_refptr<Tile>, ManagedTileBin> >
 | 
| -      TileBinVector;
 | 
| +  typedef std::vector<std::pair<scoped_refptr<TileBundle>, ManagedTileBin> >
 | 
| +      TileBundleBinVector;
 | 
|  
 | 
|    TileManagerPerfTest()
 | 
|        : timer_(kWarmupRuns,
 | 
| @@ -47,6 +48,8 @@ class TileManagerPerfTest : public testing::Test {
 | 
|                              resource_provider_.get(),
 | 
|                              raster_task_limit_bytes));
 | 
|      picture_pile_ = FakePicturePileImpl::CreatePile();
 | 
| +    picture_layer_tiling_client_ =
 | 
| +        make_scoped_ptr(new FakePictureLayerTilingClient(tile_manager_.get()));
 | 
|    }
 | 
|  
 | 
|    GlobalStateThatImpactsTilePriority GlobalStateForTest() {
 | 
| @@ -62,6 +65,7 @@ class TileManagerPerfTest : public testing::Test {
 | 
|    }
 | 
|  
 | 
|    virtual void TearDown() OVERRIDE {
 | 
| +    picture_layer_tiling_client_.reset(NULL);
 | 
|      tile_manager_.reset(NULL);
 | 
|      picture_pile_ = NULL;
 | 
|    }
 | 
| @@ -106,30 +110,38 @@ class TileManagerPerfTest : public testing::Test {
 | 
|      }
 | 
|    }
 | 
|  
 | 
| -  void CreateBinTiles(int count, ManagedTileBin bin, TileBinVector* tiles) {
 | 
| +  void CreateBinTileBundles(int count,
 | 
| +                            ManagedTileBin bin,
 | 
| +                            TileBundleBinVector* bundles) {
 | 
|      for (int i = 0; i < count; ++i) {
 | 
| -      scoped_refptr<Tile> tile =
 | 
| -          tile_manager_->CreateTile(picture_pile_.get(),
 | 
| -                                    settings_.default_tile_size,
 | 
| -                                    gfx::Rect(),
 | 
| -                                    gfx::Rect(),
 | 
| -                                    1.0,
 | 
| -                                    0,
 | 
| -                                    0,
 | 
| -                                    Tile::USE_LCD_TEXT);
 | 
| -      tile->SetPriority(ACTIVE_TREE, GetTilePriorityFromBin(bin));
 | 
| -      tile->SetPriority(PENDING_TREE, GetTilePriorityFromBin(bin));
 | 
| -      tiles->push_back(std::make_pair(tile, bin));
 | 
| +      scoped_refptr<TileBundle> bundle =
 | 
| +          picture_layer_tiling_client_->CreateTileBundle(0, 0, 2, 2);
 | 
| +      bundle->SetPriority(ACTIVE_TREE, GetTilePriorityFromBin(bin));
 | 
| +      bundle->SetPriority(PENDING_TREE, GetTilePriorityFromBin(bin));
 | 
| +      for (int j = 0; j < 4; ++j) {
 | 
| +        scoped_refptr<Tile> tile =
 | 
| +            tile_manager_->CreateTile(picture_pile_.get(),
 | 
| +                                      settings_.default_tile_size,
 | 
| +                                      gfx::Rect(),
 | 
| +                                      gfx::Rect(),
 | 
| +                                      1.0,
 | 
| +                                      0,
 | 
| +                                      0,
 | 
| +                                      Tile::USE_LCD_TEXT);
 | 
| +        bundle->AddTileAt(ACTIVE_TREE, j % 2, j / 2, tile);
 | 
| +        bundle->AddTileAt(PENDING_TREE, j % 2, j / 2, tile);
 | 
| +      }
 | 
| +      bundles->push_back(std::make_pair(bundle, bin));
 | 
|      }
 | 
|    }
 | 
|  
 | 
| -  void CreateTiles(int count, TileBinVector* tiles) {
 | 
| +  void CreateBundles(int count, TileBundleBinVector* bundles) {
 | 
|      // Roughly an equal amount of all bins.
 | 
|      int count_per_bin = count / NUM_BINS;
 | 
| -    CreateBinTiles(count_per_bin, NOW_BIN, tiles);
 | 
| -    CreateBinTiles(count_per_bin, SOON_BIN, tiles);
 | 
| -    CreateBinTiles(count_per_bin, EVENTUALLY_BIN, tiles);
 | 
| -    CreateBinTiles(count - 3 * count_per_bin, NEVER_BIN, tiles);
 | 
| +    CreateBinTileBundles(count_per_bin, NOW_BIN, bundles);
 | 
| +    CreateBinTileBundles(count_per_bin, SOON_BIN, bundles);
 | 
| +    CreateBinTileBundles(count_per_bin, EVENTUALLY_BIN, bundles);
 | 
| +    CreateBinTileBundles(count - 3 * count_per_bin, NEVER_BIN, bundles);
 | 
|    }
 | 
|  
 | 
|    void RunManageTilesTest(const std::string& test_name,
 | 
| @@ -138,19 +150,21 @@ class TileManagerPerfTest : public testing::Test {
 | 
|      DCHECK_GE(tile_count, 100u);
 | 
|      DCHECK_GE(priority_change_percent, 0);
 | 
|      DCHECK_LE(priority_change_percent, 100);
 | 
| -    TileBinVector tiles;
 | 
| -    CreateTiles(tile_count, &tiles);
 | 
| +    TileBundleBinVector bundles;
 | 
| +
 | 
| +    unsigned bundle_count = tile_count / 4;
 | 
| +    CreateBundles(bundle_count, &bundles);
 | 
|      timer_.Reset();
 | 
|      do {
 | 
|        if (priority_change_percent > 0) {
 | 
|          for (unsigned i = 0;
 | 
| -             i < tile_count;
 | 
| +             i < bundle_count;
 | 
|               i += 100 / priority_change_percent) {
 | 
| -          Tile* tile = tiles[i].first.get();
 | 
| -          ManagedTileBin bin = GetNextBin(tiles[i].second);
 | 
| -          tile->SetPriority(ACTIVE_TREE, GetTilePriorityFromBin(bin));
 | 
| -          tile->SetPriority(PENDING_TREE, GetTilePriorityFromBin(bin));
 | 
| -          tiles[i].second = bin;
 | 
| +          TileBundle* bundle = bundles[i].first.get();
 | 
| +          ManagedTileBin bin = GetNextBin(bundles[i].second);
 | 
| +          bundle->SetPriority(ACTIVE_TREE, GetTilePriorityFromBin(bin));
 | 
| +          bundle->SetPriority(PENDING_TREE, GetTilePriorityFromBin(bin));
 | 
| +          bundles[i].second = bin;
 | 
|          }
 | 
|        }
 | 
|  
 | 
| @@ -165,6 +179,7 @@ class TileManagerPerfTest : public testing::Test {
 | 
|  
 | 
|   private:
 | 
|    FakeTileManagerClient tile_manager_client_;
 | 
| +  scoped_ptr<FakePictureLayerTilingClient> picture_layer_tiling_client_;
 | 
|    LayerTreeSettings settings_;
 | 
|    scoped_ptr<FakeTileManager> tile_manager_;
 | 
|    scoped_refptr<FakePicturePileImpl> picture_pile_;
 | 
| 
 |