| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 5 #ifndef CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
| 6 #define CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 6 #define CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 PictureLayerTilingClient* client); | 128 PictureLayerTilingClient* client); |
| 129 gfx::Size layer_bounds() const { return layer_bounds_; } | 129 gfx::Size layer_bounds() const { return layer_bounds_; } |
| 130 void UpdateTilesToCurrentPile(const Region& layer_invalidation, | 130 void UpdateTilesToCurrentPile(const Region& layer_invalidation, |
| 131 const gfx::Size& new_layer_bounds); | 131 const gfx::Size& new_layer_bounds); |
| 132 void CreateMissingTilesInLiveTilesRect(); | 132 void CreateMissingTilesInLiveTilesRect(); |
| 133 | 133 |
| 134 void SetClient(PictureLayerTilingClient* client); | 134 void SetClient(PictureLayerTilingClient* client); |
| 135 void set_resolution(TileResolution resolution) { resolution_ = resolution; } | 135 void set_resolution(TileResolution resolution) { resolution_ = resolution; } |
| 136 TileResolution resolution() const { return resolution_; } | 136 TileResolution resolution() const { return resolution_; } |
| 137 | 137 |
| 138 gfx::Rect TilingRect() const; | 138 gfx::Size tiling_size() const { return tiling_data_.tiling_size(); } |
| 139 gfx::Rect live_tiles_rect() const { return live_tiles_rect_; } | 139 gfx::Rect live_tiles_rect() const { return live_tiles_rect_; } |
| 140 gfx::Size tile_size() const { return tiling_data_.max_texture_size(); } | 140 gfx::Size tile_size() const { return tiling_data_.max_texture_size(); } |
| 141 float contents_scale() const { return contents_scale_; } | 141 float contents_scale() const { return contents_scale_; } |
| 142 | 142 |
| 143 Tile* TileAt(int i, int j) const { | 143 Tile* TileAt(int i, int j) const { |
| 144 TileMap::const_iterator iter = tiles_.find(TileMapKey(i, j)); | 144 TileMap::const_iterator iter = tiles_.find(TileMapKey(i, j)); |
| 145 return (iter == tiles_.end()) ? NULL : iter->second.get(); | 145 return (iter == tiles_.end()) ? NULL : iter->second.get(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void CreateAllTilesForTesting() { | 148 void CreateAllTilesForTesting() { |
| 149 SetLiveTilesRect(tiling_data_.tiling_rect()); | 149 SetLiveTilesRect(gfx::Rect(tiling_data_.tiling_size())); |
| 150 } | 150 } |
| 151 | 151 |
| 152 const TilingData& TilingDataForTesting() const { return tiling_data_; } | 152 const TilingData& TilingDataForTesting() const { return tiling_data_; } |
| 153 | 153 |
| 154 std::vector<Tile*> AllTilesForTesting() const { | 154 std::vector<Tile*> AllTilesForTesting() const { |
| 155 std::vector<Tile*> all_tiles; | 155 std::vector<Tile*> all_tiles; |
| 156 for (TileMap::const_iterator it = tiles_.begin(); | 156 for (TileMap::const_iterator it = tiles_.begin(); |
| 157 it != tiles_.end(); ++it) | 157 it != tiles_.end(); ++it) |
| 158 all_tiles.push_back(it->second.get()); | 158 all_tiles.push_back(it->second.get()); |
| 159 return all_tiles; | 159 return all_tiles; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 | 309 |
| 310 private: | 310 private: |
| 311 DISALLOW_ASSIGN(PictureLayerTiling); | 311 DISALLOW_ASSIGN(PictureLayerTiling); |
| 312 | 312 |
| 313 RectExpansionCache expansion_cache_; | 313 RectExpansionCache expansion_cache_; |
| 314 }; | 314 }; |
| 315 | 315 |
| 316 } // namespace cc | 316 } // namespace cc |
| 317 | 317 |
| 318 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 318 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
| OLD | NEW |