| 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 <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 TileResolution resolution() const { return resolution_; } | 84 TileResolution resolution() const { return resolution_; } |
| 85 void set_can_require_tiles_for_activation(bool can_require_tiles) { | 85 void set_can_require_tiles_for_activation(bool can_require_tiles) { |
| 86 can_require_tiles_for_activation_ = can_require_tiles; | 86 can_require_tiles_for_activation_ = can_require_tiles; |
| 87 } | 87 } |
| 88 | 88 |
| 89 RasterSource* raster_source() const { return raster_source_.get(); } | 89 RasterSource* raster_source() const { return raster_source_.get(); } |
| 90 gfx::Size tiling_size() const { return tiling_data_.tiling_size(); } | 90 gfx::Size tiling_size() const { return tiling_data_.tiling_size(); } |
| 91 gfx::Rect live_tiles_rect() const { return live_tiles_rect_; } | 91 gfx::Rect live_tiles_rect() const { return live_tiles_rect_; } |
| 92 gfx::Size tile_size() const { return tiling_data_.max_texture_size(); } | 92 gfx::Size tile_size() const { return tiling_data_.max_texture_size(); } |
| 93 float contents_scale() const { return contents_scale_; } | 93 float contents_scale() const { return contents_scale_; } |
| 94 const TilingData* tiling_data() const { return &tiling_data_; } |
| 94 | 95 |
| 95 Tile* TileAt(int i, int j) const { | 96 Tile* TileAt(int i, int j) const { |
| 96 TileMap::const_iterator iter = tiles_.find(TileMapKey(i, j)); | 97 TileMap::const_iterator iter = tiles_.find(TileMapKey(i, j)); |
| 97 return (iter == tiles_.end()) ? NULL : iter->second.get(); | 98 return (iter == tiles_.end()) ? NULL : iter->second.get(); |
| 98 } | 99 } |
| 99 | 100 |
| 100 void CreateAllTilesForTesting() { | 101 void CreateAllTilesForTesting() { |
| 101 SetLiveTilesRect(gfx::Rect(tiling_data_.tiling_size())); | 102 SetLiveTilesRect(gfx::Rect(tiling_data_.tiling_size())); |
| 102 } | 103 } |
| 103 | 104 |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 | 341 |
| 341 private: | 342 private: |
| 342 DISALLOW_ASSIGN(PictureLayerTiling); | 343 DISALLOW_ASSIGN(PictureLayerTiling); |
| 343 | 344 |
| 344 RectExpansionCache expansion_cache_; | 345 RectExpansionCache expansion_cache_; |
| 345 }; | 346 }; |
| 346 | 347 |
| 347 } // namespace cc | 348 } // namespace cc |
| 348 | 349 |
| 349 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 350 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
| OLD | NEW |