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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) | 175 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) |
176 all_tiles.push_back(it->second.get()); | 176 all_tiles.push_back(it->second.get()); |
177 return all_tiles; | 177 return all_tiles; |
178 } | 178 } |
179 | 179 |
180 void UpdateAllTilePrioritiesForTesting() { | 180 void UpdateAllTilePrioritiesForTesting() { |
181 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) | 181 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) |
182 UpdateTileAndTwinPriority(it->second.get()); | 182 UpdateTileAndTwinPriority(it->second.get()); |
183 } | 183 } |
184 | 184 |
185 std::vector<scoped_refptr<Tile> > AllRefTilesForTesting() const { | 185 std::vector<scoped_refptr<Tile>> AllRefTilesForTesting() const { |
186 std::vector<scoped_refptr<Tile> > all_tiles; | 186 std::vector<scoped_refptr<Tile>> all_tiles; |
187 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) | 187 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) |
188 all_tiles.push_back(it->second); | 188 all_tiles.push_back(it->second); |
189 return all_tiles; | 189 return all_tiles; |
190 } | 190 } |
191 | 191 |
192 void SetAllTilesOccludedForTesting() { | 192 void SetAllTilesOccludedForTesting() { |
193 gfx::Rect viewport_in_layer_space = | 193 gfx::Rect viewport_in_layer_space = |
194 ScaleToEnclosingRect(current_visible_rect_, 1.0f / contents_scale_); | 194 ScaleToEnclosingRect(current_visible_rect_, 1.0f / contents_scale_); |
195 current_occlusion_in_layer_space_ = | 195 current_occlusion_in_layer_space_ = |
196 Occlusion(gfx::Transform(), | 196 Occlusion(gfx::Transform(), |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 bool has_ever_been_updated() const { | 289 bool has_ever_been_updated() const { |
290 return last_impl_frame_time_in_seconds_ != 0.0; | 290 return last_impl_frame_time_in_seconds_ != 0.0; |
291 } | 291 } |
292 | 292 |
293 protected: | 293 protected: |
294 friend class CoverageIterator; | 294 friend class CoverageIterator; |
295 friend class TilingRasterTileIterator; | 295 friend class TilingRasterTileIterator; |
296 friend class TilingEvictionTileIterator; | 296 friend class TilingEvictionTileIterator; |
297 | 297 |
298 typedef std::pair<int, int> TileMapKey; | 298 typedef std::pair<int, int> TileMapKey; |
299 typedef base::hash_map<TileMapKey, scoped_refptr<Tile> > TileMap; | 299 typedef base::hash_map<TileMapKey, scoped_refptr<Tile>> TileMap; |
300 | 300 |
301 PictureLayerTiling(float contents_scale, | 301 PictureLayerTiling(float contents_scale, |
302 const gfx::Size& layer_bounds, | 302 const gfx::Size& layer_bounds, |
303 PictureLayerTilingClient* client); | 303 PictureLayerTilingClient* client); |
304 void SetLiveTilesRect(const gfx::Rect& live_tiles_rect); | 304 void SetLiveTilesRect(const gfx::Rect& live_tiles_rect); |
305 void VerifyLiveTilesRect(); | 305 void VerifyLiveTilesRect(); |
306 Tile* CreateTile(int i, int j, const PictureLayerTiling* twin_tiling); | 306 Tile* CreateTile(int i, int j, const PictureLayerTiling* twin_tiling); |
307 // Returns true if the Tile existed and was removed from the tiling. | 307 // Returns true if the Tile existed and was removed from the tiling. |
308 bool RemoveTileAt(int i, int j, PictureLayerTiling* recycled_twin); | 308 bool RemoveTileAt(int i, int j, PictureLayerTiling* recycled_twin); |
309 | 309 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 | 373 |
374 private: | 374 private: |
375 DISALLOW_ASSIGN(PictureLayerTiling); | 375 DISALLOW_ASSIGN(PictureLayerTiling); |
376 | 376 |
377 RectExpansionCache expansion_cache_; | 377 RectExpansionCache expansion_cache_; |
378 }; | 378 }; |
379 | 379 |
380 } // namespace cc | 380 } // namespace cc |
381 | 381 |
382 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 382 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
OLD | NEW |