| 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 void Invalidate(const Region& layer_region); | 128 void Invalidate(const Region& layer_region); |
| 129 void RemoveTilesInRegion(const Region& layer_region); | 129 void RemoveTilesInRegion(const Region& layer_region); |
| 130 void CreateMissingTilesInLiveTilesRect(); | 130 void CreateMissingTilesInLiveTilesRect(); |
| 131 | 131 |
| 132 void SetCanUseLCDText(bool can_use_lcd_text); | 132 void SetCanUseLCDText(bool can_use_lcd_text); |
| 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 ContentRect() const; | 138 gfx::Rect TilingRect() const; |
| 139 gfx::SizeF ContentSizeF() const; | |
| 140 gfx::Rect live_tiles_rect() const { return live_tiles_rect_; } | 139 gfx::Rect live_tiles_rect() const { return live_tiles_rect_; } |
| 141 gfx::Size tile_size() const { return tiling_data_.max_texture_size(); } | 140 gfx::Size tile_size() const { return tiling_data_.max_texture_size(); } |
| 142 float contents_scale() const { return contents_scale_; } | 141 float contents_scale() const { return contents_scale_; } |
| 143 | 142 |
| 144 Tile* TileAt(int i, int j) const { | 143 Tile* TileAt(int i, int j) const { |
| 145 TileMap::const_iterator iter = tiles_.find(TileMapKey(i, j)); | 144 TileMap::const_iterator iter = tiles_.find(TileMapKey(i, j)); |
| 146 return (iter == tiles_.end()) ? NULL : iter->second.get(); | 145 return (iter == tiles_.end()) ? NULL : iter->second.get(); |
| 147 } | 146 } |
| 148 | 147 |
| 149 void CreateAllTilesForTesting() { | 148 void CreateAllTilesForTesting() { |
| 150 SetLiveTilesRect(gfx::Rect(tiling_data_.total_size())); | 149 SetLiveTilesRect(tiling_data_.tiling_rect()); |
| 151 } | 150 } |
| 152 | 151 |
| 153 std::vector<Tile*> AllTilesForTesting() const { | 152 std::vector<Tile*> AllTilesForTesting() const { |
| 154 std::vector<Tile*> all_tiles; | 153 std::vector<Tile*> all_tiles; |
| 155 for (TileMap::const_iterator it = tiles_.begin(); | 154 for (TileMap::const_iterator it = tiles_.begin(); |
| 156 it != tiles_.end(); ++it) | 155 it != tiles_.end(); ++it) |
| 157 all_tiles.push_back(it->second.get()); | 156 all_tiles.push_back(it->second.get()); |
| 158 return all_tiles; | 157 return all_tiles; |
| 159 } | 158 } |
| 160 | 159 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 | 306 |
| 308 private: | 307 private: |
| 309 DISALLOW_ASSIGN(PictureLayerTiling); | 308 DISALLOW_ASSIGN(PictureLayerTiling); |
| 310 | 309 |
| 311 RectExpansionCache expansion_cache_; | 310 RectExpansionCache expansion_cache_; |
| 312 }; | 311 }; |
| 313 | 312 |
| 314 } // namespace cc | 313 } // namespace cc |
| 315 | 314 |
| 316 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 315 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
| OLD | NEW |