Chromium Code Reviews| 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 <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 152 can_require_tiles_for_activation_ = can_require_tiles; | 152 can_require_tiles_for_activation_ = can_require_tiles; |
| 153 } | 153 } |
| 154 | 154 |
| 155 gfx::Size tiling_size() const { return tiling_data_.tiling_size(); } | 155 gfx::Size tiling_size() const { return tiling_data_.tiling_size(); } |
| 156 gfx::Rect live_tiles_rect() const { return live_tiles_rect_; } | 156 gfx::Rect live_tiles_rect() const { return live_tiles_rect_; } |
| 157 gfx::Size tile_size() const { return tiling_data_.max_texture_size(); } | 157 gfx::Size tile_size() const { return tiling_data_.max_texture_size(); } |
| 158 float contents_scale() const { return contents_scale_; } | 158 float contents_scale() const { return contents_scale_; } |
| 159 | 159 |
| 160 Tile* TileAt(int i, int j) const { | 160 Tile* TileAt(int i, int j) const { |
| 161 TileMap::const_iterator iter = tiles_.find(TileMapKey(i, j)); | 161 TileMap::const_iterator iter = tiles_.find(TileMapKey(i, j)); |
| 162 return (iter == tiles_.end()) ? NULL : iter->second.get(); | 162 return (iter == tiles_.end()) ? nullptr : iter->second.get(); |
| 163 } | 163 } |
| 164 | 164 |
| 165 void CreateAllTilesForTesting() { | 165 void CreateAllTilesForTesting() { |
| 166 SetLiveTilesRect(gfx::Rect(tiling_data_.tiling_size())); | 166 SetLiveTilesRect(gfx::Rect(tiling_data_.tiling_size())); |
| 167 } | 167 } |
| 168 | 168 |
| 169 const TilingData& TilingDataForTesting() const { return tiling_data_; } | 169 const TilingData& TilingDataForTesting() const { return tiling_data_; } |
| 170 | 170 |
| 171 std::vector<Tile*> AllTilesForTesting() const { | 171 std::vector<Tile*> AllTilesForTesting() const { |
| 172 std::vector<Tile*> all_tiles; | 172 std::vector<Tile*> all_tiles; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 326 void UpdateTilePriority(Tile* tile) const; | 326 void UpdateTilePriority(Tile* tile) const; |
| 327 | 327 |
| 328 // Given properties. | 328 // Given properties. |
| 329 float contents_scale_; | 329 float contents_scale_; |
| 330 gfx::Size layer_bounds_; | 330 gfx::Size layer_bounds_; |
| 331 TileResolution resolution_; | 331 TileResolution resolution_; |
| 332 PictureLayerTilingClient* client_; | 332 PictureLayerTilingClient* client_; |
| 333 | 333 |
| 334 // Internal data. | 334 // Internal data. |
| 335 TilingData tiling_data_; | 335 TilingData tiling_data_; |
| 336 TileMap tiles_; // It is not legal to have a NULL tile in the tiles_ map. | 336 TileMap tiles_; // It is not legal to have a nullptr tile in the tiles_ map. |
|
danakj
2014/10/10 17:28:45
just use null in comments like this
| |
| 337 gfx::Rect live_tiles_rect_; | 337 gfx::Rect live_tiles_rect_; |
| 338 | 338 |
| 339 // State saved for computing velocities based upon finite differences. | 339 // State saved for computing velocities based upon finite differences. |
| 340 double last_impl_frame_time_in_seconds_; | 340 double last_impl_frame_time_in_seconds_; |
| 341 gfx::Rect last_visible_rect_in_content_space_; | 341 gfx::Rect last_visible_rect_in_content_space_; |
| 342 float content_to_screen_scale_; | 342 float content_to_screen_scale_; |
| 343 | 343 |
| 344 bool can_require_tiles_for_activation_; | 344 bool can_require_tiles_for_activation_; |
| 345 | 345 |
| 346 // Iteration rects in content space | 346 // Iteration rects in content space |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 371 | 371 |
| 372 private: | 372 private: |
| 373 DISALLOW_ASSIGN(PictureLayerTiling); | 373 DISALLOW_ASSIGN(PictureLayerTiling); |
| 374 | 374 |
| 375 RectExpansionCache expansion_cache_; | 375 RectExpansionCache expansion_cache_; |
| 376 }; | 376 }; |
| 377 | 377 |
| 378 } // namespace cc | 378 } // namespace cc |
| 379 | 379 |
| 380 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 380 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
| OLD | NEW |